Saturday, January 1, 2011

Broken Ubuntu Packages

I was installing updates on my fit-pc when I accidentally killed the power, and ended up with some broken packages with Synaptic couldn't fix. I read the Package Manager Troubleshooting Procedure, but step 5 implied that this would get information about why it wasn't working rather than fixing the problem*, and I wanted to fix it.  I also wasn't entirely sure what all the commands did and I don't like running commands when I don't know the expected results.

I decided to look at the errors Synaptic gave when trying to fix the broken packages.  There were lots but the most interesting ones were things like this:

dpkg-deb: `/var/cache/apt/archives/libgomp1_4.4.1-4ubuntu9_i386.deb' is not a debian format archive

I did a bit of research and then downloaded packages manually, and copied them to /var/cache/apt/archives/ and this fixed the errors. There was one package I couldn't find so I just deleted that file, and hoped Synaptic would download it, which it did.  At this point I had no broken packages.

I then tried to install the rest of the updates and got similar errors. I was fed up with downloading packages manually so I deleted all the packages from /var/cache/apt/archives using the following command:

sudo apt-get clean

With hindsight that's what I should have done to start with.

I'm surprised that Synaptic doesn't handle this scenario so that non-techy people could resolve the problem without using the terminal.  Hopefully it does in a newer version.

*With hindsight I think it would have fixed the problem.

No comments:

Post a Comment