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
- 80VPS→香港服务器 E3-1230 16G 1T 10M 2IP 月香港VPS[主机]
- racknerd 劳动节促销,便宜高性价比美国 vps,3 核 3G 内美国VPS[主机]
- CMIVPS→$8.3 月 KVM-2GB 10G SSD 3M 无限 香港VPS[主机]
- GB Host→£2.79 月 1GB 内存 10GB 空间 不限流量 虚拟空间(主机)
- 傲闪云五一促销,全场云服务器买一送一,充值送 888,香港 美国 国内云美国VPS[主机]
- 惊字下面一个石字是什么成语?全球[VPS测评]
- PHP 如何判断是一维数组还是二维数组?全球[VPS测评]
- 阿里云采购季→1C2G1M 低至年付 74 元 2C4G5M 云服务器 全球[VPS测评]
- 不限流量 FirstByte 夏季折扣→俄罗斯 美国 欧洲 VPS 五折美国VPS[主机]
- Ginernet西班牙便宜VPS,KVM架构,10Gbps超大带宽,年付全球[VPS测评]
- 如何为WordPress友情链接设置 nofollow 属性?全球[VPS测评]
- CloudCone → 256M 内存 10G 储存 1T流量 年付$1全球[VPS测评]
- 2020黑五 GreenCloudVPS → 新加坡 日本机型 → 日本VPS[主机]
- 昱格云 1核心 1024 MB内存 10G SSD 1T单向流量 100全球[VPS测评]
- 播放量破千万,点赞量破百万,你绝对想不到这三款多功能产品居然在TK上卖爆全球[VPS测评]
- 云服务器都是有哪些特点?全球[VPS测评]
- 文物、沉船、村落!干旱导致大量遗迹重见天日 2022年干旱还要持续多久?全球[VPS测评]
- 如何更改WHMCS默认后台路径让WHMCS系统更安全全球[VPS测评]
- HostKvm,香港云地VPS,全场八折,三网直连,电信CN2,2核4G香港VPS[主机]
- 咖啡主机怎么样?美国洛杉矶高防vps,cn2直连,香港沙田vps美国VPS[主机]
- 极客主机,优惠8折充值返25%,香港CN2VPS,日本软银VPS,新加坡日本VPS[主机]
- 野草云服务器怎么样?香港CN2+BGP带宽30M月付19元香港VPS[主机]
- vpsplayer:新年活动_vps全部7.5折起_深圳BGP/美西Ce香港VPS[主机]
- 磐逸云:全场8折优惠,1核1G香港套餐月付24元,日本NNT线路套餐,月日本VPS[主机]
- 95IDC :香港vps优惠活动,1核2G月付折后25元;香港物理机低至香港VPS[主机]
- 蓝队云服务器怎么样?蓝队云服务器价格和优势是什么?全球[VPS测评]
- 野草云怎么样?香港、美国圣何塞高防VPS 1核1G3M 月付19元美国VPS[主机]
- 跨境电商拔节生长关键期,宁波政协委员月谈会精准助力!全球[VPS测评]
- 磐逸云:全场8折优惠,1核1G香港套餐月付24元,日本NNT线路套餐,月日本VPS[主机]
- 如何设置指定路径跳转指定域名?全球[VPS测评]
转载请注明原文地址:http://www.motoll.com/read-229214.html