首页 > 解决方案 > 百胜回购问题

问题描述

我的 CentOS-Base.repo 有以下镜像:

[base]
name=CentOS-$releasever - Base
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1

#released updates
[updates]
name=CentOS Server updates
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
baseurl=http://custom-url/centOS-updates/
enabled=1

当我说yum install yum-utils时,它失败并显示错误

http://custom-url/centOS-updates/Packages/yum-utils-1.1.31-46.el7_5.noarch.rpm: [Errno 14] HTTP Error 500 - Internal Server Error Trying other mirror. Error downloading packages: yum-utils-1.1.31-46.el7_5.noarch: [Errno 256] No more mirrors to try.

我在这里有两个问题:

标签: linuxcentos7yum

解决方案


急救很可能是远程服务器上的损坏internal server error和/或客户端和服务器之间的不匹配。Yumrepodatacache

要擦除缓存,请使用

$ yum --enablerepo=* clean all

或者只是这样,如果默认情况下启用了所有 repos:

$ yum clean all

这完成了所有可用的清理工作yum。以下是他们的工作:

 CLEAN OPTIONS
   The following are the ways which you can invoke yum in clean mode. Note that "all files" in the commands below means "all files in currently  enabled  reposito‐
   ries".  If you want to also clean any (temporarily) disabled repositories you need to use --enablerepo='*' option.

   yum clean expire-cache
          Eliminate  the local data saying when the metadata and mirrorlists were downloaded for each repo. This means yum will revalidate the cache for each repo.
          next time it is used. However if the cache is still valid, nothing significant was deleted.

   yum clean packages
          Eliminate any cached packages from the system.  Note that packages are not automatically deleted after they are downloaded.

   yum clean headers
          Eliminate all of the header files, which old versions of yum used for dependency resolution.

   yum clean metadata
          Eliminate all of the files which yum uses to determine the remote availability of packages. Using this option will force yum to download all the metadata
          the next time it is run.

   yum clean dbcache
          Eliminate the sqlite cache used for faster access to metadata.  Using this option will force yum to download the sqlite metadata the next time it is run,
          or recreate the sqlite metadata if using an older repo.

   yum clean rpmdb
          Eliminate any cached data from the local rpmdb.

   yum clean plugins
          Tell any enabled plugins to eliminate their cached data.

   yum clean all
          Does all of the above.

推荐阅读