Tuesday, October 17, 2023

.:: How to Fix Error: Failed to download metadata for repo CentOS-8 'AppStream': Cannot prepare internal mirrorlist: No URLs in mirrorlist (Install Centos 8) :::.

 
Make sure for instalation like

add repository "Minimal"
file://    /run/install/repo/minimal

 


1. Try Install
[root@teguhth02 ~]# yum install wget -y
CentOS-8 - AppStream                                                                                                               50  B/s |  38  B     00:00
Error: Failed to download metadata for repo 'AppStream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
[root@teguhth02 ~]#

 
2. check sample repo original

[root@teguhth02 yum.repos.d]# cat CentOS-AppStream.repo
# CentOS-AppStream.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[AppStream]
name=CentOS-$releasever - AppStream
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$releasever/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

[root@teguhth02 yum.repos.d]#

3. add or editing yum repo

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-*

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

4. check sample repo after editing

[root@teguhth02 yum.repos.d]# cat CentOS-AppStream.repo
# CentOS-AppStream.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the #mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[AppStream]
name=CentOS-$releasever - AppStream
#mirrorlist=http://#mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra
baseurl=http://vault.centos.org/$contentdir/$releasever/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

[root@teguhth02 yum.repos.d]#

5. Try Install again

[root@teguhth02 ~]# yum install wget -y
CentOS-8 - AppStream                                                                                                              158 kB/s | 8.4 MB     00:54
CentOS-8 - Base                                                                                                                   191 kB/s | 4.6 MB     00:24
CentOS-8 - Extras                                                                                                                 6.5 kB/s |  10 kB     00:01
Last metadata expiration check: 0:00:01 ago on Tue 17 Oct 2023 02:37:59 AM EDT.
Dependencies resolved.
==================================================================================================================================================================
 Package                           Architecture                        Version                                       Repository                              Size
==================================================================================================================================================================
Installing:
 wget                              x86_64                              1.19.5-10.el8                                 AppStream                              734 k

Transaction Summary
==================================================================================================================================================================
Install  1 Package

Total download size: 734 k
Installed size: 2.8 M
Downloading Packages:
wget-1.19.5-10.el8.x86_64.rpm                                                                                                     141 kB/s | 734 kB     00:05
------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                             141 kB/s | 734 kB     00:05
warning: /var/cache/dnf/AppStream-d7987f026ef99c82/packages/wget-1.19.5-10.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
CentOS-8 - AppStream                                                                                                              1.0 MB/s | 1.6 kB     00:00
Importing GPG key 0x8483C65D:
 Userid     : "CentOS (CentOS Official Signing Key) <security@centos.org>"
 Fingerprint: 99DB 70FA E1D7 CE22 7FB6 4882 05B5 55B3 8483 C65D
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                          1/1
  Installing       : wget-1.19.5-10.el8.x86_64                                                                                                                1/1
  Running scriptlet: wget-1.19.5-10.el8.x86_64                                                                                                                1/1
  Verifying        : wget-1.19.5-10.el8.x86_64                                                                                                                1/1

Installed:
  wget-1.19.5-10.el8.x86_64

Complete!
[root@teguhth02 ~]#
[root@teguhth02 ~]#
[root@teguhth02 ~]# cat /etc/redhat-release
CentOS Linux release 8.2.2004 (Core)
[root@teguhth02 ~]#
[root@teguhth02 ~]# rpm -qa | grep -i wget
wget-1.19.5-10.el8.x86_64
[root@teguhth02 ~]#


No comments:

Post a Comment

Popular Posts