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下载rpm包(只下载不安装,仅适用于centos7以上版本)
只下载:# yum install zsh --downloadonly 下载到指定目录:# yum install zsh --downloadonly --downloaddir=/usr/local/src/原文链接:https://www.f2er.com/bash/388676.html