You may receive a problem with yum not being able to resolve hosts when you try to install a yum package. I’m using CentOS 7.
yum install wget
1 2 3 4 5 |
Downloading packages: Delta RPMs disabled because /usr/bin/applydeltarpm not installed. wget-1.14-10.el7_0.1.x86_64.rp FAILED http://repo.dimenoc.com/pub/centos/7.1.1503/os/x86_64/Packages/wget-1.14-10.el7_0.1.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: repo.dimenoc.com; Unknown error" Trying other mirror. |
If you already have Internet connection and can ping 8.8.8.8, the likely problem is that you don’t have nameservers in your /etc/resolv.conf
.
vi /etc/resolv.conf
If /etc/resolv.conf does not have any nameservers, you can add this line somewhere in the file:
nameserver 8.8.8.8
Note: if you have used dhclient command, you should have a few nameservers like the following. However, you can just add the nameserver 8.8.8.8 to get yum working like I did above. The following is just a sample of what a /etc/resolv.conf
would be generated by dhclient.
; generated by /usr/sbin/dhclient-script search bu.edu nameserver 128.197.253.183 nameserver 128.197.253.120 nameserver 128.197.253.254
After saving the file with at least one nameserver, restart the network.
systemctl restart network
yum install wget
You should be able to install your yum packages now!