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://archive.ubuntu.com/ubuntu/pool/main/libe/liberror-perl/liberror-perl_0.17-1_all.deb Size mismatch Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/g/git/git-man_126.96.36.199-1_all.deb Bad header line [IP: 188.8.131.52 80] Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/g/git/git_184.108.40.206-1_i386.deb Bad header line [IP: 220.127.116.11 80] Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/patch/patch_2.6.1-2_i386.deb Bad header line [IP: 18.104.22.168 80] 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 protocol(ie. NFS) and that leads 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.