yum 异常报错

新装的centos7.9系统,yum无法更新

[root@edr yum.repos.d]# yum -y update
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 To enable Red Hat Subscription Management repositories:
   subscription-manager repos --enable <repo>
 To enable custom repositories:
   yum-config-manager --enable <repo>

网络是能正常访问互联网

[root@edr yum.repos.d]# ping www.baidu.com
PING www.a.shifen.com (14.215.177.38) 56(84) bytes of data.
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=1 ttl=52 time=4.62 ms
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=2 ttl=52 time=4.42 ms
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=3 ttl=52 time=4.44 ms
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=4 ttl=52 time=4.49 ms
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=5 ttl=52 time=4.36 ms
--- www.a.shifen.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 4.368/4.472/4.629/0.098 ms

执行repolist为0

[root@edr yum.repos.d]# yum repolist all
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
源标识                              源名称                                  状态
C7.0.1406-base/x86_64               CentOS-7.0.1406 - Base                  禁用
C7.0.1406-centosplus/x86_64         CentOS-7.0.1406 - CentOSPlus            禁用
C7.0.1406-extras/x86_64             CentOS-7.0.1406 - Extras                禁用
C7.0.1406-fasttrack/x86_64          CentOS-7.0.1406 - Fasttrack             禁用
C7.0.1406-updates/x86_64            CentOS-7.0.1406 - Updates               禁用
C7.1.1503-base/x86_64               CentOS-7.1.1503 - Base                  禁用
C7.1.1503-centosplus/x86_64         CentOS-7.1.1503 - CentOSPlus            禁用
C7.1.1503-extras/x86_64             CentOS-7.1.1503 - Extras                禁用
C7.1.1503-fasttrack/x86_64          CentOS-7.1.1503 - Fasttrack             禁用
C7.1.1503-updates/x86_64            CentOS-7.1.1503 - Updates               禁用
C7.2.1511-base/x86_64               CentOS-7.2.1511 - Base                  禁用
C7.2.1511-centosplus/x86_64         CentOS-7.2.1511 - CentOSPlus            禁用
C7.2.1511-extras/x86_64             CentOS-7.2.1511 - Extras                禁用
C7.2.1511-fasttrack/x86_64          CentOS-7.2.1511 - Fasttrack             禁用
C7.2.1511-updates/x86_64            CentOS-7.2.1511 - Updates               禁用
C7.3.1611-base/x86_64               CentOS-7.3.1611 - Base                  禁用
C7.3.1611-centosplus/x86_64         CentOS-7.3.1611 - CentOSPlus            禁用
C7.3.1611-extras/x86_64             CentOS-7.3.1611 - Extras                禁用
C7.3.1611-fasttrack/x86_64          CentOS-7.3.1611 - Fasttrack             禁用
C7.3.1611-updates/x86_64            CentOS-7.3.1611 - Updates               禁用
C7.4.1708-base/x86_64               CentOS-7.4.1708 - Base                  禁用
C7.4.1708-centosplus/x86_64         CentOS-7.4.1708 - CentOSPlus            禁用
C7.4.1708-extras/x86_64             CentOS-7.4.1708 - Extras                禁用
C7.4.1708-fasttrack/x86_64          CentOS-7.4.1708 - Fasttrack             禁用
C7.4.1708-updates/x86_64            CentOS-7.4.1708 - Updates               禁用
C7.5.1804-base/x86_64               CentOS-7.5.1804 - Base                  禁用
C7.5.1804-centosplus/x86_64         CentOS-7.5.1804 - CentOSPlus            禁用
C7.5.1804-extras/x86_64             CentOS-7.5.1804 - Extras                禁用
C7.5.1804-fasttrack/x86_64          CentOS-7.5.1804 - Fasttrack             禁用
C7.5.1804-updates/x86_64            CentOS-7.5.1804 - Updates               禁用
C7.6.1810-base/x86_64               CentOS-7.6.1810 - Base                  禁用
C7.6.1810-centosplus/x86_64         CentOS-7.6.1810 - CentOSPlus            禁用
C7.6.1810-extras/x86_64             CentOS-7.6.1810 - Extras                禁用
C7.6.1810-fasttrack/x86_64          CentOS-7.6.1810 - Fasttrack             禁用
C7.6.1810-updates/x86_64            CentOS-7.6.1810 - Updates               禁用
C7.7.1908-base/x86_64               CentOS-7.7.1908 - Base                  禁用
C7.7.1908-centosplus/x86_64         CentOS-7.7.1908 - CentOSPlus            禁用
C7.7.1908-extras/x86_64             CentOS-7.7.1908 - Extras                禁用
C7.7.1908-fasttrack/x86_64          CentOS-7.7.1908 - Fasttrack             禁用
C7.7.1908-updates/x86_64            CentOS-7.7.1908 - Updates               禁用
C7.8.2003-base/x86_64               CentOS-7.8.2003 - Base                  禁用
C7.8.2003-centosplus/x86_64         CentOS-7.8.2003 - CentOSPlus            禁用
C7.8.2003-extras/x86_64             CentOS-7.8.2003 - Extras                禁用
C7.8.2003-fasttrack/x86_64          CentOS-7.8.2003 - Fasttrack             禁用
C7.8.2003-updates/x86_64            CentOS-7.8.2003 - Updates               禁用
base-debuginfo/x86_64               CentOS-7 - Debuginfo                    禁用
base-source/7                       CentOS-7 - Base Sources                 禁用
c7-media                            CentOS-7 - Media                        禁用
centos-kernel/7/x86_64              CentOS LTS Kernels for x86_64           禁用
centos-kernel-experimental/7/x86_64 CentOS Experimental Kernels for x86_64  禁用
centosplus-source/7                 CentOS-7 - Plus Sources                 禁用
cr/7/x86_64                         CentOS-7 - cr                           禁用
extras-source/7                     CentOS-7 - Extras Sources               禁用
fasttrack/7/x86_64                  CentOS-7 - fasttrack                    禁用
updates-source/7                    CentOS-7 - Updates Sources              禁用
repolist: 0

下载163repo文件上传,执行clean、makecache,报错HTTP Error 503 - Service Unavailable

[root@edr yum.repos.d]# ls
CentOS7-Base-163.repo  CentOS-Debuginfo.repo  CentOS-Vault.repo
CentOS-Base.repo       CentOS-fasttrack.repo  CentOS-x86_64-kernel.repo
CentOS-Base.repo_bak   CentOS-Media.repo
CentOS-CR.repo         CentOS-Sources.repo


[root@edr yum.repos.d]# yum clean all
已加载插件:fastestmirror, langpacks
正在清理软件源: base extras updates
Cleaning up list of fastest mirrors
[root@edr yum.repos.d]# yum makecache
已加载插件:fastestmirror, langpacks
Determining fastest mirrors
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
正在尝试其它镜像。
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
正在尝试其它镜像。
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
正在尝试其它镜像。
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
正在尝试其它镜像。
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
正在尝试其它镜像。
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
正在尝试其它镜像。
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
正在尝试其它镜像。
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
正在尝试其它镜像。
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
正在尝试其它镜像。
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
正在尝试其它镜像。


 One of the configured repositories failed (CentOS-7 - Base - 163.com),
 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).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=base ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable base
        or
            subscription-manager repos --disable=base

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=base.skip_if_unavailable=true

failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 503 - Service Unavailable
[root@edr yum.repos.d]#
阅读 5k
2 个回答

提示不是已经告诉你了吗,你的软件源已经全部禁用了,需要使用 subscription-manager repos --enable <repo> 启用软件源

新手上路,请多包涵

最后新增的163repo地址503访问不通,这是该地址服务提供方的问题,可以换清华或者阿里的repo看看,但要确保使用的repo与系统版本匹配

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题