Fixing an Ubuntu update issue

I started having problems with Ubuntu updates. I noticed them at the beginning of the year. At first, the message that appeared was a notice about lack of space. A notice appearing after failed upgrades also described possible issues and fixes. I ran the suggested commands, *>sudo apt-get install -f” and “sudo apt-get clean”, but the error was not resolved.

I was unsure if the problem had to do with the lack of space needed to unpack the updates. “sudo apt-get autoremove” did not resolve the space issue. I focused on adding extra space the Ubuntu VM, described here. Once that was completed, I tried the suggested commands, but still had the same issues and errors. The error displayed read something like this:

> dpkg: error processing linus-headers – generic (~configure)
> linux-generic depends on linux-image-generic (3.2.0.59.70)
> however version of linux-generic in system is 3.2.0.60.70

I ran the suggested commands

> sudo apt-get purge linux-generic
> sudo apt-get install –reinstall linux-generic

I believe the idea is to remove the linux-generic version that is causing the issue. However, after running these commands, I still had the same message appearing. Running

> sudo apt-get clean
> sudo apt-get auto remove

did nothing new. I considered running dpkg, but dpkg won’t install dependencies that apt-get will, so I left dpkg alone.

After some more google searches, I ran across something that did work:

> sudo apt-get remove linux-image-generic linux-generic linux-headers-generic

As I understand it, this removes these items from the software waiting to be updated without removing configuration files.

> sudo apt-get -f install
> sudo apt-get auto remove

loaded the proper versions of the missing files and the Ubuntu updates have been running fine since.

Yes to Gparted, but still having trouble

It turns out the /home directories in my Ubuntu VM were too small to transfer over to a separate partition. I ran “Disk Usage Manager” (I think) and discovered that one of my main directories (/usr or /lib) was using almost all the free space available. It was a good idea to use VBoxManager to boost the space available for the hard drive in the VM. However, GParted does not allow modification of the partition it’s running on.

I realized I had to run a GParted Live CD on the VM. I found the .iso file and left it on the desktop. I had to modify the VM settings to read the .iso file first when booting. Once I figured that out, I was able to run the GParted Live CD. I was still having trouble reordering the partitions of the Ubuntu VMs.

It turns out that the extra space was added at the end of the Linux swap partition, as separate unallocated space. Eventually, a Google search helped me realize that I needed to move the Linux swap space to the far end of the unallocated partition, then extend the “boot” partition over to fill the remaining space. (It’s weird. Why not just one command instead of two separate actions?) I reshuffled the partition space, rebooted and Ubuntu started again with the full 16 GB partitions correctly.

Unfortunately, I’m still having trouble with Ubuntu updates. I can finally run them without running out of free space, but I have a configuration problem where a linux-generic update depends on another file that is not loaded and that file won’t load because it’s not needed. More on that later.