TurnKey Linux Virtual Appliance Library

Fix for apt-get: Could not resolve 'archive.ubuntu.com'

vanarie's picture

Recently APT-GET started having problems resolving archive.ubuntu.com to install packages.

The fix is easy:

1) Add this to the end of file /etc/hosts    archive.ubuntu.com    security.ubuntu.com

2) Restart network from the command line: 

#/etc/init.d/networking restart
Liraz Siri's picture

If you use a reliable nameserver you won't have to hardwire IPs

If Ubuntu ever move the server to another address those IP addresses will be broken so its best to solve this problem by using a reliable DNS server, like Google's:
You can configure the nameserver in the configuration console if you configure your address with a static IP. You can also add it to /etc/resolv.conf but if you later use the configuration console those changes might get overwritten.
Guest's picture

Proper Nameservers

Hi all,

  Liraz Siri's comment is important.  I had same problem, and the original solution worked (kudos and thanks to vanarie).

However, the root of the problem was not the network of my server, but the fact that my VPN client had overwritten resolv.conf

Adding proper nameservers like Liraz mentioned solved the root of the problem.




Guest's picture

he thanks for the fix you

he thanks for the fix you doing fine .how eo you do that?
Guest's picture

Problem is in /etc/nsswitch.conf

I fix this problem changing the order in the file /etc/nsswitch.conf, line host. Put the option dns in the beginning ( I put after files ).

hosts:          files dns wins mdns4_minimal [NOTFOUND=return] mdns4



Guest's picture

I realize this is a very old

I realize this is a very old thread but this finally fixed my issue.  I moved 'dns' right after 'files' and I can now update and install packages.

Guest's picture


Hi vanarie

Thanks for your inputs. It helped me fix the same problem in virtualbox setup having ubuntu guest OS.


Girish S

Guest's picture

problem installing updates

just installed ubuntu lots of problems have to reboot machine several times to get to desktop and when i finally do and download updates it will only install 40% and stops at configuring hpijs tired of messing with it any help befor i strip it off my machine and find something else

Jeremy Davis's picture

When you say you're installing Ubuntu...

Do you mean one of the Ubuntu based Turnkey Linux appliances? If not you're not in the right place... I suggest that you try the Ubuntu forums (or at least start a new forum thread in the 'general' section because it doesn't apply to this thread). TKL appliances don't have a desktop (they are server appliances).

If you do mean TKL then you need to supply a bit more info. perhaps post some screenshots of something.

Guest's picture

Thanks ..

thank you . you saved me a lot of time .... :) cheers ..

Guest's picture

Worked like a charm - thanks!

Solved the problem! Thanks!

Guest's picture

Awesome Sauce

This worked for me!! (First solution). I was so scared that something wrong was with my OS...but this saved me. Thanks a bunch!

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)