CentOS 6.5配置本地DVD yum 源

[[email protected] yum.repos.d]# cat /etc/redhat-release
CentOS release 6.5 (Final)

[[email protected] yum.repos.d]# uname -a
Linux centos06 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

[[email protected] yum.repos.d]# pwd
/etc/yum.repos.d

[[email protected] yum.repos.d]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_centos03-lv_root 18G 1.9G 15G 12% /
tmpfs 116M 0 116M 0% /dev/shm
/dev/sda1 485M 34M 426M 8% /boot
/dev/sr0 4.2G 4.2G 0 100% /mnt

[[email protected] yum.repos.d]# ls -ltr
total 16
-rw-r--r--. 1 root root 3664 Nov 27 2013 CentOS-Vault.repo
-rw-r--r--. 1 root root 630 Nov 27 2013 CentOS-Media.repo
-rw-r--r--. 1 root root 638 Nov 27 2013 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 1926 Nov 27 2013 CentOS-Base.repo

[[email protected] yum.repos.d]# ls -ltr
\total 16
-rw-r--r--. 1 root root 3664 Nov 27 2013 CentOS-Vault.repo
-rw-r--r--. 1 root root 630 Nov 27 2013 CentOS-Media.repo
-rw-r--r--. 1 root root 638 Nov 27 2013 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 1926 Nov 27 2013 CentOS-Base.repo

[[email protected] yum.repos.d]# mkdir /mnt/iso

[[email protected] yum.repos.d]# mount -t iso9660 -o loop /dev/cdrom /mnt/iso

[[email protected] yum.repos.d]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_centos03-lv_root 18G 1.9G 15G 12% /
tmpfs 116M 0 116M 0% /dev/shm
/dev/sda1 485M 34M 426M 8% /boot
/dev/sr0 4.2G 4.2G 0 100% /mnt/iso

[[email protected] yum.repos.d]# ls -ltr /mnt/iso/
total 682
-r--r--r--. 2 root root 1734 Nov 28 2013 RPM-GPG-KEY-CentOS-Testing-6
-r--r--r--. 2 root root 1730 Nov 28 2013 RPM-GPG-KEY-CentOS-Security-6
-r--r--r--. 2 root root 1730 Nov 28 2013 RPM-GPG-KEY-CentOS-Debug-6
-r--r--r--. 2 root root 1706 Nov 28 2013 RPM-GPG-KEY-CentOS-6
-r--r--r--. 2 root root 18009 Nov 28 2013 GPL
-r--r--r--. 2 root root 212 Nov 28 2013 EULA
-r--r--r--. 2 root root 1354 Nov 28 2013 RELEASE-NOTES-en-US.html
-r--r--r--. 2 root root 14 Nov 29 2013 CentOS_BuildTag
dr-xr-xr-x. 2 root root 2048 Nov 29 2013 isolinux
dr-xr-xr-x. 3 root root 2048 Nov 29 2013 EFI
dr-xr-xr-x. 2 root root 655360 Nov 29 2013 Packages
dr-xr-xr-x. 2 root root 4096 Nov 29 2013 repodata
-r--r--r--. 1 root root 3380 Nov 29 2013 TRANS.TBL
dr-xr-xr-x. 3 root root 2048 Nov 29 2013 images

[[email protected] yum.repos.d]# ls -ltr /mnt/iso/Packages | head
total 4084837
-r--r--r--. 2 root root 169428 Jul 3 2011 abyssinica-fonts-1.0-5.1.el6.noarch.rpm
-r--r--r--. 3 root root 22944 Jul 3 2011 aic94xx-firmware-30-2.el6.noarch.rpm
-r--r--r--. 2 root root 556228 Jul 3 2011 akonadi-1.2.1-2.el6.i686.rpm
-r--r--r--. 2 root root 127636 Jul 3 2011 alacarte-0.12.4-1.el6.noarch.rpm
-r--r--r--. 2 root root 35156 Jul 3 2011 alsa-plugins-pulseaudio-1.0.21-3.el6.i686.rpm
-r--r--r--. 2 root root 6287552 Jul 3 2011 anthy-9100h-10.1.el6.i686.rpm
-r--r--r--. 2 root root 1855532 Jul 3 2011 apache-jasper-5.5.28-3.el6.noarch.rpm
-r--r--r--. 2 root root 167500 Jul 3 2011 apache-tomcat-apis-0.1-1.el6.noarch.rpm
-r--r--r--. 2 root root 933716 Jul 3 2011 arts-1.5.10-10.el6.i686.rpm

[[email protected] yum.repos.d]# ls -ltr
total 16
-rw-r--r--. 1 root root 3664 Nov 27 2013 CentOS-Vault.repo
-rw-r--r--. 1 root root 630 Nov 27 2013 CentOS-Media.repo
-rw-r--r--. 1 root root 638 Nov 27 2013 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 1926 Nov 27 2013 CentOS-Base.repo

[[email protected] yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bk.20180124

[[email protected] yum.repos.d]# cp -p CentOS-Media.repo CentOS-Media.repo.bk.20180124

[[email protected] yum.repos.d]# vi CentOS-Media.repo

[[email protected] yum.repos.d]# diff CentOS-Media.repo CentOS-Media.repo.bk.20180124
16c16
< baseurl=file:///mnt/iso/

baseurl=file:///media/CentOS/
20c20
enabled=1

enabled=0

[[email protected] yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, security
Cleaning repos: c6-media
Cleaning up Everything

[[email protected] yum.repos.d]# yum makecache
Loaded plugins: fastestmirror, security
Determining fastest mirrors

  • c6-media:
    file:///media/cdrecorder/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/cdrecorder/repodata/repomd.xml
    Trying other mirror.
    file:///media/cdrom/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/cdrom/repodata/repomd.xml
    Trying other mirror.
    c6-media | 4.0 kB 00:00 ...
    c6-media/group_gz | 220 kB 00:00 ...
    c6-media/filelists_db | 5.8 MB 00:00 ...
    c6-media/primary_db | 4.4 MB 00:00 ...
    c6-media/other_db | 2.7 MB 00:00 ...
    Metadata Cache Created

[[email protected] yum.repos.d]# rpm -qa | grep telnet

[[email protected] yum.repos.d]# rpm -qa | grep nmap

[[email protected] yum.repos.d]# yum install telnet
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile

  • c6-media:
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package telnet.x86_64 1:0.17-47.el6_3.1 will be installed
    --> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size

=============================================================================

Installing:
telnet x86_64 1:0.17-47.el6_3.1 c6-media 58 k

Transaction Summary

=============================================================================
Install 1 Package(s)

Total download size: 58 k
Installed size: 109 k
Is this ok [y/N]: y
Downloading Packages:
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <[email protected]>
Package: centos-release-6-5.el6.centos.11.1.x86_64 (@anaconda-CentOS-201311272149.x86_64/6.5)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 1:telnet-0.17-47.el6_3.1.x86_64 1/1
Verifying : 1:telnet-0.17-47.el6_3.1.x86_64 1/1

Installed:
telnet.x86_64 1:0.17-47.el6_3.1

Complete!
[[email protected] yum.repos.d]# yum install nmap -y
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile

  • c6-media:
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package nmap.x86_64 2:5.51-3.el6 will be installed
    --> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size

=============================================================================
Installing:
nmap x86_64 2:5.51-3.el6 c6-media 2.7 M

Transaction Summary

=============================================================================
Install 1 Package(s)

Total download size: 2.7 M
Installed size: 9.7 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 2:nmap-5.51-3.el6.x86_64 1/1
Verifying : 2:nmap-5.51-3.el6.x86_64 1/1

Installed:
nmap.x86_64 2:5.51-3.el6

Complete!
[[email protected] yum.repos.d]# rpm -qa | grep telnet
telnet-0.17-47.el6_3.1.x86_64
[[email protected] yum.repos.d]# rpm -qa | grep nmap
nmap-5.51-3.el6.x86_64

原文地址:http://blog.51cto.com/guanhaizhan/2064501

时间: 2024-08-26 17:42:47

CentOS 6.5配置本地DVD yum 源的相关文章

CentOS 6.* 配置本地网络 yum源

CentOS 6.* 配置本地网络yum源 一台服务时只需要配一个本地的yum源即可:当需要配置多台服务器时,只需要配置1到2台vsftpd的yum源,其它服务器通过ftp连接yum源: 1 基于本地文件的yum源 1.1 下载镜像源 wget -b https://mirrors.aliyun.com/centos/6.10/isos/x86_64/CentOS-6.10-x86_64-bin-DVD1.iso tail -100f wget-log 1.2 挂载iso镜像文件 ll /mnt

centos6配置本地光盘yum源、rhel7修改网卡名称为eth0

VMware安装好centos/rhel后要配置的几点(配置本地光盘yum源.修改网卡名称为eth0等) [[email protected] ~]# setenforce 0 [[email protected] ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config [[email protected] ~]# tar zcvf /root/redhat.repo.tgz /etc/yum.repos.d/

Linux配置本地网络YUM源

配置环境: 系统版本: [[email protected] ~]# cat /etc/issue Red Hat Enterprise Linux Server release 5.8 (Tikanga) Kernel \r on an \m 系统32位: [[email protected] ~]# getconf LONG_BIT 32 YUM源服务器,IP:192.168.2.1 YUM客户端,IP:192.168.2.2 一.配置本地YUM源服务器: 挂在光盘: [[email pro

为 Virtual Box 中的 CentOS 6.6 配置本地DVD光盘做yum软件源

因为virtual box 中的centos配置host-only共享win7上网,配置失败,所以只能使用Centos的 DVD 光盘来配置yum软件源.不然就没得完了. 1. 首先要在virtual box 中的插入DVD的iso光盘,相信这一步,大家都会,不然如何在virtual box 安装centos呢? 2. 挂载 iso 光盘第一步之后,我们发现执行 df 命令,尽然没有看到我们上面挂载的 iso 光盘,这是怎么回事呢? [root[email protected] ~]# df F

oracle linux配置本地光盘yum源

mkdir -p /mnt/cdrom/ mount /dev/sr0 /mnt/cdrom [[email protected] yum.repos.d]# cat local.repo [Server] name=Server baseurl=file:///mnt/cdrom enabled=1 gpgcheck=0 验证yum [[email protected] yum.repos.d]# yum repolist Loaded plugins: langpacks, ulninfo

本地光盘yum源的搭建

有时候由于网络等其他原因的限制,不能随时使用yum到网上去获取rpm包,这样我们可以配置本地光盘yum源. 下面简要介绍一下本地光盘yum源的搭建 1.挂载本地iso镜像文件mount /dev/sr0 /media/cdrom 2.修改yum源配置文件vim /etc/yum.repos.d/rhel-source.repo 修改内容如下[rhel-source]name=Red Hat Enterprise Linuxbaseurl=file:///media/cdrom      前两个/

linux:网络yum源和制作本地光盘yum源

linux:存放yum源的位置:/etc/yum.repos.d/,该目录下全是一些yum源 一.网络yum源: 如图:下面全部都是yum源,后缀是".repo"都是合法的yum源,默认的是启动的CentOS-Base.repo这个yum源(网络yum源) [[email protected] yum.repos.d]# ls -l total 28 -rw-r--r--. 1 root root 1664 Dec 9 2015 CentOS-Base.repo --- 网络yum源

CentOS 5/6.X 使用 EPEL YUM源

参考:http://www.linuxidc.com/Linux/2013-08/88523.htm 大纲 一.什么是EPEL? 二.与163 YUM源比较 三.CentOS 5.X 安装使用EPEL YUM源 四.CentOS 6.X 安装使用EPEL YUM源 五.使用心得 六.yumdownloader 工具 七.卸载EPEL源 注:操作系统 CentOS 6.X ,CentOS 5.X 推荐阅读: 配置EPEL YUM源  http://www.linuxidc.com/Linux/20

Centos 6.4 搭建本地光盘YUM

我们一般安装linux操作系统的时候都最小化安装,后面我们要安装东西的时候就需要用到了yum来安装一些关联的库.你有没有集群,不想也没必要去搞一个yum源服务器. 原创博文来自:www.51niux.com  博主:忙碌的柴少 这时候我们考虑第一种情况,我们的服务器现在不能上网,要yum安装的东西基本都是系统自带的,这时候呢我们考虑一下yum本地光盘安装. 我的操作系统是Centos 6.4,以此为例. 1.挂载光盘 [[email protected] ~]# mkdir /tmp/cdrom