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

Issues related to applications and software problems and general support
ikarisroy
Posts: 1
Joined: 2022/02/03 10:51:48
Contact:

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

Post by ikarisroy » 2022/02/04 07:54:18

I'm on a fresh Centos 8 install and have tried to use yum for the first time (on this machine). I get the following for any attempt to install or update anything:

yum update
CentOS-8 - AppStream 0.0 B/s | 0 B 00:00
Failed to download metadata for repo 'AppStream'
Error: Failed to download metadata for repo 'AppStream'
Port 80 is open although nmap reports it as closed presumably because I haven't yet installed apache. To be double sure I have added port 80 to firewalld which is confirmed:

firewall-cmd --list-ports
25/tcp 80/tcp vidmate instagram video download
Last edited by ikarisroy on 2022/02/07 09:31:18, edited 1 time in total.

soulreaver1
Posts: 8
Joined: 2012/03/31 14:54:39

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

Post by soulreaver1 » 2022/02/04 08:47:46

This is what finally have worked for me:

Upgrade to CentOS 8 Stream:

Code: Select all

find /etc/yum.repos.d -type f -exec sed -i 's/mirrorlist=http:\/\/mirrorlist.centos.org/\#mirrorlist=http:\/\/mirrorlist.centos.org/g' {} \;
find /etc/yum.repos.d -type f -exec sed -i 's/\#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g' {} \;
dnf update -y
reboot
dnf swap centos-linux-repos centos-stream-repos -y
dnf update -y
reboot
Next Upgrade to Rocky Linux:

Code: Select all

dnf install git -y
cd /tmp
git clone https://github.com/rocky-linux/rocky-tools.git
chmod +x /tmp/rocky-tools/migrate2rocky/migrate2rocky.sh
bash /tmp/rocky-tools/migrate2rocky/migrate2rocky.sh -r
reboot

adonaicosta
Posts: 1
Joined: 2022/02/04 15:41:29

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

Post by adonaicosta » 2022/02/04 15:48:40

Hey guys... to solve your problem do this;

check you release:

Code: Select all

cat /etc/redhat-release
 Centos Linux release 8.4.21.05
use this to install new repo and gpg based on redhat-release output

Code: Select all

dnf --disablerepo '*' --allowerasing install http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/centos-stream-repos-8-4.el8.noarch.rpm http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-4.el8.noarch.rpm

dnf distro-sync

dnf update

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 01:50:45

I had no problem running this:

Code: Select all

sudo dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos
but when I tried to run `distro-sync` I got this error

Code: Select all

CentOS Stream 8 - AppStream                                  1.1 MB/s |  19 MB     00:18    
CentOS Stream 8 - BaseOS                                     1.3 MB/s |  18 MB     00:14    
CentOS Stream 8 - Extras                                      49 kB/s |  17 kB     00:00    
Docker CE Stable - x86_64                                     67 kB/s |  19 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64               1.3 kB/s | 3.3 kB     00:02    
Errors during downloading metadata for repository 'epel':
  - Status code: 503 for https://mirrors.fedoraproject.org/metalink?repo=epel-8&arch=x86_64&infra=stock&content=centos (IP: 38.145.60.21)
Error: Failed to download metadata for repo 'epel': Cannot prepare internal mirrorlist: Status code: 503 for https://mirrors.fedoraproject.org/metalink?repo=epel-8&arch=x86_64&infra=stoc[edub[edube@localhost modelsim_ase]$ sudo dnf distro-sync
[sudo] password for edube: 
Extra Packages for Enterprise Linux 8 - x86_64                                                                                                                 1.7 kB/s | 3.3 kB     00:01    
Errors during downloading metadata for repository 'epel':
  - Status code: 503 for https://mirrors.fedoraproject.org/metalink?repo=epel-8&arch=x86_64&infra=stock&content=centos (IP: 38.145.60.21)
Error: Failed to download metadata for repo 'epel': Cannot prepare internal mirrorlist: Status code: 503 for https://mirrors.fedoraproject.org/metalink?repo=epel-8&arch=x86_64&infra=stock&content=centos (IP: 38.145.60.21)
I'm not even sure where to start with this. I'm actually new to CentOS and installed this version months ago because it looked like the newest version (yeah... how could I have been so naive?)

I need advice; am I likely to waste more time by fixing this or installing and getting used to a new OS?

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 02:02:49

- Status code: 503 for https://mirrors.fedoraproject.org/metal ... ent=centos (IP: 38.145.60.21)
That's just the EPEL mirror network being flakey, as usual. Try it with --disablerepo=epel as well.
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 02:29:36

TrevorH wrote:
2022/02/05 02:02:49
- Status code: 503 for https://mirrors.fedoraproject.org/metal ... ent=centos (IP: 38.145.60.21)
That's just the EPEL mirror network being flakey, as usual. Try it with --disablerepo=epel as well.
Thanks! Adding --disablerepo=epel,epel-modular got me further. Now I have 22 "Problem" outputs which seem to be because of arandr (I remember that was hard to install... so that checks out), qt5, redshift, and more.

The output is rather long so I put it on pastebin: https://pastebin.com/pAPBxBGP

If I run with `--allowerasing`, will this remove all of these packages? I'd like to keep redshift but I also want the package manager to be operable again ¯\_(ツ)_/¯ I guess if it comes down to it I'll lose sleep for the latter.

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 02:38:45

You've got a whole load of packages for CentOS 7 installed on an el8 system. There should be none at all.
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 02:49:12

TrevorH wrote:
2022/02/05 02:38:45
You've for a whole load of packages for CentOS 7 installed on an el8 system. There should be none at all.
I wanted to install things and the prerequisite things didn't have CentOS 8 repos/rpms. I did what every human does and weighed the value of my time against compiling dependencies from source. I guess that's coming back at me now in the most hilarious way possible.

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 02:58:47

Don't build from source, build from the most recent Fedora SRPM that will build 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 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.

Post Reply