Ubuntu 12.04 initramfs dependency nonsense
In managing Linux servers, and I’ve encountered the following situation many times:
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
initramfs-tools : Depends: initramfs-tools-bin (< 0.99ubuntu13.1~) but 0.99ubuntu13.5 is installed libc6-dev : Depends: libc6 (= 2.15-0ubuntu10.5) but 2.15-0ubuntu10.4 is installed plymouth : Depends: libplymouth2 (= 0.8.2-2ubuntu31) but 0.8.2-2ubuntu31.1 is installed E: Unmet dependencies. Try using -f.
It’s usually caused by /boot filling up with old kernels, which will eventually happen if you used default partitioning and configured Ubuntu to automatically install security updates. As a result, updates stop getting applied, which could potentially leave the system vulnerable.
I keep thinking I’m finished fixing this problem, but then I end up using another server that has this issue. I always manage to fix it, but each time I find myself figuring out or tracking down a solution. (There are many ways to address it.)
The first step is to free up space. You can probably do that by removing the accumulated kernels you’re not using.
This command (borrowed from a post on askubuntu) should do it (by listing the installed kernels, stripping out the running kernel, then uninstalling the remaining set):
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
After that, the following commands (borrowed from a link on stackexchange) should get things back into a sane state:
sudo dpkg --configure -a --force-depends
sudo apt-get install -f
sudo apt-get dist-upgrade
Now I’ll remember where to find the solution next time I encounter this… and hopefully someone else will benefit.
Comment
…
Well this is an awkward silence.
Comment
Draw Something More
My Vader skills improved.
Comment
Small town manners
Comment
Draw Something
I’ve been playing Draw Something on my mobile devices lately. I’m gonna share some of my drawings. I’m posting from my phone, or I’d blur out the words.
I think I’ve improved over time, so I’m going to put them in chronological order.
That’s all for now. I’ll post more later.
Comment
Fireworks
This year we sat behind our usual tree in a park in Provo, Utah and watched the higher altitude elements of Stadium of Fire. As usual (for me when taking pictures of fireworks), the focus isnβt quite right, but I think I managed the exposure better than I have in the past. Here are a few of the photos.
Comment
I’m a grandfather?
My 20-year-old daughter is a mother, which apparently makes me a grandfather. The cool part of becoming a grandfather is that it comes with a grandchild–a grandson in this case. Here is some photographic evidence.
1 Comment
Grandma’s New Christmas CD
This Christmas my brother-in-law came up with a fun joke to play on my Mom. He gave her a Christmas CD of David Archuleta singing with the Mormon Tabernacle Choir, and he asked me to create a fake cover of Lady Gaga singing with the Mormon Tabernacle Choir.
He recorded her reaction.
1 Comment