CentOS 8: Failed to download metadata for repo 'appstream'

Issues related to applications and software problems and general support
User avatar
adm-carzaffo
Posts: 5
Joined: 2020/08/30 16:49:30

Re: CentOS 8: Failed to download metadata for repo 'appstream'

Post by adm-carzaffo » 2022/02/05 11:57:49

CentOS Linux 8 had reached the End Of Life (EOL) on December 31st, 2021. It means that CentOS 8 will no longer receive development resources from the official CentOS project. After Dec 31st, 2021, if you need to update your CentOS, you need to change the mirrors to vault.centos.org where they will be archived permanently.

Step 1: Go to the /etc/yum.repos.d/ directory.

Step 2: Run the below commands
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

Step 3: To clean all cached information, use the following command
yum clean all

Step 4: Now run the yum update
yum update -y
Thank you!

adm-carzaffo

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: CentOS 8: Failed to download metadata for repo 'appstream'

Post by TrevorH » 2022/02/05 12:42:48

All that does is get you up to date until the end of 2021 and now you are stuck. You need to do more than change repos to vault, you need to change distros.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: CentOS 8: Failed to download metadata for repo 'appstream'

Post by TrevorH » 2022/02/05 12:44:00

KernelDeimos wrote:
2022/02/05 03:04:00
TrevorH wrote:
2022/02/05 02:58:47
Don't build from source, build from the most recent Fedora SRPM that will build using mock.
I would rather build LFS than understand what that sentence means.
I've built LFS, twice. Let me tell you the difference in complexity and difficulty is several orders of magnitude more to do LFS than to build packages from SRPMs using mock.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

KernelDeimos
Posts: 5
Joined: 2022/02/05 01:37:55

Re: CentOS 8: Failed to download metadata for repo 'appstream'

Post by KernelDeimos » 2022/02/05 18:23:24

TrevorH wrote:
2022/02/05 12:44:00
KernelDeimos wrote:
2022/02/05 03:04:00
TrevorH wrote:
2022/02/05 02:58:47
Don't build from source, build from the most recent Fedora SRPM that will build using mock.
I would rather build LFS than understand what that sentence means.
I've built LFS, twice. Let me tell you the difference in complexity and difficulty is several orders of magnitude more to do LFS than to build packages from SRPMs using mock.
I'm in the middle of an LFS build right now actually :lol: but I was partly saying that as a joke. What I mean to get at is knowing what I should have done in the past doesn't exactly help my current situation, unless you're saying I should do `--allowerase` and re-install the missing packages using the method you suggested.

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: CentOS 8: Failed to download metadata for repo 'appstream'

Post by TrevorH » 2022/02/05 19:55:07

No, I mean that a plain rebuild of Fedora packages from their SRPMs will be a lot quicker (usually) and produce better results than either bodging it by installing foreign packages intended for a different distro or by compiling them all from source without packaging it at all.

You install mock from EPEL, add your user to the mock group then just run mock --rebuild /path/to/your-fedora.src.rpm. If it complains about missing prereqs then you either have to build those prereqs first and add them to your own yum repo or you have to work out how to disable whatever feature it is that requires those prereqs so you can build without them.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

techspecx
Posts: 1
Joined: 2022/02/06 16:50:37

Re: CentOS 8: Failed to download metadata for repo 'appstream'

Post by techspecx » 2022/02/06 16:54:25

TrevorH wrote:
2022/01/31 20:37:35
The correct and easy way to migrate from CentOS Linux 8 to CentOS Stream 8 is to run:

Code: Select all

dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos
dnf distro-sync
[Edited with the v2 version of how to...]
I joined just to say THANK YOU. This solution worked flawlessly for me. Thank you for your knowledge. 8-)

Regards.

juhaX
Posts: 5
Joined: 2020/05/26 20:28:02

Re: CentOS 8: Failed to download metadata for repo 'appstream'

Post by juhaX » 2022/02/15 11:47:36

TrevorH wrote:
2022/01/31 20:37:35
The correct and easy way to migrate from CentOS Linux 8 to CentOS Stream 8 is to run:

Code: Select all

dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos
dnf distro-sync
[Edited with the v2 version of how to...]
I'd hope that this thread and guidance would get higher in the search engine ranking. For example in Google this solution is not unfortunately on the top rank links. Instead there are a couple of years old instructions :(: Therefore many might miss these correct steps leading to "Complete!".

Thanks TrevorH!

wroblewj0
Posts: 1
Joined: 2022/02/17 21:14:34

Re: CentOS 8: Failed to download metadata for repo 'appstream'

Post by wroblewj0 » 2022/02/17 22:24:01

I don't know if this is typical or not, but vault.centos.org was so slow that dnf kept timing out, even when I set `minrate=10` and `timeout=3600`. I tried to install the gpg key using `dnf --disablerepo=* install https://vault.centos.org/../gpgkey`, as was suggested in another comment. I also downloaded the rpm and tried a local install, but it always failed with the same gpg key error.

I found these steps work to resolve the gpg key errors:

Code: Select all

1. dnf install centos-release-stream -y --disablerepo=* --enablerepo='extras'
-- This downloads the Stream repo files.

2. dnf swap centos-{linux,stream}-repos -y --disablerepo=* --enablerepo=extras,Stream-*
-- Enabling Stream-* allows you to download the latest gpg key

3. dnf config-manager --set-enabled powertools 
-- Only necessary if you're using epel repos 

4. dnf distro-sync -y

5. reboot

6. dnf upgrade -y
-- Not all packages are upgradeable during the distro-sync. I had 28 packages on one server, including gcc-c++, gcc-fortran, and mysql-server

7. rm -f /etc/yum.repos.d/*rpmsave
-- Optional. There's no need to keep these files, but if you don't mind your directory being messy, you can leave them.

8. ls *rpmnew | awk -F '.' '{ print $1 }' | while read -r REPO ; do /usr/bin/cp  $REPO.repo.rpmnew $REPO.repo ; done
-- Optional. The *.repo.rpmnew files have $releasever in the Name directive, so this is just to keep the display names consistent across repos and servers (if you build new Stream systems, they'll have $releasever in the display name); the actual repo names are the same in both files. 
I assume you can do steps 6-8 before step 5 without any issues, but I didn't do it that way, so I'm only reporting the steps in the order in which I performed them.

effbiai
Posts: 2
Joined: 2015/03/06 21:02:19

Re: CentOS 8: Failed to download metadata for repo 'appstream'

Post by effbiai » 2022/02/28 11:19:43

The easiest way to get around the gpg-keys package error is just to install a new enough package.
This worked for me:

Code: Select all

curl https://vault.centos.org/8.5.2111/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-3.el8.noarch.rpm -o centos-gpg-keys-8-3.el8.noarch.rpm
rpm -i centos-gpg-keys-8-3.el8.noarch.rpm
dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos
dnf distro-sync

amir385276
Posts: 73
Joined: 2019/08/09 20:54:52

Re: CentOS 8: Failed to download metadata for repo 'appstream'

Post by amir385276 » 2022/02/28 12:08:44

Hi guys
and i have this isuue for centos 8

but the soulreaver1 commands fix for me

and working fine and install almalinux

thanks soulreaver1

Post Reply