Ошибка не удалось загрузить метаданные для репозитория appstream

При попытке обновить или установить пакеты из репозиториев CentOS 8 выдается следующая ошибка: «Ошибка: Не удалось загрузить метаданные для репозитория ?appstream?: Cannot prepare internal mirrorlist: No URLs in mirrorlist«.

На самом деле об этом предупреждали заранее разработчики CentOS, конкретнее от отказа разработки версий ОС и переход на Stream версию, подробнее об этом можно прочитать тут.

Чтоб решить проблему с скачиванием нужных пакетов из официальных репозиториев, нужно перенаправить свои репозитории /etc/yum.repos.d/ на http://vault.centos.org вместо http://mirror.centos.org. Делается это следующим образом:

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*

После чего репозитории будут доступны, но вы не будете получать обновления безопасности, т.к. CentOS 8 официально умерла 31.12.21. Но вы можете перейти на SentOS Stream, выполнив следующие команды:

dnf --disablerepo '*' --enablerepo extras swap centos-linux-repos centos-stream-repos
dnf distro-sync

После чего возможно потребуется перезагрузка. Более подробную информацию о переходе на centos strem можно получить тут.

Перейти к содержанию

На чтение 1 мин Просмотров 4.1к. Опубликовано Обновлено

При попытке стандартным методом обновить операционную систему Centos 8 получаем следующую фигню:

[root@mail ~]# yum update
CentOS Linux 8 - AppStream                      116  B/s |  38  B     00:00
Ошибка: Не удалось загрузить метаданные для репозитория «appstream»: Cannot prep                            are internal mirrorlist: No URLs in mirrorlist

Не удалось загрузить метаданные для репозитория «appstream»: Cannot prep are internal mirrorlist: No URLs in mirrorlist

Ну что, поздравляю. Centos 8 официально умер 31.12.2021 года.

Чтоб решить проблему с скачиванием нужных пакетов из официальных репозиториев, нужно перенаправить свои репозитории /etc/yum.repos.d/ на http://vault.centos.org вместо http://mirror.centos.org. Делается это следующим образом:

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*

Не удалось загрузить метаданные для репозитория «appstream»: Cannot prep are internal mirrorlist: No URLs in mirrorlist

Проверяем:

yum update

Не удалось загрузить метаданные для репозитория «appstream»: Cannot prep are internal mirrorlist: No URLs in mirrorlist

Заработало.

Но!!! Обновление безопасности вы получать не будете. Но вы можете перейти на SentOS Stream, выполнив команды:

dnf --disablerepo '*' --enablerepo extras swap centos-linux-repos centos-stream-repos
dnf distro-sync

После чего выполните перезагрузку

( 8 оценок, среднее 4.5 из 5 )

Introduction

If you are a Linux user, you might have come across an error message that says, «Failed to Download Metadata for Repo ‘AppStream'». This error occurs when the metadata for the AppStream repository fails to download properly.

The AppStream repository contains additional packages that work with the main repository to provide a better user experience. When this error occurs, users may not be able to install new packages or update existing ones.

Explanation of the Error Message

Metadata is information about packages and their dependencies that can be used by package managers such as yum and dnf. These package managers use metadata to determine which packages are available for installation, upgrade, or removal from the repositories. The error message «Failed to Download Metadata for Repo ‘AppStream'» means that either the metadata could not be fetched from its source or it is corrupted.

When yum or dnf tries to fetch metadata from a repository and fails, it displays this error message. It indicates that either the server hosting the repository is down, there is no network connectivity on your system, or there is an issue with your firewall configuration.

Importance of Fixing the Error

Fixing this error is important because without access to metadata files your system will not be able to update existing packages or install new ones. As a result of this failure in fetching metadata when performing updates and installations using these package managers will fail. These issues can increase security vulnerabilities in systems as updates cannot be installed quickly or at all.

Brief Overview of Steps Needed To Fix Error

There are several methods available for fixing this issue — some quick fixes while others require more time and effort based on what caused it in first place. Firstly checking network connectivity and firewall settings needs checking before any other action being taken on your part as they could very likely cause errors in downloading metadata. Cleaning yum cache may also help to remove any corruption that occurred on the software side.

Understanding the Error Message

Definition of Metadata and its Role in Software Repositories

When it comes to software repositories, metadata is an important component. It is essentially data that describes other data.

In the context of software repositories, metadata provides information on packages such as their version numbers, descriptions, dependencies and their respective repositories. This information enables package managers like yum to retrieve and install packages more efficiently.

Causes of the Error Message «Failed to Download Metadata for Repo ‘AppStream'»

The error message «Failed to Download Metadata for Repo ‘AppStream'» can occur due to several reasons. The primary reason is often related to network connectivity issues or problems with the repository configuration files.

It may also be caused by issues with Yum cache or GPG key signatures. Other factors that could lead to this error message include issues with firewalls blocking access to the repository server or insufficient disk space preventing Yum from downloading metadata.

Common Scenarios in Which this Error Message Occurs

The error message «Failed to Download Metadata for Repo ‘AppStream'» can occur in a variety of scenarios. For instance, it may occur when running a package installation command using Yum on a new system that has not been updated yet. Another scenario could be when updating packages using Yum after adding new repositories or modifying existing ones.

Step-by-Step Guide to Fixing the Error

Checking Network Connectivity and Firewall Settings

The first step in resolving the «Failed to Download Metadata for Repo ‘AppStream'» error is to check your network connectivity and firewall settings. Oftentimes, network problems or firewalls can prevent the repository from downloading metadata properly. To test your network connectivity using the ping command, open a terminal and type in «ping google.com».

If you receive a response with no errors, then your computer is successfully connected to the internet. If you don’t receive a response, it’s likely that there’s an issue with your internet connection.

Next, check your firewall settings using the firewall-cmd command. Open a terminal and type in «firewall-cmd —state».

firewall-cmd --state

This will tell you if firewalld is running or not. If it is running, type in «firewall-cmd —list-all» to see which ports are open and which services are allowed through those ports.

Cleaning Yum Cache

The next step in fixing this error involves cleaning Yum cache using the yum clean all command. This clears out any cached data that might be causing conflicts with metadata downloads. To perform this operation, simply type «sudo yum clean all» into the terminal window and hit enter.

This will remove all cached packages for each configured repo from the system cache directory located at «/var/cache/yum/». Clearing out this cache should resolve any issues related to outdated package metadata.

Disabling AppStream Repository Temporarily

If cleaning Yum cache doesn’t solve the problem, then try disabling AppStream repository temporarily until other steps can be completed. To do this, we need to edit repo file for AppStream repository configuration located inside «/etc/yum.repos.d/» directory. Open Terminal window and type in «sudo nano /etc/yum.repos.d/appstream.repo» and hit enter.

Once the editor opens, find the line that starts with «enabled» and change it to «enabled=0». This will temporarily disable AppStream repository.

Enabling AppStream Repository Again

After completing other steps, you can enable AppStream repository again by following the same instructions mentioned above to access AppStream repository configuration file. Find the line that starts with «enabled» and change it back to «enabled=1». This will re-enable AppStream repository.

With these simple steps, you should be able to fix the error message, «Failed to Download Metadata for Repo ‘AppStream'».

Additional Tips and Tricks

Verifying GPG Key Signature

When downloading packages from a repository, it is important to ensure that the packages have not been tampered with during transit. In order to verify the integrity of downloaded packages, Red Hat uses the GNU Privacy Guard (GPG) key signature. To verify the GPG key signature, first download and import the public key into your system’s keyring using the following command −

# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Then, run the following command to verify that the package has been signed by Red Hat −

# rpm -K package-name.rpm

If the package has been tampered with during transit, or if it was not signed by Red Hat in the first place, an error message will be displayed.

Checking Available Disk Space

One common reason for issues with repositories is running out of disk space. It is important to regularly check available disk space on your system and allocate more if necessary. To check available disk space on Linux systems, use the following command −

# df -h

This will display a list of all mounted file systems along with their total size, used space, free space, and mount location.

Conclusion

The error message «Failed to Download Metadata for Repo ‘AppStream'» can be a frustrating problem that prevents users from installing or updating packages on their Linux system. However, by carefully following the steps outlined in this article, the error can be easily resolved.

It is important to understand that this error can have multiple causes and troubleshooting steps may vary depending on your specific situation. Therefore, it is essential to read through each step carefully and approach it with patience and attention to detail.

By taking the time to understand the causes of this error and following our step-by-step guide to resolve it, users will be able to install and update packages safely and efficiently on their Linux systems. We hope that our article has been helpful in guiding you through this process.

  • Related Articles
  • How to Fix \»W: Some index files failed to download.\» Error In Ubuntu?
  • How to Fix \»NTFS Partition Failed to Mount\» Error in Linux?
  • How to Fix Cannot find a valid baseurl for repo in CentOS?
  • Fix: ERROR 1396 (HY000): Operation CREATE USER failed in MySQL?
  • How to Fix the SSH Connection Refused Error?
  • How to Fix Failed to set locale, defaulting to C.UTF-8 in CentOS 8?
  • Error Failed to load resource in SAPUI5 application
  • MongoDB – Fix “Failed to convert from type String to type Date”?
  • How to Fix Shared connection to x.x.xx closed Ansible Error?
  • How to fix \»helm has no deployed releases\» Error?
  • How to Fix MySQL ERROR 1819 (HY000) in Linux?
  • How to Fix SSH Too Many Authentication Failures Error?
  • How to Fix \»SSH Failed Permission Denied (publickey, gssapi-keyex, gssapi-with-mic)\»?
  • How to fix problems related to the JavaScript Void 0 Error?
  • How to Fix unable to locate package Error in Debian 9?
Kickstart Your Career

Get certified by completing the course

Get Started

Skip to content

Ошибка Failed to download metadata for repo ‘AppStream’ характерна для установок CentOS 8, выполненных в 2022 году. Дело в том, что эта версия ОС перестала поддерживаться 31 декабря 2021 года. Это означает, что CentOS 8 больше не будет получать ресурсы для разработки (пакеты) от официального проекта CentOS. Теперь, если вам нужно обновить CentOS, вам необходимо изменить зеркала на vault.centos.org, где они будут постоянно заархивированы. В качестве альтернативы вы можете перейти на CentOS Stream.

Чтобы получать пакеты и обновления, вам необходимо выполнить следующие команды:

cd /etc/yum.repos.d/
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-*
yum update -y

Они во всех файлах со списков репозиториев, начинающих на CentOS- , заменяют mirror.centos.org на vault.centos.org.

Updated on February 10, 2022

I had installed a minimalist CentOS 8 on one of my servers. Installation went successful, however, when I tried to update the system using yum update I see this error message: Failed to download metadata for repo. Below is the complete error.

[root@autocontroller ~]# yum update
CentOS-8 - AppStream 70 B/s | 38 B 00:00
Error: Failed to download metadata for repo 'AppStream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

Output from the /var/log/dnf.log for more DEBUG information:

2022-02-02T11:39:36Z DEBUG error: 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] (http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=stock).
2022-02-02T11:39:36Z WARNING 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]
2022-02-02T11:39:36Z DDEBUG Cleaning up.
2022-02-02T11:39:36Z SUBDEBUG
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/dnf/repo.py", line 573, in load
ret = self._repo.load()
File "/usr/lib64/python3.6/site-packages/libdnf/repo.py", line 394, in load
return _repo.Repo_load(self)
RuntimeError: Failed to download metadata for repo 'AppStream': 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]

But, then verified with the internet connection and DNS and it works just fine as below:

[root@autocontroller ~]# ping google.com
PING google.com (172.217.166.206) 56(84) bytes of data.
64 bytes from del03s13-in-f14.1e100.net (172.217.166.206): icmp_seq=1 ttl=115 ti me=43.5 ms
--- google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 43.508/43.508/43.508/0.000 ms

So how did I fix the issue? Here it is.

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. Alternatively, you may want to upgrade to CentOS Stream.

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

[root@autocontroller ~]# cd /etc/yum.repos.d/

Step 2: Run the below commands

[root@autocontroller ~]# sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
[root@autocontroller ~]# sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

Step 3: Now run the yum update

[root@autocontroller ~]# yum update -y

That’s it!

Was this article helpful?

Author Profile

Ramya Santhosh

is a Web Designer and content creator. A freelance writer on latest trends in technology, gadget reviews, How to’s and many more.

Related Articles

Понравилась статья? Поделить с друзьями:
  • Ошибка не удалось загрузить контроллер index
  • Ошибка не удалось загрузить изображение вконтакте
  • Ошибка не удалось загрузить виндовс
  • Ошибка не удалось загрузить pdf документ что делать
  • Ошибка не удалось загрузить windows