概述
在安装rehat 9.3之后,系统是无法使用yum去安装以及更新源,是因为安装rehat 9.3之后,在未注册激活之前是没有yum源的配置文件,这时就需要手动配置一个yum源的配置文件
1、使用yum update报以下错误[root@localhost yuye]# yum -y update
2、使用rpm -qa | grep yum命令查看是否安装yum软件包,如果有出现内容,直接来到第六步,若输出无结果或者想卸载原yum重新安装,执行第四步:
[root@localhost yuye]# rpm -qa | grep yum
3、使用rpm -qa|grep yum|xargs rpm -e --nodeps命令卸载掉原来的yum包
![]()
使用rpm -qa | grep yum 无输出,表示卸载成功
4、下载适配的yum源:阿里巴巴开源镜像站-阿里云官网开发者社区_云计算社区
5、使用rpm 去安装下好的yum源:
[root@localhost Downloads]# rpm -ivh yum-4.14.0-8.el9.noarch.rpm --force --nodeps
![]()
yum-4.14.0-8.el9.noarch.rpm换成下载的yum文件
6、编辑文件vim /etc/yum.repos.d/aliyun_yum.repo添加配置文件:
[ali_baseos]
name=ali_baseos
baseurl=https://mirrors.aliyun.com/centos-stream/9-stream/BaseOS/x86_64/os/
gpgcheck=0[ali_appstream]
name=ali_appstream
baseurl=https://mirrors.aliyun.com/centos-stream/9-stream/AppStream/x86_64/os/
gpgcheck=0
7、创建软件缓存信息:
[root@localhost yuye]# yum makecache
![]()
出现Metadata cache created表示成功
8、更新软件源:
[root@localhost yuye]# yum -y update