yum搭建本地仓库
[root@apenglinux-001 ~]# mount /dev/cdrom /mnt/ [root@apenglinux-001 yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bak [root@apenglinux-001 yum.repos.d]# cp CentOS-Media.repo CentOS-Base.repo [root@apenglinux-001 yum.repos.d]# vim CentOS-Base.repo [c7-media] name=CentOS-$releasever - Media baseurl=file:///mnt/ gpgcheck=0 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 [root@apenglinux-001 yum.repos.d]# yum clean all [root@apenglinux-001 yum.repos.d]# yum list [root@apenglinux-001 yum.repos.d]# yum repolist all
yum更换国内源
#cd /etc/yum.repos.d #mv CentOS-Base.repo CentOS-Base.repo.bak #curl -O http://mirrors.163.com/.help/CentOS7-Base-163.repo #yum clean all #yum list #yum repolist all
yum安装扩展源
[root@apenglinux-001 yum.repos.d]# yum install epel-release -y
yum下载rpm包
[root@apenglinux-001 ~]# yum install zsh --downloadonly
[root@apenglinux-001 ~]# yum install zsh --downloadonly --downloaddir=/usr/local/src/
[root@apenglinux-001 ~]# yum reinstall vim-enhanced --downloadonly --downloaddir=/usr/local/src/