do999
By:
do999

Apt-get update failing with unable to resolve error

January 30, 2015 5.6k views

root@docean9:~# apt-get update
Err http://software.virtualmin.com virtualmin-trusty InRelease

Err http://software.virtualmin.com virtualmin-universal InRelease

Err http://security.ubuntu.com trusty-security InRelease

Err http://security.ubuntu.com trusty-security Release.gpg
Could not resolve 'security.ubuntu.com'
Err http://software.virtualmin.com virtualmin-trusty Release.gpg
Could not resolve 'software.virtualmin.com'
Err http://software.virtualmin.com virtualmin-universal Release.gpg
Could not resolve 'software.virtualmin.com'
Err http://mirrors.digitalocean.com trusty InRelease

Err http://mirrors.digitalocean.com trusty-updates InRelease

Err http://mirrors.digitalocean.com trusty Release.gpg
Could not resolve 'mirrors.digitalocean.com'
Err http://mirrors.digitalocean.com trusty-updates Release.gpg
Could not resolve 'mirrors.digitalocean.com'
Reading package lists... Done
W: Failed to fetch http://mirrors.digitalocean.com/ubuntu/dists/trusty/InRelease

W: Failed to fetch http://mirrors.digitalocean.com/ubuntu/dists/trusty-updates/I
nRelease

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/InRel
ease

W: Failed to fetch http://software.virtualmin.com/gpl/ubuntu/dists/virtualmin-tr
usty/InRelease

W: Failed to fetch http://software.virtualmin.com/gpl/ubuntu/dists/virtualmin-un
iversal/InRelease

W: Failed to fetch http://software.virtualmin.com/gpl/ubuntu/dists/virtualmin-tr
usty/Release.gpg Could not resolve 'software.virtualmin.com'

W: Failed to fetch http://software.virtualmin.com/gpl/ubuntu/dists/virtualmin-un
iversal/Release.gpg Could not resolve 'software.virtualmin.com'

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/Relea
se.gpg Could not resolve 'security.ubuntu.com'

W: Failed to fetch http://mirrors.digitalocean.com/ubuntu/dists/trusty/Release.g
pg Could not resolve 'mirrors.digitalocean.com'

W: Failed to fetch http://mirrors.digitalocean.com/ubuntu/dists/trusty-updates/R
elease.gpg Could not resolve 'mirrors.digitalocean.com'

W: Some index files failed to download. They have been ignored, or old ones used
instead.
root@docean9:~#

3 comments
3 Answers

Following solution helped me:

sudo apt-get clean
cd /var/lib/apt
sudo mv lists lists.old
sudo mkdir -p lists/partial
sudo apt-get clean
sudo apt-get update 

I found it here: https://www.kubuntuforums.net/showthread.php?57567-Ubuntu-problems-on-update

so how did you guys solved this? I'm having the same issue

I am assuming Ubuntu 14.04 on a recent Droplet (considering apt-get is looking for trusty)... lsb_release -a will tell you your Ubuntu version.

Do you have ufw enabled? If so, disable ufw and try apt-get update again...if it works, you need to add outgoing rules for http(s) and dns like so
ufw allow out 80
ufw allow out 443
ufw allow out 53
ufw enable

try apt-get update again...now it should work

Have another answer? Share your knowledge.