Redhat7 搭建本地yum


# cd /etc/yum.repos.d/

# vi rhel.repo


[rhel]

name=rhel

baseurl=file:///home/yum  (也可写http、ftp网络路径)

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

:wq


# createrepo -d /home/yum  (网络yum不需此步)

# yum update