RHEL8&CentOS8创建网络源

tech2026-04-17  1

1、红帽8相当简单就可以完成: 从https://mirrors.aliyun.com/repo/Centos-8.repo下载阿里云源 将Centos-8.repo文件放到/etc/yum.repo.d/下。确保只有一个yum源 执行命令:yum clean all && yum makecache 完毕

2、红帽7比8稍麻烦: 查找并卸载已安装的yum:

1、 查询安装的yum:rpm –qa |grep yum 卸载已安装的yum源:rpm –qa |grep yum |xargs rpm –e –nodeps

1.wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

2.wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-3.4.3-158.el7.centos.noarch.rpm

3.wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm

4.wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-45.el7.noarch.rpm

5.wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-8.el7.noarch.rpm

安装rpm包:rpm –ivh *.rpm –-force - -nodeps 下载repo文件: wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 修改Centos-7.repo文件将所有$releasever替换为7: vim /etc/yum.repos.d/CentOS-Base.repo :%s/$releasever/7/g 运行以下命令: yum clean all yum makecache
最新回复(0)