Could not resolve host: mirrorlist.centos.org Centos 7
If you have a problem above in 2024, you got the right place to be here.
Follow these steps.
1. Edit /etc/yum.repos.d/CentOS-Base.repo using Vim
$ vi /etc/yum.repos.d/CentOS-Base.repo
2. Type I (to start editing), then comment all syntax existing with #
3. Paste these syntax on the top of lines
[base]
name=CentOS-$releasever - Base
baseurl=https://vault.centos.org/7.9.2009/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled = 1
[updates]
name=CentOS-$releasever - Updates
baseurl=https://vault.centos.org/7.9.2009/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever - Extras
baseurl=https://vault.centos.org/7.9.2009/extras/$basearch/
#baseurl=http://mirror.centos.org/centos/7/extras/x86_64/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://vault.centos.org/7.9.2009/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
4. Type Esc, then type :x (to save and exit)
5. Edit /etc/resolv.conf using Vim
6. Add this on the top of lines: nameserver 8.8.8.8
7. Save and exit current file from Vim
8. Now, you can execute these commands:
$ yum clean all
$ yum clean metadata
$ yum makecache
$ yum -y update
$ yum -y install epel-release
$ yum -y install which nano net-tools htop
Done.
Source :
https://serverfault.com/questions/904304/could-not-resolve-host-mirrorlist-centos-org-centos-7
Comments
Post a Comment