CentOS7修改换yum源(最简安装)解决默认yum源无法使用
![]() | ![]() | ![]() | ![]() |
| 【性价之王】 | 【线路之王】 | 【价格之王】 | 【配置之王】 |
| 【免费之王】 | 【香港首推】 | 【梯子之王】 | 【独服之王】 |
问题:1.CentOS解决yum命令出现doesn’t have enough cached的问题
| One of the configured repositories failed (未知), | |
| and yum doesn't have enough cached data to continue. At this point the only | |
| safe thing yum can do is fail. There are a few ways to work "fix" this: | |
| 1. Contact the upstream for the repository and get them to fix the problem. | |
| 2. Reconfigure the baseurl/etc. for the repository, to point to a working | |
| upstream. This is most often useful if you are using a newer | |
| distribution release than is supported by the repository (and the | |
| packages for the previous distribution release still work). |
2.单纯修改源,使得国内更新为国内源,下载软件更快。
3.报错:yum 命令报错 “ There are no enabled repos ” —— yum repolist 为 0
首先修改DNS:vi /etc/resolv.conf
nameserver: 8.8.8.8(或者国内机器可修改为114.114.114.114)
进入yum源配置目录: cd /etc/yum.repos.d(yum repolist命令查看可用源数量)
备份原有源:mv /etc/yum.repos.d /etc/yum.repos.d.bak
如果没有先安装wget就: yum install wget -y
修改yum源,就是修改CentOS-Base.repo的内容,所以我们要先备份一下原来的:
mv CentOS-Base.repo CentOS-Base.repo.backup
wget下载国内的yum源(即CentOS-Base.repo文件),目前国内主要有三个yum源:(三选一即可)
阿里云: wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
网易163: wget -O CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
中科大(推荐):
wget -O CentOS-Base.repo https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=3
CentOS 8:
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
更新数据:清除缓存: yum clean all
更新缓存:yum makecache
PS:没有源安装wget 显示仓库数量为0,.repo文件出现问题,更换默认yum源即可,由于此时,无法通过yum源安装包括wget在内的任何工具(包括lrzsz等无法安装),新的.repo文件无法下载。可以使用xshell的sftp上传下载好的源到vps中。
[linux]历史优惠活动内容
猜你可能想看的VPS
- HKServerSolution→359 元 季-2GB 15G SSD全球[VPS测评]
- Dataplugs 多线通香港服务器五折起,企业级 E3 E5 服务器,香港VPS[主机]
- Kuai Che Dao→$35.6 半年 512MB 内存 10GB 虚拟空间(主机)
- 腾讯云秒杀→1C2G1M 年付 88 元三年 268 元 2C4G3M 全球[VPS测评]
- 事字的一半和两个功字是什么成语?全球[VPS测评]
- IE 浏览器 iframe 自适应高度的两种方法(jquery 版本)全球[VPS测评]
- TMThosting→$66.5 月-Dual L5520 24GB 1全球[VPS测评]
- ajax post 返回网页源码的原因全球[VPS测评]
- AlphaVPS→€9.95 月 OpenVZ-1GB 10GB 600全球[VPS测评]
- 一个望一个张是什么成语?全球[VPS测评]
- 搬瓦工最新优惠码整理(长期更新) 高速优质便宜的美国 cn2vps 推荐美国VPS[主机]
- SaltyfishTech→$40 年 1GB 内存 30GB SSD 虚拟空间(主机)
- HappyBee波兰便宜openvz vps,1G内存/15g ssd/全球[VPS测评]
- PacificRack下架旧套餐,升级新套餐首付5折,首月2.5美元起,全球[VPS测评]
- HostMaze罗马尼亚抗诉vps,1Gbps带宽,无限流量,年付24美全球[VPS测评]
- 1stserver → 13$ 月 1C1G20G硬盘 印尼 新加坡 日日本VPS[主机]
- 阿里云轻量级服务器低至144年付全球[VPS测评]
- VPS成立BurjeelHoldings全球[VPS测评]
- 数据中心助力光纤光缆行业发展全球[VPS测评]
- 自适应bootstrap左侧导航可关闭全球[VPS测评]
- CubeCloud,香港cn2,美国cn2 gia线路vps主机,2核1美国VPS[主机]
- 互盟云怎么样?1核2G云服务器仅468元/年,香港云主机58元/月香港VPS[主机]
- 六一云:国内BGP高防vps套餐,1核/1G/2Mbps/香港CN2,月香港VPS[主机]
- HostKvm,香港云地VPS,全场八折,三网直连,电信CN2,2核4G香港VPS[主机]
- 初忆云: 滁州电信、湖北电信云服务器价格低至10元起,续费同价全球[VPS测评]
- UCloud海外云服务器促销:全场1折起,香港cn2vps最低年付150香港VPS[主机]
- 2022年亚马逊Prime会员日将于7月12日和13日举行,覆盖24个站全球[VPS测评]
- 硅云服务器拼团活动:香港云服务器1核1G,拼团价仅98元/年香港VPS[主机]
- 衡天云:香港/美国物理服务器499元/月_香港/美国云服务器_超低特价美国VPS[主机]
- 修罗云:1核/512MB/6GB空间/1TB流量/NAT/KVM/香港H虚拟空间(主机)
转载请注明原文地址:http://140.238.13.167:12355/read-229214.html











