- yum配置文件路径
/etc/yum.repos.d/centos.repo
- 备份源配置
mv /etc/yum.repos.d/centos.repo /etc/yum.repos.d/centos.repo.backup
- 阿里源配置
- 更新缓存
yum makecache && yum update
yum配置文件路径
/etc/yum.repos.d/centos.repo
备份源配置
mv /etc/yum.repos.d/centos.repo /etc/yum.repos.d/centos.repo.backup
阿里源配置
vi /etc/yum.repos.d/centos.repo
替换为下面的
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
#failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos-stream/$stream/BaseOS/$basearch/os/
http://mirrors.aliyuncs.com/centos-stream/$stream/BaseOS/$basearch/os/
http://mirrors.cloud.aliyuncs.com/centos-stream/$stream/BaseOS/$basearch/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos-stream/RPM-GPG-KEY-CentOS-Official
#additional packages that may be useful
#[extras]
#name=CentOS-$releasever - Extras - mirrors.aliyun.com
#failovermethod=priority
#baseurl=https://mirrors.aliyun.com/centos-stream/$stream/extras/$basearch/os/
# http://mirrors.aliyuncs.com/centos-stream/$stream/extras/$basearch/os/
# http://mirrors.cloud.aliyuncs.com/centos-stream/$stream/extras/$basearch/os/
#gpgcheck=1
#gpgkey=https://mirrors.aliyun.com/centos-stream/RPM-GPG-KEY-CentOS-Official
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
#failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos-stream/$stream/centosplus/$basearch/os/
http://mirrors.aliyuncs.com/centos-stream/$stream/centosplus/$basearch/os/
http://mirrors.cloud.aliyuncs.com/centos-stream/$stream/centosplus/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos-stream/RPM-GPG-KEY-CentOS-Official
[PowerTools]
name=CentOS-$releasever - PowerTools - mirrors.aliyun.com
#failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos-stream/$stream/PowerTools/$basearch/os/
http://mirrors.aliyuncs.com/centos-stream/$stream/PowerTools/$basearch/os/
http://mirrors.cloud.aliyuncs.com/centos-stream/$stream/PowerTools/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos-stream/RPM-GPG-KEY-CentOS-Official
[AppStream]
name=CentOS-$releasever - AppStream - mirrors.aliyun.com
#failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos-stream/$stream/AppStream/$basearch/os/
http://mirrors.aliyuncs.com/centos-stream/$stream/AppStream/$basearch/os/
http://mirrors.cloud.aliyuncs.com/centos-stream/$stream/AppStream/$basearch/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos-stream/RPM-GPG-KEY-CentOS-Official
更新缓存 yum makecache && yum update
yum makecache && yum update
[root@cheng ~]# yum makecache && yum update
CentOS-9 - Base - mirrors.aliyun.com 51 kB/s | 3.9 kB 00:00
CentOS-9 - AppStream - mirrors.aliyun.com 37 kB/s | 4.4 kB 00:00
CentOS Stream 9 - Extras packages 31 kB/s | 8.9 kB 00:00
cuda-rhel9-x86_64 10 kB/s | 3.5 kB 00:00
Docker CE Stable - x86_64 14 kB/s | 3.5 kB 00:00
Extra Packages for Enterprise Linux 9 - x86_64 22 kB/s | 5.0 kB 00:00
Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64 4.1 kB/s | 993 B 00:00
Extra Packages for Enterprise Linux 9 - Next - x86_64 60 kB/s | 17 kB 00:00
元数据缓存已建立。
上次元数据过期检查:0:00:01 前,执行于 2024年12月22日 星期日 15时52分33秒。
依赖关系解决。
无需任何处理。
完毕!