centos8制作本地yum

 

1.将centos8的iso文件上传到服务器

 

2.挂载ios
mount CentOS-8.5.2111-x86_64-dvd1.iso -o loop /mnt

 

3.去掉这两个文件

mv CentOS-Linux-AppStream.repo CentOS-Linux-AppStream.repo_bak
mv CentOS-Linux-BaseOS.repo CentOS-Linux-BaseOS.repo_bak

 

 

4.修改CentOS-Linux-Media.repo
cd /etc/yum.repos.d
vi CentOS-Linux-Media.repo

 

[root@cos8 yum.repos.d]# more CentOS-Linux-Media.repo
# CentOS-Linux-Media.repo
#
# You can use this repo to install items directly off the installation media.
# Verify your mount point matches one of the below file:// paths.

[media-baseos]
name=CentOS Linux $releasever - Media - BaseOS
baseurl=file:///mnt/BaseOS
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

[media-appstream]
name=CentOS Linux $releasever - Media - AppStream
baseurl=file:///mnt/AppStream
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

 

posted @ 2023-04-24 16:03  slnngk  阅读(67)  评论(0编辑  收藏  举报