Sunday, November 4, 2012

Things you shouldn't do: or how I upgraded to Ubuntu 12.04: Precise Pangolin

A pangolin
A Pangolin
So I just moved to a new house, and now that I actually have room for my stuff, I dusted off my old Ubuntu desktop for the fun of it and set it up on a desk in my new basement. It has been several months since I used it, so after booting I get prompted by Ubuntu's Update Manager program to install a million updates for things that I probably never used. Fine, maybe there are some security fixes or something. I click "Install Updates" and away, we go. Not too long later, I get some errors about the Bootloader being out of disk space. That sounds troubling. So I Googled for a while and found some advice about cleaning up old packages, and I did all that, removed a bunch of games and other programs I didn't need. That seemed to solve things. I ran update manager again, and finished the install. Everything seemed great.

There was just one more problem. Update Manager had a little tiny message above the normal dialog to select packages. It said something like "Upgrade to Ubuntu 12.04 LTS". So my desktop was on 10.04. I had actually recently tried out the new version of Ubuntu on a VM using their prepackaged all-in-one Windows installer "Wubi". I didn't like it, and found the performance was horrible on my Windows 7 laptop. Opening a folder a document would take 30 seconds and literally lock me out of doing anything else. I wasn't crazy about the new "Unity" style OS face lift they now package. But regardless of that experience, I am now a well trained animal, and when my computer's operating system tells me I should upgrade, and they make it so easy to accept it, newer is always better, always more security issues resolved, defects fixed, I mean why wouldn't I want to upgrade? So I couldn't help myself after a couple of days I went back and started the upgrade process.

It ran all night long. Not necessarily because it took that long, but because every so often in the upgrade process it would sit waiting for a user prompt, usually for some third-party software license exception. Finally at the end of the process I had a new looking default desktop background, everything seemed great with the upgrade. It asked me to reboot and...

Ubuntu 12.04 default desktop background with nothing else.
Approximation of the Ubuntu screen after upgrade
Then I couldn't log in anymore. Somehow they managed to make it so when I type my password for my normal super user account it just goes back to the same login screen. When I logged in as the guest user, it gave me a bunch of pop ups that I didn't have permission, but then loaded a totally blank screen with just the new Ubuntu background and my mouse cursor. I was trapped. "Linuuuuux!!" Since that point, I've been trying to recover this PC. I downloaded a new 12.04 Ubuntu Live CD to boot with. From that you get into the option to either Try Ubuntu out or Install Ubuntu. I wasn't prepared to reinstall and lose my data yet.

So first and foremost I was looking into similar related problems like screen resolutions not being detected. I found a few tips, for example editing /etc/X11/xorg.conf and manually specify the Screen subsection with your resolution modes. However, of course, in the Try out Ubuntu from the Live CD none of your hard disks partitions are mounted. Even worse, in my case, I couldn't directly mount my partition containing my existing OS and data (/dev/sda5) was of type lvm2, which of course, the default Ubuntu doesn't have the packages for it. Somebody has gone through something similar and I was able to do those steps in the Live CD Ubuntu, the only difference is that I would mount the partitions as rw:

sudo mount /dev/VolGroup00/LogVol00 /mnt/fcroot -o rw,user ...
So that was half the battle. But once I had done that, I tried the edit to xorg.conf. I saved the file and rebooted. Still got the same "Not optimum mode" message on my monitor. I tried a few settings, but no luck. I decided to try a more radical solution: A reinstall using thie Live CD without overwriting my existing partitions and data. Unfortunately. Due to having the "lvm2" partition that contained my logical volumes from my existing install the installer doesn't recognize these are a partition! So I had to go into the Try Ubuntu option first, and then follow all the steps described above to install lvm2 and activate my Logical Group in the lvm2 partition, then try the install.

I went through the entire install and ended up with a error that it was unable to install the Bootloader! Great! I went through an exercise to resize partitions thinking that might be the cause see:
lvm-resizing-guide ,linux-lvm-resizing-partitions (note Ubuntu 12.04 ships with GParted v0.11 which doesn't support the lvm2 file system format!, so in my Live CD OS I had to uninstall that and manually install the 0.14 version.). However after all that, I ended up using these steps to successfully manually install the Grub boot loader and use the Boot Repair program. After all this work I ended up with the same result as my upgrade, I was unable to see anything when I logged in as a guest (didn't recognize my actual admin user and password).

At this point after struggling with it for two days, I've decided to just do a reinstall. I don't know who or what installed the LVM partition, or where the boot loader should go. So I just went with a straight up new install of Ubuntu 12.04 LTS Desktop edition over my existing PC and I told it to reformat my HDD


After reinstalling clean. I had still got the Not Optimum Mode from my monitor during boot up. But from the login screen onwards everything looked ok. I did start getting new errors from Ubuntu telling me that jockey-gtk had crashed. Always helpfully I did a good search and located a few similar bug reports on the ubuntu forums. Seems to be an Nvidia driver issue. So I did an
apt-get update and
apt-get upgrade
to make sure I had all the latest packages. Then run sudo jockey-gtk, this prompts me to install Additional Drivers, I selected (version current)[Recommended], it installed the Nvidia driver, but didn't solve the problem in the boot screen and then I get a "The application Compiz has closed unexpectedly." error and a really messed up garbled background instead of the desktop, looking at the error details, it said that I had "obsolete packages" and that I should update "unity, libunity-core-5.05, unity-common and unity-services". So I rebooted this time into "Unity 2D" and did the update manager  which had a ton of updates (funny, why didn't apt-get upgrade install these before?)

Even after all this, I was still getting weird Not optimum messages on my monitor on shut downs and start ups. Seems that I was hitting some flavor of this problem. What worked for me. Use your own judgement was to first edit the /etc/default/grub config file

sudo gedit /etc/default/grub

Change GRUB_CMDLINE_LINUX_DEFAULT="splash" (removed quiet).
Some answers for related questions tell you to set nomodeset. I tried this but had negative results...

Uncomment and change GRUB_GFXMODE=1280x1024
Default was something like 640x480, the 1280 resolution was the "optimum" resolution displayed by monitor in the error messages I was getting in start up.

Next update grub
sudo update-grub

I think followed steps in the above linked question's answer for the purple start up screen to force the graphics drivers to be loaded in start up by configuring
/etc/initramfs-tools/conf.d/splash.

Lastly, the other quirk which apparently is benign? Was that in the System Settings > Details it was reporting an "Unknown" graphics driver. This is apparently due to a missing library(?) mesa-utils that is needed for displaying the graphics driver information:
http://askubuntu.com/questions/151608/details-window-showing-unknown-driver-for-graphics
So following the steps:
sudo apt-get install mesa-utils

Solved that issue. A few reboots later and the splash screen came up and the login works fine on my brand new re-installed Ubuntu 12.04. Gotta love "Linux for Human Beings".

Edit: Courtesy of this Google+ post when #Linux briefly trended
Linux...