Ubuntu on VirtualBox Will not Upgrade or Install Any Software

by Nicholas Romeo on January 17, 2012

At least not by default.

I learned this the long and hard way. Hopefully someone will come across this incredibly simple fix before pulling their hair out trying to figure it out. I spent half a day on it.

By default VirtualBox will setup your Virtual Machine’s network adapter to connect via NAT. If you don’t change this setting Ubuntu (11.10) will not be able to perform any updates, upgrades, or installations of any kind! You will get an error that resembles the following:

Err http://archive.ubuntu.com/ubuntu/ oneiric/main git-man all 1:1.7.5.4-1
 Bad header line [IP: 91.189.92.181 80]
 Err http://archive.ubuntu.com/ubuntu/ oneiric/main git i386 1:1.7.5.4-1
 Bad header line [IP: 91.189.92.181 80]
 Err http://archive.ubuntu.com/ubuntu/ oneiric/main patch i386 2.6.1-2
 Bad header line [IP: 91.189.92.181 80]
 Fetched 26.2 kB in 1s (23.6 kB/s)
 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_1.7.5.4-1_all.deb Bad header line [IP: 91.189.92.181 80]
 Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/g/git/git_1.7.5.4-1_i386.deb Bad header line [IP: 91.189.92.181 80]
 Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/patch/patch_2.6.1-2_i386.deb Bad header line [IP: 91.189.92.181 80]
 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Switching your Network Adapter setting in VirtualBox to Bridged Mode fixes it.

DeliciousRedditStumbleUponShare
dailywalk365 June 23, 2012 at 1:55 pm

Your are a life saver! Now I can update all of my VM’s thanks to you.

rizvi September 3, 2012 at 3:52 pm

Thanks a million!! I ruined a day on it already.

Previous post:

Next post: