Some times I feel that I have reached the end point of my patients just like this day when I was stuck in Lubuntu update. I have set up the Lubuntu in VirtualBox virtual machine. Right after the installation I tried to update it – it failed to update then I tried to install GNOME-Commander that also failed.
The error was like this:
Failed to fetch http:Failed to fetch http:Failed to fetch http:Failed to fetch http:E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
It seemed that it could not connect to the server very well. But when I check the internet connection it works fine in all browsers. I searched about this topics in the google but could not find any way to fix it, not even in Ubuntu Forum. I was super confused and didn’t ever thought that it could be an issue from VirtualBox – coz all the browsers were working fine. Fortunately the next day a post from Nicolas saved me out.
The network connection for a VirtualBox uses optionally 8 hardware settings and 6 networking modes. Check out here for details. Among the 8 hardware most commonly used hardware is AMD PCNet FAST III (Am79C973, the default) – no problem with that. But the among the 6 networking modes the following 3 are mostly used.
- Not attached mode (the guest OS consider that the network cable is unplugged)
- Network Address Translation (NAT) mode (uses NAT between guest and host OS – therefore has some limitation)
- Bridged networking mode (VirtualBox connects to one of your installed network cards and exchanges network packets directly)
When a Lubuntu or Ubuntu is installed in a VirtualBox, by default the networking mode is selected NAT which is OK for browsing but has certain limitations with some protocols (i.e., NFS) and that leads to our problem – the Update manager can not communicate with the servers properly.
So to fix this issue just change the mode from NAT to Bridged networking mode. To do this in VirtualBox go to Settings -> Network, under the first tab change the ‘Attached to’ drop-down from ‘NAT’ to ‘Bridged Adapter’.
Hope this post will save a day of yours.