Monday, March 1, 2010

Ubuntu 9.10: Downgrading from 64-bit to 32-bit Karmic Koala

As indicated by numerous posts in this blog over the past couple of years, I had a number of problems with 64-bit Ubuntu installations -- orphan problems, especially, that almost nobody else seemed to be having.  I finally decided to try replacing 64-bit with 32-bit Ubuntu 9.10.  This post describes the steps I took to install and configure the downgrade.

First, I made an Acronis TrueImage backup of my current installation, so that I could quickly restore the 64-bit installation if it turned out that downgrading to a 32-bit system wasn't paying off.  Next, I looked into the possibility of downgrading without doing a complete reinstallation, but the consensus
appeared to be that I would have to completely wipe the 64-bit installation and start from scratch, using 32-bit applications.

A tip from Benjamin Lowenstein led me to a quick method of listing and restoring my installed applications.  First, I typed "dpkg --get-selections > installed-software."  This created a file called "installed-software" in my Home folder.  The contents of that file looked like this:

acpi-support                         install
acpid                                    install
adduser                                install
In my case, there were hundreds of them.  Some that I had installed specially (i.e., outside of Synaptic Package Manager), such as VMware Workstation, were not on the list.  Otherwise, though, I would later be able to use this list to restore the large majority of my programs automatically.  Quite an improvement over Windows!

But first, I had some housekeeping to do.  For one thing, the dpkg command put that "installed-software" file into my Home directory; and since I was in the habit of installing all of my Ubuntu folders into a single partition, I assumed that my Home directory would be wiped out during the 32-bit installation.  So I moved the installed-software file to a different partition.  I already had my other data files, virtual machine folders, etc. on other partitions, with one exception:  my Thunderbird e-mail data was in /home/ray/.mozilla-thunderbird, so I had to copy that over to another drive as well.  My Firefox extensions and settings were backed up to that other partition by the FEBE add-on, so I expected the Firefox part of my reinstallation to go smoothly.

Meanwhile, I was downloading the current version of 32-bit Ubuntu 9.10.  When it finished, I burned it to a CD, inserted the CD in the target machine, and rebooted.  The basic installation did not go too smoothly, though.  For some reason, the newly burned CD booted only once in the target machine.  On later reboots, the machine did not boot from the CD, but instead went on to boot from the hard drive.  I tried booting from the CD with a different program, and in that case the machine booted from the CD as expected.  So I switched to an older Karmic 32-bit CD I found lying around.  That booted without a problem.  But then the system seemed to have gotten confused from the previous efforts, and that installation got hung up and took a long time to get past the partitioning step.  The hard drive was still going, according to the activity light; it was just not going anywhere in particular.

At about the same time, the Internet connection on my secondary computer began acting up.  Suddenly, without warning, I wasn't able to go online.  I decided to try installing 32-bit Ubuntu 9.10 there too, using the newly burned CD.  That installation went fine.  And then it was time to work through a 32-bit version of my typical installation steps, following the process described in my previous posts on installing 64-bit Ubuntu 9.04 and 9.10.

I started by running System > Administration > Update Manager to update the programs installed by the CD.  Then I went into Applications > Ubuntu Software Center > Get Free Software > search for "restricted extras" > Ubuntu restricted extras > Install.  Next, System > Administration > Hardware Drivers searched for available drivers and, for my machine, found NVIDIA accelerated graphics driver (version 185) (because I had an NVIDIA video card) > Activate.  This gave me an error:
SystemError:  Failed to lock /var/cache/apt/archives/lock
I wondered if this was because I had not yet rebooted the machine after downloading and installing the initial batch of updates. A reboot got me past that error, but now I had a new one:
SystemError: installArchives() failed.
I tried installing the older (version 173) driver instead.   That seemed to go OK.  It said, "You need to restart the computer to activate this driver," but meanwhile I had gotten started on the next step, so again I deferred rebooting.  That next step was System > Administration > Software Sources > Ubuntu Software tab > Download From > Other > Select Best Server > Choose Server (whichever one it highlights) > Close > Reload.  Then I went back into Software Sources > Other Software tab > select the two entries that are already there > Add.  To get the APT line it was requesting, I opened Firefox and went to the X-Updates website, clicked on "Technical details about this PPA," specified Karmic, and copied the two deb lines there, one at a time, into the APT line, clicking "Add Source" after each.  Next, on that same webpage, below the deb lines, I found the "Signing Key."  In this case, it was "1024R/AF1CDFA9."  I copied the portion after the slash (i.e., AF1CDFA9) and entered it into Terminal at the end of a one-line command, as follows:
sudo apt-key adv --keyserver --recv-keys AF1CDFA9
This gave me this output in Terminal:
gpg: key AF1CDFA9: "Launchpad PPA for Ubuntu-X" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
I suspected this meant that one or more of my steps had accomplished nothing.  Then I clicked Close > Reload.  (From a previous installation, I had a note to myself:  If you don't get a "Reload" option when you click Close, go back into Third-Party Software and unclick and then re-click some item and try again.  That step was not needed this time.)  Also, by typing "sudo gedit /etc/apt/sources.list," I was able to verify that there were no hash marks in front of the lines for the Universe and Multiverse repositories, which apparently meant they were already available.  The other repository I wanted was the Medibuntu, which I added by using these three commands:
sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list$(lsb_release -cs).list && sudo apt-get --quiet update && sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring && sudo apt-get --quiet update
sudo apt-get --yes install app-install-data-medibuntu apport-hooks-medibuntu
sudo apt-get install libdvdcss2
After installing the Medibuntu repository, I realized that possibly my only reason for having it had been an attempt to make some things work on my 64-bit installation.  But soon I was to discover that I could use it to install Google Earth too.

The next step was to try the other half of the tip mentioned above.  I copied the  "installed-software" file back to my Home folder and maneuvered the Terminal cursor to that location (cd /home/ray) and then entered the needed commands:

    sudo dpkg --set-selections < installed-software

    sudo apt-get install dselect

    sudo dselect

This started dselect.  There, I went into Access and selected APT Acquisition.  It asked whether I wanted to overwrite the sources list mentioned above.  I said no.  This put me back at the next item on the menu, Update; and when I went with that, it updated something and then put me to the next item, Select.  Here, I paged through thousands of packages, not sure of what I was looking for, not seeing anything marked with boldface or "Y" instead of "n."  I bailed out of that -- it wasn't easy, but I used some uncertain combination of Esc, Q, X, space, and Enter -- and that took me to the Install menu option.  This appeared to be what I was looking for.  When I chose this one, it said it was going to get 390MB of archives and use 924MB of additional disk space, which sounded like a lot of installing and updating.  The first couple of items that it seemed to be downloading did appear on the installed-software list, so it all looked good.  But then my network connection died, so I had to start dselect again.  This time, I went directly to the Install option.  It seemed to resume where it left off, and after a while it finished downloading and began adding and removing stuff.   Then it wanted to reboot, and that was fine with me.

Previously, when I had installed 64-bit Ubuntu 9.10, I had manually added a number of programs through System > Administration > Synaptic, including particularly these:  boinc; boinc-manager; dvgrab; fdutils; gparted; mplayer; ntfs-config; ntfsprogs; p7zip-full; sysinfo; and webhttrack.  Now I checked Synaptic to see which of those had been reinstalled through the dselect process. Well, it had worked.  Every one of them had been reinstalled.  I tried System > Administration > Update Manager > Check.  It confirmed it:  everything was up to date.  That dselect process was one smooth play.  What a remarkable improvement over the Windows reinstallation process!

While I was in Synaptic, I installed googleearth (already mentioned above).  I also kept Thunderbird on only one computer because, for the time being, I didn't want to worry about keeping Address Books and Inboxes synchronized across multiple computers.  Also, after I later installed AutoFsck from a .deb download, I discovered that it, too, was in Synaptic.

Next, I installed FEBE and used it to restore my previous Firefox setup.  Unlike my previous attempt, this time I did succeed in using a FEBE backup from Windows XP to restore my Firefox add-ons and settings in Ubuntu.  I installed Google Chrome, checked to verify that Opera was still not available through Synaptic, downloaded it from its website, and double-clicked on the .deb download to install it.

I had just sent an e-mail to VMware, asking if they would allow me to downgrade my recently purchased 64-bit Workstation 7 license into a 32-bit Workstation license.  Hoping to receive a favorable answer from them, whenever they would get back to me, I went ahead and installed the 32-bit version for at least their 30-day trial period. Workstation 7 came as a .bundle file, which required the same installation steps as .bin files.  In Terminal, I navigated to the folder where I had put the download, and then typed these two commands:
sudo chmod +x VMware-Workstation-Full-7.0.1-227600.i386.bundle 
sudo ./VMware-Workstation-Full-7.0.1-227600.i386.bundle
Next, to set up my partitions so that they would be mounted automatically, I used these commands:
sudo ntfs-config
sudo gedit /etc/fstab
sudo gparted [entered in a separate Terminal session]
sudo blkid [entered in a separate Terminal session]
The first one, "sudo ntfs-config," would open a dialog offering to let me include any partitions that were not presently mounted.  It also offered write support for both internal and external devices, which I accepted, and then it modified the fstab file to include lines for ntfs partitions.  The next command, "sudo gedit /etc/fstab," opened the fstab file for manual adjustment.  Then "sudo gparted" opened the GParted program so that I could see what partitions existed, in case I wanted to add any more partitions to fstab, and "sudo blkid" told me what their UUIDs were.  This information resulted in arrangements and additions to fstab so that my partitions were in an order I liked, with explanatory comments (preceded by #), using UUIDs rather than partition names where possible, so that the fstab commands would still work if I renamed the partitions.  Examples of the results looked like this:
# Entry for /dev/sdb2 [a Linux ext3 partition] :

UUID=9cec5b4d-7e72-42a9-86ee-b59c16e6410f /media/VMS ext3 defaults 0 0

# Entry for /dev/sdb3 [a Windows partition] :
UUID=5B56363D59D5E95C /media/CURRENT ntfs-3g defaults,locale=en_US.UTF-8 0 0
Next, I did some configuring.  I went into Nautilus > Edit > Preferences and made changes there.  To prevent icons for mounted drives from appearing on the desktop, I typed "gconf-editor" and went into apps/nautilus/desktop, unclicked volumes_visible, and closed Configuration Editor.

In System > Preferences > Startup Applications, I added Chrome, Firefox, and VMware Workstation.  To get the necessary information for that, I right-clicked on the top panel near "Applications" and chose Edit Menus, then selected the item in question and right-clicked for its Properties.  To configure boinc, I went to Applications > System Tools > BOINC Manager > Next and, in the Choose a Project window, I typed in the URL (in my case,  (I had already gone to that site and set up an account.)  Then I logged in, and back in the BOINC Manager I adjusted my preferences.

I wanted Grub2 to boot up whatever operating system I had used last, instead of always defaulting to Ubuntu, so I typed "sudo gedit /etc/default/grub"; I changed one line to say GRUB_DEFAULT=saved instead of GRUB_DEFAULT=0; I saved and closed that file; and then I typed "sudo update-grub."

Reviewing my previous post on scheduling things, I wanted gedit to be my default crontab editor, so I typed "gedit /home/ray/.bashrc" and, at the end of that file, I added a new line that said "export EDITOR=gedit" and then saved and closed .bashrc.  I had developed scripts that I wanted to run on regular occasions, so I put those in a folder on a partition that would not be wiped out if I reinstalled Ubuntu.  Then I set up recurrent entries in Applications > System Tools > Scheduled Tasks.

Among the partitions listed in fstab, I wanted some to be available to ordinary mortals (namely, me) instead of having to become root (i.e., use sudo) to mount and access them.  To do this, I typed "sudo mount -a."  This gave me an error for one partition:  "mount point /media/[partition name] does not exist."  It was an ext3 partition so, in fstab, I changed its options to be like those shown for the VMS partition (above) and then typed the following three lines (using the CURRENT partition as an example):
sudo mkdir /media /CURRENT
sudo mount -t ext3 /dev/sda3 /media/CURRENT
sudo chmod 777 /media/CURRENT
To configure VMware Workstation, I typed "sudo vmware" and went into Edit > Preferences and set as many settings as possible. I verified that the 32-bit version of Workstation was able to open the VMs I had created in the 64-bit version.  I changed Settings for each VM as needed.  (I had to resume and then shut down those VMs that had been merely suspended.)  The 32-bit version of Workstation would allow a maximum of only about 3GB of RAM.  I had hoped that meant "per session," but, alas, that was not the case; the 32-bit operating system was able to recognize only about 3GB total, even though I had considerably more than that in the system.  Within Workstation's Edit > Preferences > Memory, the maximum available for VMs seemed to be 2966MB, and I had set Workstation to use 2500MB, so as to keep some RAM available for processes in Ubuntu.  I preferred to set my VMs not to swap, for speed -- that is, to keep everything in RAM.  So when I opened one VM with 1504MB allotted to it, and then started another session of Workstation and tried to open a VM that needed 1024MB, the second one told me that only 536MB was available.  This suggested that, of the 2500MB I had made available to Workstation, about 2040MB was available for VMs.  So there seemed to be an overhead of about 230MB per VM.  I set each VM to use 1000MB and was able to open two at once.

I then exited that root session of Workstation, restarted Workstation from Applications > System Tools > VMware Workstation, and verified that the VMs worked properly for the ordinary user.  One of the things I had to adjust, in the VMs, was that audio volume was low; I had to turn it up in Ubuntu first, and then adjust it in the Windows XP VM.  I was pleased to see that the stuttering problem I had had in 64-bit Workstation was gone, though there was some undesirable static.  Also, a renamed partition was no longer shared; I had to remove the old one from VM > Settings and add the one with the new name, and then reboot the VM.  I had to change the Network Connection from Bridged to NAT.  Inside the VM, I right-clicked on each partition name to change it from the long form (e.g., "Vms on 'vmware-host\Shared Folders'") to the short form (e.g., VMs).

It seemed likely that I would be continuing to tweak and refine the setup, but for now, this appeared to give me a good working situation.  It seemed that the 32-bit downgrade had been a good idea; I really hadn't encountered any of the strange things that had complicated life in the 64-bit world.



Forgot to mention Google Desktop, formerly called Google Desktop Search:


In Synaptic, I have also installed acroread and adobe-flashplugin.


In Synaptic, I have also installed unetbootin.