1.加载os的iso文件
要先创建要加载的目标目录
mount
mount CentOS-7-x86_64-Everything-1511.iso /mnt/cdrom/
2.创建本地repo
1)备份
centos7.6里有很多预定义的repo,建议先备份改名,否则容易冲突
repo配置的路径: etc/yum.repos.d
2)创建本地repo
vi myRepo.repo
[c7-media]
name=CentOS-$releasever - Media
baseurl=file:///mnt/cdrom
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
-
清除缓存并新建缓存
# yum clean all # yum makecache # yum -y install httpd
参考
https://www.cnblogs.com/lynsen/p/10631255.html
https://blog.csdn.net/gtj0617/article/details/108192835