毎日1つの新しい知識のLinux CentOS 7の下でyumソースをローカルディスクに置き換えます

2841 ワード

#               
[root@centos-01 ~]# mkdir /mnt/cdrom && mount /dev/cdrom /mnt/cdrom  
mount: /dev/sr0    ,        
#  yum 
[root@centos-01 ~]# mkdir /etc/yum.repos.d/bak && mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak
#     
[root@centos-01 ~]# vi /etc/yum.repos.d/local.repo
[root@centos-01 ~]# cat /etc/yum.repos.d/local.repo
[LocalRepo]
name=LocalRepository
baseurl=file:///mnt/cdrom
enabled=1
gpgcheck=1
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-CentOS-7
#yum         duheader   cache ,       ,    yum   dhcp      
[root@centos-01 ~]# yum clean all	
     :fastestmirror
       : LocalRepo
Cleaning up list of fastest mirrors
Other repos take up 55 M of disk space (use --verbose for details)
[root@centos-01 ~]# yum list all		#   
#  dhcp  
[root@centos-01 ~]# yum -y install dhcp
     :fastestmirror
Loading mirror speeds from cached hostfile
        
-->       
--->     dhcp.x86_64.12.4.2.5-79.el7.centos      
-->         
#...    [root@centos-01 ~]# rpm -q dhcp
dhcp-4.2.5-79.el7.centos.x86_64
[root@centos-01 ~]# rpm -q dhcp-common
dhcp-common-4.2.5-79.el7.centos.x86_64