The solution to "Error: Failed to download metadata for repo 'AppStream': xxxx" on CentOS8


If the article is an original article, please indicate the source of the original article for reprinting
. Qt practical technology, Raspberry Pi, 3D, OpenCV, OpenGL, ffmpeg, OSG, microcontroller, combination of software and hardware, etc.) are continuously updated...

Qt development column: various problem solving


question

  Develop Qt on centOS8.2. After the installation is complete, you need to download and install some software. It is always found that ** "Error: Failed to download metadata for repo 'AppStream': Cannot prepare internal mirrorlist: No URLs in mirrorlist**", try Many online methods can't solve it, and finally solved it after twists and turns, record it.


reason

  Because centOS8 stopped the source service on December 31, 2021, and the current time is February 10, 2022, so the reason why the previous methods did not work (essentially a source problem).


Solution

  Just follow the command line as follows:

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

  Then wait, as follows:
  insert image description here
  insert image description here
  Then there is still a problem with yum makecache at this time, and you need to continue:

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum clean all
yum makecache

  insert image description here
  There is still a problem at this time, you need to cut into the directory and delete all linux files, as shown in the following figure: The
  insert image description here
  final solution.


Test and install minicom serial port tool

yum install minicom

  insert image description here
  insert image description here
  insert image description here


If the article is an original article, please indicate the source of
the original article when reprinting. The blog address of this article: https://hpzwl.blog.csdn.net/article/details/122862858

Guess you like

Origin blog.csdn.net/qq21497936/article/details/122862858