Centos8使用yum出现无法访问的错误
星期一, 2020-02-03 | Author: Lee | JAVA-and-J2EE, linux | 12,246 views
1.服务器升级系统到centos8,发现无法使用yum update
错误为:Failed to synchronize cache for repo ‘AppStream’, ignoring this repo.
2.修复之法:
2.1:检测网络是否通畅
2.2:修改 baseurl 的地址 http://mirrors.cloud.aliyuncs.com(在另外一台机器上好用,这台怎么都ping不通)
替换成http://mirrors.aliyun.com
即可,这两个地址可以尝试下哪个好用,把/etc/yum.repos.d/下的.repo文件都替换下,主要是下面三个
/etc/yum.repos.d/CentOS-AppStream.repo
/etc/yum.repos.d/CentOS-Base.repo
/etc/yum.repos.d/CentOS-Extras.repo
替换:
vi /etc/yum.repos.d/CentOS-Base.repo
[BaseOS] name=CentOS-$releasever - Base baseurl=http://mirrors.aliyun.com/$contentdir/$releasever/BaseOS/$basearch/os/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial |
vi /etc/yum.repos.d/CentOS-AppStream.repo
[AppStream] name=CentOS-$releasever - AppStream baseurl=http://mirrors.aliyun.com/$contentdir/$releasever/AppStream/$basearch/os/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial |
3.修改完之后执行 dnf命令或者yum 命令都可以
dnf clean all # 清除所有的缓存文件
dnf makecache # 制作元数据缓存
文章作者: Lee
本文地址: https://www.pomelolee.com/2017.html
除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址
No comments yet.
Leave a comment
Search
相关文章
热门文章
最新文章
文章分类
- ajax (10)
- algorithm-learn (3)
- Android (6)
- as (3)
- computer (85)
- Database (30)
- disucz (4)
- enterprise (1)
- erlang (2)
- flash (5)
- golang (3)
- html5 (18)
- ios (4)
- JAVA-and-J2EE (186)
- linux (143)
- mac (10)
- movie-music (11)
- pagemaker (36)
- php (50)
- spring-boot (2)
- Synology群晖 (2)
- Uncategorized (6)
- unity (1)
- webgame (15)
- wordpress (33)
- work-other (2)
- 低代码 (1)
- 体味生活 (40)
- 前端 (21)
- 大数据 (8)
- 游戏开发 (9)
- 爱上海 (19)
- 读书 (4)
- 软件 (3)