1、查看系统版本:
# cat /etc/redhat-release
2、尝试下载软件:
# dnf -y install tree
3、备份当前yum源配置文件:
# cp /etc/yum.repos.d/redhat.repo /etc/yum.repos.d/redhat.repo_bak
4、下载阿里云yum源配置文件:
# wget -O /etc/yum.repos.d/aliyun.repo http://mirrors.aliyun.com/repo/Centos-8.repo
5、配置域名解析:
# vim /etc/resolv.conf
nameserver 223.5.5.5
nameserver 223.6.6.6
6、重新下载阿里云yum源配置文件:
# wget -O /etc/yum.repos.d/aliyun.repo http://mirrors.aliyun.com/repo/Centos-8.repo
7、清除yum缓存:
# yum clean all
8、更新yum缓存:
# yum makecache
9、查看可用的yum仓库:
# yum repolist
10、测试安装软件:
# dnf -y install tree
11、提示信息“This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.”处理:
# vim /etc/yum/pluginconf.d/subscription-manager.conf
[main]
enabled=0 ==> 将1改为0
# head -2 /etc/yum/pluginconf.d/subscription-manager.conf
# dnf -y install tree