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
- imidc→香港服务器 50 刀 月;香港站群服务器(8C) 195 美站群服务器[IP]
- 腾讯云秒杀→上海云服务器年付 99 元起 2C84G4M 三年 948 全球[VPS测评]
- racknerd→$159 月 洛杉矶 纽约 100T 大流量独立服务器独立服务器[U]
- 身字下面有六个甲是什么成语?全球[VPS测评]
- NameCheap - .me 域名注册优惠 仅需$3.88 年全球[VPS测评]
- 一个击字一个声字是什么成语?全球[VPS测评]
- 促销优惠 极光 KVM→4 月新增日本东京 CN2 产品 美国洛杉矶双向日本VPS[主机]
- 四个实线写的大字是什么成语?全球[VPS测评]
- 桔子 VPS→5 折促销 三网直连(回程 CN2)+ddos 防御 美国美国VPS[主机]
- [黑五]搬瓦工→全场 11%优惠 CN2 GIA 线路年付 44.5 美全球[VPS测评]
- 优惠 Onevps→限时 75 折优惠 日本 新加坡机房不限流量 IP 日本VPS[主机]
- CentOS7 不换内核体验类似 BBR 的单边加速全球[VPS测评]
- 全世界最便宜的域名注册商 Porkbun .com 域名首年付4.15刀全球[VPS测评]
- 免费VPS是怎么从你身上捞钱的?全球[VPS测评]
- Cloudcone官网复活节找促销代码,2022惊喜彩蛋,2核2G年付1全球[VPS测评]
- [优惠]CloudCone 1810 闪购全球[VPS测评]
- Bloggar-移动端友好的新闻博客类HTML5模板全球[VPS测评]
- Mysql连接数过高,如何检查?全球[VPS测评]
- hostkvm怎么样?香港云vps 带宽30M 月付6美元香港VPS[主机]
- 酷锐云双十一活动:美国vps、香港vps云主机,2核4G4M,50元/首美国VPS[主机]
- 恒星云:高防服务器优惠活动,成都高防云服务器及辽宁香港服务器特惠活动香港VPS[主机]
- 6种样式社交论坛网站HTML5模板 - Social全球[VPS测评]
- 消费复苏形势良好,我们将多措并举实施扩大内需政策全球[VPS测评]
- 跨境贸易和跨境电商的三大区别简单分析全球[VPS测评]
- JGKVM活动钜惠:美国cn2,香港cmi,大带宽vps,三网直连,10美国VPS[主机]
- 新华全媒+丨第六届全球跨境电商大会:跨境电商加快拓宽中国贸易新通道全球[VPS测评]
- 六六云,2核2G香港云服务器/1000GB流量/50Mbps端口/KVM香港VPS[主机]
- 谷歌浏览器网址如何显示http,www,Chrome谷歌浏览器恢复地址栏全球[VPS测评]
- JGKVM促销,美国cn2vps服务器价格再创新低,平均6.5元/月起美国VPS[主机]
- 安国云:1核/1G/20G硬盘/1Mbp不限流量/香港cdia,月付18香港VPS[主机]
转载请注明原文地址:http://140.238.13.167:12355/read-229214.html











