yum update centos 8 Errors
yum update centos 8 Errors during downloading metadata for repository 'appstream': - Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=stock [Could not resolve host: mirrorlist.centos.org] Błąd: Pobranie metadanych repozytorium „appstream” się nie powiodło: Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=stock [Could not resolve host: mirrorlist.centos.org]
The error indicates that the system cannot resolve the hostname mirrorlist.centos.org, likely due to DNS issues or the fact that CentOS 8 has reached its End of Life (EOL) on December 31, 2021, and official mirrors are no longer maintained.
Steps to resolve the issue:
- Check DNS Configuration: Ensure your system can resolve domain names. Test by pinging a known address:
If it fails, check your DNS settings in /etc/resolv.conf. Add a public DNS server like Google’s:bashping google.combashecho "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf
- Switch to Vault Mirrors: Since CentOS 8 is EOL, the official mirrors are no longer available. You can switch to the CentOS Vault to access archived repositories. Update your repository configuration:
bashsudo sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*.reposudo sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*.repo
- Clear YUM Cache: Clear the cached metadata to ensure the system fetches new data:
bashsudo yum clean allsudo rm -rf /var/cache/yum
- Update Again: Try running the update command again:
bashsudo yum update
- Consider Migrating to a Supported Alternative: Since CentOS 8 is no longer supported, consider migrating to a supported distribution like CentOS Stream, AlmaLinux, or Rocky Linux to receive ongoing updates and security patches.
Odpowiedź po polsku:
Błąd wskazuje, że system nie może rozpoznać nazwy hosta mirrorlist.centos.org, co może wynikać z problemów z DNS lub faktu, że CentOS 8 osiągnął koniec wsparcia (EOL) 31 grudnia 2021 roku, a oficjalne mirrory nie są już utrzymywane.
Kroki do rozwiązania problemu:
- Sprawdź konfigurację DNS: Upewnij się, że system może rozpoznać nazwy domen. Przetestuj, pingując znany adres:
Jeśli się nie powiedzie, sprawdź ustawienia DNS w pliku /etc/resolv.conf. Dodaj publiczny serwer DNS, np. Google:bashping google.combashecho "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf
- Przełącz na mirrory Vault: Ponieważ CentOS 8 jest EOL, oficjalne mirrory nie są dostępne. Możesz przełączyć się na CentOS Vault, aby uzyskać dostęp do zarchiwizowanych repozytoriów:
bashsudo sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*.reposudo sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*.repo
- Wyczyść pamięć podręczną YUM: Wyczyść zcache'owane metadane, aby system pobrał nowe dane:
bashsudo yum clean allsudo rm -rf /var/cache/yum
- Ponów aktualizację: Spróbuj ponownie uruchomić polecenie aktualizacji:
bashsudo yum update
- Rozważ migrację na wspieraną alternatywę: Ponieważ CentOS 8 nie jest już wspierany, rozważ przejście na wspieraną dystrybucję, taką jak CentOS Stream, AlmaLinux lub Rocky Linux, aby otrzymywać aktualizacje i poprawki bezpieczeństwa.
Jeśli problem persists, podaj więcej szczegółów, np. wynik polecenia cat /etc/resolv.conf lub ping mirrorlist.centos.org.




