centos8.3更换yum 源.
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos8.3更换yum 源.相关的知识,希望对你有一定的参考价值。
参考技术A mkdir /bf备份
cp -v /etc/yum.repos.d/* /bf/ 备份过后
rm -rf /etc/yum.repos.d/*
删除
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos8_base.repo
yum clean all 清理之前的yum缓存
yum makecache 运行新的缓存
[root@10-41-27-175 yum.repos.d]# yum makecache
Qcloud centos OS - x86_64 446 kB/s | 4.6 MB 00:10
Qcloud centos extras - x86_64 2.5 kB/s | 10 kB 00:04
Metadata cache created.
yum list
[root@10-41-27-175 yum.repos.d]# yum list
Last metadata expiration check: 0:00:58 ago on Thu 03 Feb 2022 02:41:29 PM CST.
Installed Packages
NetworkManager.x86_64 1:1.26.0-8.el8 @anaconda
NetworkManager-config-server.noarch 1:1.26.0-8.el8 @anaconda
NetworkManager-libnm.x86_64 1:1.26.0-8.el8 @anaconda
NetworkManager-team.x86_64 1:1.26.0-8.el8 @anaconda
NetworkManager-tui.x86_64 1:1.26.0-8.el8 @anaconda
PackageKit.x86_64 1.1.12-6.el8 @AppStream
PackageKit-glib.x86_64 1.1.12-6.el8 @AppStream
abattis-cantarell-fonts.noarch 0.0.25-4.el8 @AppStream
acl.x86_64 2.2.53-1.el8 @anaconda
adcli.x86_64 0.8.2-7.el8 @anaconda
adobe-mappings-cmap.noarch 20171205-3.el8 @AppStream
adobe-mappings-cmap-deprecated.noarch 20171205-3.el8 @AppStream
adobe-mappings-pdf.noarch 20180407-1.el8 @AppStream
alsa-sof-firmware.noarch 1.5-2.el8 @anaconda
annobin.x86_64
Centos7更换yum源
更改yum默认repo源(推荐使用阿里云yum源)
# 使用之前请确保已经安装wget,如未安装请执行下面一条命令来安装
yum install -y wget
# 1.备份当前yum源(可选)
cd /etc/yum.repos.d/
cp /CentOS-Base.repo /CentOS-Base-repo.bak
# 2.使用wget下载阿里yum源repo文件
wget http://mirrors.aliyun.com/repo/Centos-7.repo
# 3.清理默认缓存包
yum clean all
# 4.把下载下来的阿里云repo文件设置成为默认源
mv Centos-7.repo CentOS-Base.repo
# 5.生成阿里云yum源缓存并更新yum源
yum makecache
yum update
以上是关于centos8.3更换yum 源.的主要内容,如果未能解决你的问题,请参考以下文章