Thursday, December 15, 2011

FINALLY fixed Apt!

As usual, I'm not responsible for the accuracy of this post, or the results you might encounter from attempting to imitate it. You're a Linux user, you should know to be careful, or accept the consequences. And I'm only going to say this once: don't copy and paste a command unless you know what it does.

Turns out the Apt problem that's been plaguing me -the same that seemingly fubared my graphics driver and left me using Windows for a few months- apparently wasn't gone. Every time I tried to install or remove something, I would get hella error messages about nothing being configured. Well, first I tried to fix cups, which was first on the list. The method one person suggested was purging it then reinstalling it, which worked, but I do not recommend it. Cups is decently unimportant. The next on the list was udev, which sounds important just by the name, and I did not want to purge it. Plus there were a ton of "lib___", some that sounded very necessary, at least to KDE.

I looked around and eventually found a thread on Linux Questions about this very problem: something was wrong with udev which threw off initramfs-tools, which in turn threw off around 195 packages that needed them to be configured. The major consensus is to try to get Apt to configure the packages that are unconfigured, but for me, all that yielded was about 2.7 billion errors (massively trimmed down because you don't care):
$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree      
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 40 not upgraded.
192 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.

Setting up udev (173-0ubuntu4) ...
udev start/running, process 5104
info: unrecognized option '--convert-db'
dpkg: error processing udev (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of initramfs-tools:
 initramfs-tools depends on udev (>= 147~-5); however:
  Package udev is not configured yet.
dpkg: error processing initramfs-tools (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.

Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
The solution? Reinstalling force. The poster in that thread mentioned that there should be a backup in /var/cache/apt/archives/udev*.deb, but that didn't exist for me so I downloaded it the Ubuntu archive from It's important to use the same package that your system is set up for; originally I downloaded them off Debian's website but there are certain Mint-specific packages that have dependencies to "0.99_7ubuntu" instead of just "0.99_7". It also lessens the chance of things breaking. Anyway, however you get the DEB, find the correct one for your system and use the force:
dpkg -i --force-all ./udev*.deb
 HEY. LISTEN. This is important. After doing that I tried another install -f, there was another missing dependency so it was prepared to remove....well, damn near everything except udev:
After this operation, 1,371 MB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
 If you get this, you'll need to update libudev0 as well, which is the same deal: get the DEB, and run a:
dpkg -i --force-all ./libudev0*.deb

After that I ran another install -f and BEHOLD: packages were configuring! Unfortunately I got one more error message still:
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)
Again, I tried another --force-all with the initramfs-tools DEB, Which of course lead to yet another error:
cp: cannot stat `/usr/lib/pango/1.6.0/module-files.d/libpango1.0-0.modules': No such file or directory
cp: cannot stat `/usr/lib/pango/1.6.0/modules/': No such file or directory
 Which I learned a fix for in a Mint thread, but I actually suggest the method prescribed in this blog that uses a symlink instead:

sudo ln -s /usr/lib/*-linux-gnu/pango /usr/lib/pango
(The * is your architecture: either i386 for 32-bit or x86_64 for 64-bit.) After this, try another force with initramfs-tools, and -for me- the issues with the 20,000 errors under the sea went away.

This fixed the issue for me, though I've got a few more problems I need to solve:
  1. for some reason I still get "The following packages have been kept back", which lists a crap ton of xserver* packages.
  2. When attempting a dist-upgrade, it says it's going to remove kubuntu-desktop and xorg
It looks like I just won't be able to do a dist-upgrade right now but hopefully I can at least do a regular upgrade.

I did all of this to attempt to run Illumination Software Creator on Linux, but I then got sidetracked trying to get fgrlx working again. In any case, the Apt problem seems to be solved, so one down, two to go.

No comments:

Post a Comment