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
- 活动 嘟牛云→限时免单 全场 77 折优惠 额外双倍内存 66 红包大放全球[VPS测评]
- 新人首单 0 元购 APP 这几个首单都是免费全球[VPS测评]
- 传家宝 PacificRack→三款特价套餐 1 核 400M 内存 1全球[VPS测评]
- Class 'PDO' not found全球[VPS测评]
- 阿里云·云小站采购季促销,国内 香港云服务器 1 核 2G74 元 年起香港VPS[主机]
- tmhhost→双程日本软银 VPS 100M 带宽 50 元 月 KV日本VPS[主机]
- 免费 VPS 日主机→美国三网 CN2 GIA 直连 年付 99 元起 美国VPS[主机]
- 国庆促销 魔方云→美国洛杉矶机房 VPS CN2 GIA 线路 终身 9美国VPS[主机]
- qq 截图不能截当前 qq 页面怎么办?为什么 qq 截图时截不到自己的全球[VPS测评]
- MySql 多个关键字 like 查询结果按照匹配最多排序全球[VPS测评]
- GigsGigsCloud 新加坡 VPS CLOUDLET SG K1全球[VPS测评]
- WordPress插件:有字库插件美化文章标题和内容全球[VPS测评]
- Adobe Acrobat PDF 排版插件 Quite Imposin全球[VPS测评]
- Netcloud-香港VPS 1核1G内存20G硬盘 不限流量 10Mb香港VPS[主机]
- LetBox → 2G 内存 20G Nvme 256G块储存 2T流量全球[VPS测评]
- OLVPS 512 内存 10G SSD 512G流量 1Gbps 俄罗全球[VPS测评]
- 兼容移动和PC的loading加载和toast消息插件全球[VPS测评]
- 数据中心助力光纤光缆行业发展全球[VPS测评]
- 磐逸云:全场8折优惠,1核1G香港套餐月付24元,日本NNT线路套餐,月日本VPS[主机]
- kvmla,新加坡VPS、香港VPS、日本VPS,2核2G云主机仅425日本VPS[主机]
- Vultr新用户100美金 最新活动来啦!新用户充值活动来了,充100美全球[VPS测评]
- 源云主机,香港沙田VPS CN2 1核1G 24/月 NTT 50M 9香港VPS[主机]
- 极光KVM:美国香港vps CN2 GIA专线高速稳定,BGP服务器低至美国VPS[主机]
- btcvps,比特云怎么样?香港VPS,KVM架构带宽4M月付88港币香港VPS[主机]
- 华纳云新春活动:香港CN2云服务器4核4G5M仅3476元/3年;美国云美国VPS[主机]
- 樊云:9折优惠,香港cn2 vps+(强制三网、50G高防);美国cn2美国VPS[主机]
- 快云科技:2核2G3M香港云BGP/新界CN2云服务器,月付33元香港VPS[主机]
- tudcloud:全场7折,香港不限流量VPS,Windows系统,LiWINDOWS
- 56云服务器怎么样?56云免备案香港云服务器价格多少钱?香港VPS[主机]
- 阿里云和腾讯云免备案香港云服务器哪个更优惠?香港VPS[主机]
转载请注明原文地址:http://140.238.13.167:12355/read-229214.html











