CENTOS yum 源配置

1.mount CD

[root@lu8db mnt]# cat /etc/fstab |grep -i cd
/dev/cdrom              /mnt/cdrom              iso9660 defaults        0 0

2. 配置

#以iso光盘镜像作为yum源
[root@lu8db yum.repos.d]# cat media.repo      # [c8-mnt-BaseOS] name=cdrom-BaseOS-$releasever - Media baseurl=file:///mnt/cdrom/BaseOS/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

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

#阿里云yum源 [root@lu8db yum.repos.d]# cat CentOS-AppStream.repo [AppStream] name=CentOS-$releasever - AppStream baseurl=http://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

[root@lu8db yum.repos.d]# cat CentOS-Base.repo [BaseOS] name=CentOS-$releasever - Base baseurl=http://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

[root@lu8db yum.repos.d]# cat CentOS-Epel.repo [epel] name=CentOS-$releasever - Epel baseurl=http://mirrors.aliyun.com/epel/8/Everything/$basearch enabled=1 gpgcheck=0

重载#

dnf clean all   # 清除所有的缓存文件
dnf makecache   # 制作元数据缓存
原文地址:https://www.cnblogs.com/tingxin/p/13093464.html