yum 업데이트 실패 : 오류 : 리포지토리에 대한 리포지토리 메타 데이터 (repomd.xml)를 검색 할 수 없습니다…


34

CentOS 6.3을 사용하고 있습니다. yum으로 시스템을 업데이트하려고 할 때 다음 메시지가 나타납니다.

yum update

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.ircam.fr
 * centosplus: miroir.univ-paris13.fr
 * extras: mirrors.ircam.fr
 * update: centos.quelquesmots.fr
http://mirror.centos.org/centos/6/addons/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again

yum clean all

Loaded plugins: fastestmirror
Cleaning repos: CactiEZ addons base centosplus extras pgdg93 update
Cleaning up Everything
Cleaning up list of fastest mirrors

yum check

Loaded plugins: fastestmirror
check all

yum erase apf

Loaded plugins: fastestmirror
Setting up Remove Process
No Match for argument: apf
Determining fastest mirrors
 * base: centos.mirror.fr.planethoster.net
 * centosplus: centos.mirror.fr.planethoster.net
 * extras: mirrors.ircam.fr
 * update: centos.quelquesmots.fr
CactiEZ                                                | 2.9 kB     00:00
CactiEZ/primary_db                                     |  13 kB     00:00
http://mirror.centos.org/centos/6/addons/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again

yum upgrade

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.mirror.fr.planethoster.net
 * centosplus: centos.mirror.fr.planethoster.net
 * extras: mirrors.ircam.fr
 * update: centos.quelquesmots.fr
http://mirror.centos.org/centos/6/addons/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again

내 yum.conf

[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release

1
어제부터 yum 인터넷 연결 및 경로 문제로 버그에 대해 많은 질문을 했으므로 시스템을 다시 설치하는 것을 고려 했습니까? 그것은 꽤 f $$$ ed 것 같다
— Kiwy

인터넷 연결을 먼저 수정해야합니다. 다시 설치하는 것이 옵션 일 수 있습니다. 또는 라이브 CD 시스템을 부팅 해보십시오.
— peterph

"yum.repos.d"폴더를 삭제하고 example.repo 파일을 다시 만들어 문제를 해결했습니다. 여기에서 repo 세부 사항을 추가하십시오 : linuxquestions.org/questions/linux-newbie-8/…
— Yang

답변:


33

ca-bundles.crt가 너무 오래되었습니다. 최신 버전의 CentOS로 업그레이드 할 때까지 해결 방법 중 하나는 epel.repo를 https 사용에서 http로 변경하는 것입니다.

sudo sed -i 's/https/http/g' /etc/yum.repos.d/epel.repo

2
스팟 온 +1 그러나 CentOS의 장기적인 지원으로 인해 최신 인증서 번들을 얻기 위해 CentOS 를 업그레이드 할 필요는 없습니다 . yum update ca-certificates트릭을 수행해야합니다 (epel에 대해 https를 비활성화하거나 rpm을 직접 잡고 rpm을 사용하여 업데이트 한 후).
— Kev

내가 물어 때 @kev 잘 이론에 귀하의 의견,하지만 슬프게도 나를 위해 일해야 yum to update ca-certificates내가 얻을 "업데이트 표시 없음 패키지" . 실제로 내가 할 yum list | grep ca-certificates때이 ca-certificates.noarch 2010.63-3.el6_1.5 를 CentOS 6.4 상자의 최신 버전으로 얻습니다 . CentOS 6.5 상자에 ca-certificates.noarch 2014.1.98-65.1.el6 이 있으므로 CentOS에서 최신 CA 인증을 받으려면 CentOS 6.5로 업데이트하거나 수동으로 rpm을 가져 와서 설치해야합니다 .
— RobertDeRose

@ 케브 롭은 그것을 못 박았다. 많은 엔터프라이즈 비즈니스가 여전히 매우 오래된 배포판에 있습니다. 나는 현재 클라이언트를 위해 CentOS4.5에서 일하고 있으며 일반적으로 수행하지 않아도되는 많은 일을해야합니다.
— SgtPooki

@RobD OP가 http를 사용하고 있고 동일한 문제가 발생했을 때 https가 아닌 http를 사용하고있는 것 같습니다. 그래서 나는 ssl ca root 인증서가 오래되었다고 추론하는 방법이 궁금합니다.
— 드와이트 스펜서

@DwightSpencer 죄송합니다. 귀하의 질문을 이해하지 못했습니다. OP 란 무엇입니까? 내 오래된 CentOS 6.2 상자에서 업데이트 할 수 없었지만 6.6 상자에서 할 수 있었기 때문에 내 SSL SSL 인증서가 문제라고 추론했습니다. https에서 http로 간단히 변경하면 문제가 해결되었습니다. 나는 그것을 다소 좁혔습니다.
— RobertDeRose

16

이것을 시도하십시오 (루트이어야합니다)

yum clean all
yum check
yum erase apf
yum update ca-certificates
yum upgrade

상기 봐 편집
— AZ93

예이! 그것은 :) 일
— facundofarias

1
완벽하게 작동 했으며이 스레드의 다른 답변보다 훨씬 깨끗합니다.
— 드와이트 스펜서

yum update --disableplugin fastestmirror그 단계 중 하나 (아마도 yum clean)가 거울에 접촉하는 데 필요한 정보를 제거 했기 때문에 거기에 패스 를 추가 해야했습니다 . 나는 업그레이드를 제안했을 때 "아니오"라고 말한 다음 평범한 일을 yum update했으며 이번에는 성공했습니다. 첫 번째 패스는 기본 CentOS 사이트에서 새로운 미러 목록을 다운로드하여 두 번째 패스가 성공했다고 생각합니다.
— 워렌 영


3

나를위한 문제는 repos가 https를 사용하고 작동하지 않는다는 것입니다.

cd /etc/yum.repos.d/
grep -RFi "https" *

이것은 https가 사용되는 repo 파일에 표시됩니다. 편집기에서 열어서 http로 만드십시오. 나를 위해 문제를 해결했습니다.


3

이전의 모든 답변이 저에게는 효과가 없었지만 다음 명령을 실행하면 효과가 있습니다.

$ sudo yum remove centos-release-SCL
$ sudo yum update # Update to CentOS 6.8
$ sudo yum install centos-release-scl
$ sudo yum update

이 블로그 게시물 에서 얻은 것 입니다.



2

6.5를 사용하는 경우 이유를 모르겠지만 centOS의 공식 yum 저장소에 6.5 디렉토리가 없습니다. 모든 패키지는 404 상태 코드를 반환합니다

이것을 시도하면 : http://mirror.centos.org/centos/ 6.5 /os/x86_64/Packages/php-pear-1.9.4-4.el6.noarch.rpm 404를 얻을 수 있지만 시도하면 6.6 버전 : http://mirror.centos.org/centos/ 6.6 /os/x86_64/Packages/php-pear-1.9.4-4.el6.noarch.rpm 작동합니다.


1

다른 매개 변수없이 "yum update"또는 "yum upgrade"를 실행하면 yum을 포함한 시스템의 모든 패키지가 업그레이드되므로 Fedora 또는 CentOS 버전을 업그레이드하지 않는 한 yum을 자체적으로 업그레이드 할 필요가 없습니다.


사실 ftp를 설치해야합니다. 그러나 yum install ftp를 사용할 때도 같은 문제가 발생합니다.
— az93

1

Vagrant를 통해 CentOS를 설치 /etc/yum.repos.d/했으며 다음과 같은 디렉토리가 사전에 제공되었습니다 puppet.repo. Lo와 보라, puppet.repo그리고 다른 포함 된 repos는 유효한 자원을 가리 키지 않았다.

그래서 나는 그것들을 제거했고 yum은 지금 작동합니다.


1

필자의 경우, 매우 예외적 인 repo 정보를 포함하는 XML 파일의 위치가 변경됩니다.

  • 인터넷에 연결되어 있습니다 ( ping 8.8.8.8작동)
  • 을 실행할 때 yum upgrade많은 404오류가 발생하면 다운로드 해야하는 패키지 이름을 얻을 수 있지만 다운로드 할 수는 없습니다.

그리고 첫 번째 404 repo URL을 탐색하면 다음과 같습니다.

http://mirror.airenetworks.es/CentOS/7.4.1708/os/x86_64/repodata/repomd.xml

그리고 나는 그것이없는 것을 본다. 부모 폴더로 이동 http://mirror.airenetworks.es/CentOS/7.4.1708/readme하면 다음과 같이됩니다.

이 디렉토리 (및 CentOS 버전)는 더 이상 사용되지 않습니다. 일반 사용자의 경우 경로에 /7.4.1708/이 아닌 / 7 /을 사용해야합니다. CentOS 릴리스 체계에 관한이 FAQ를 참조하십시오.

https://wiki.centos.org/FAQ/General

현재하고있는 일을 알고 7.4.1708 수준을 유지하려면 http://vault.centos.org/ 로 이동하여 패키지를 확인하십시오.

7.4.1708은 더 이상 업데이트 나 보안 수정 사항을 얻지 않습니다.

다시 /etc/yum.repo.d파일을 편집하려면 돌아 가야 합니다.

나는 가지고있다:

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

나는 의심하지 $releasever내가로 변경하여 테스트 할 수 있도록, 더 이상 사용하지 않는 7(탈출 기억 &에 \)

curl http://mirrorlist.centos.org/?release=7\&arch=x86_64\&repo=os\&infra=arch

파일 목록을 얻을 수 있습니다 :

ftp://ftp.cesca.cat/centos/7.5.1804/os/x86_64/
http://ftp.rediris.es/mirror/CentOS/7.5.1804/os/x86_64/
http://ftp.cica.es/CentOS/7.5.1804/os/x86_64/
http://centos.mirror.minorisa.net/7.5.1804/os/x86_64/
http://repo.nixval.com/CentOS/7.5.1804/os/x86_64/
http://centos.uvigo.es/7.5.1804/os/x86_64/
http://ftp.uma.es/mirror/CentOS/7.5.1804/os/x86_64/
http://ftp.cixug.es/CentOS/7.5.1804/os/x86_64/
http://mirror.airenetworks.es/CentOS/7.5.1804/os/x86_64/
http://mirror.gadix.com/centos/7.5.1804/os/x86_64/

따라서 다음과 같이 변수를 설정할 수 있습니다.

  1. 를 엽니 다 /etc/yum.repo.d/CentOS-Base.repo
  2. 에서 [base]섹션 정의합니다 releasever=7.
  3. yum upgrade또는을 다시 실행하십시오 yum install xxx.
당사 사이트를 사용함과 동시에 당사의 쿠키 정책과 개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.