Showing posts with label synaptic. Show all posts
Showing posts with label synaptic. Show all posts

Thursday, September 9, 2010

Ubuntu 10.04 Installation: The Streamlined Version

In another recent post, I described the process of installing Ubuntu 10.04.  This post offers a streamlined version of that post.  That is, it describes another such installation, performed on the basis of that post.

The first step was to install Ubuntu from the live CD.  As before, in this step I installed everything into one root partition.  When installation was complete, I copied my saved fstab from a separate partition to replace the existing /etc/fstab, and then typed "sudo gedit /etc/fstab."  There, I replaced the UUID for the root partition with the new one shown in another Terminal session via "sudo blkid."  I saved and closed fstab.  This part still did not go smoothly -- I still had not mastered the translation of the Ubuntu Community Documentation webpage into terms that fit my situation -- but essentially I typed "cd /" and then "sudo mv /home /old_home" to park the newly installed but largely empty /home folder; then "sudo mkdir /media/home."  On reboot, my desktop was restored to its previous condition.  I deleted the /old_home folder.

Next, I went to the folder where I had saved my backup copy of sources.list and typed "sudo cp sources.list /etc/apt/."  I opened sources.list, copied the commented command lines, and ran them.  They generated what appeared to be error messages.  In Software Sources, I triggered a reload.  It closed without errors.  In Synaptic, I installed these programs:  acroread, acroread-fonts, adobe-flashplugin, boinc, dvgrab, fdutils, gparted, mplayer, nautilus-open-terminal, ntfs-config, p7zip-full, sysinfo, ubuntu-tweak, unetbootin, and webhttrack, as well as these font packages:  ttf-mscorefonts-installer, sun-java6-fonts, ttf-sil-gentium, ttf-sil-gentium-basic, ttf-dustin, and ttf-georgewilliams.  As before, I typed "sudo sh" to install my .bin and .bundle downloads (e.g., GoogleEarthLinux.bin) and double-clicked to install my .deb downloads.  Then I went into Update Manager, and ran and reran it until I was all caught up.

Monitor driver installation and BOINC configuration were as described in the "Settings and Adjustments" section of the previous post.  The GRUB2 menu edits, as described more carefully in that post, were as follows:  to get rid of the Memtest+ options, I typed "sudo chmod -x /etc/grub.d/20_memtest86+."  To let Ubuntu remember which operating system it had used last, I typed "sudo gedit /etc/default/grub," changed the first line to be "GRUB_DEFAULT=saved," and added a second line that said "GRUB_SAVEDEFAULT=true.  To limit the number of Ubuntu kernels shown, I typed "sudo gedit /etc/grub.d/10_linux," added "GRUB_DISABLE_LINUX_RECOVERY=true" at the top, and changed two lines at the bottom to be three that read as follows:

list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
list=`version_find_latest $list`
done
I saved and closed that and typed "sudo update-grub."  I typed "sudo vmware" and made some root adjustments there.  I rebooted and everything looked good.  There were a few rough spots, but I could see that this might not take very long at all, once you got the hang of it.

Saturday, July 10, 2010

Interrupted Upgrade from Ubuntu 9.10 to 10.04 (Lucid Lynx)

Using Update Manager, I was downloading an upgrade from Ubuntu 9.10 to 10.04 (Lucid Lynx) on my laptop.  I had to interrupt it.  When I started the laptop again and tried to resume the upgrade, I had problems.  For one thing, I wasn’t located in a place with wireless, and my wired ethernet connection was not working.  I had already downloaded the remaining upgrade packages at a wireless location, though, so I hoped it would be just a matter of starting the computer and installing those updates.  This, unfortunately, was not the case.  It seemed I had completely screwed up the Ubuntu kernel, and therefore had to choose an older kernel to install from in GRUB.  Then, when I went into System > Administration > Update Manager, I began to learn that my problems had only begun.

What I got, in Update Manager, was this message:
Not all updates can be installed.
Run a partial upgrade, to install as many updates as possible.
I clicked on the Partial Upgrade button.  This led to another message:
Broken packages
Your system contains broken packages that couldn’t be fixed with this software.  Please fix them first using synaptic or apt-get before proceeding.
I went into System > Administration > Synaptic Package Manager.  It said this:
You have 7 broken packages on your system!
Use the “Broken” filter to locate them.
In Synaptic, I went to Edit > Fix Broken Packages.  This said:
An error occurred.
The following details are provided:
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages
E: Unable to correct dependencies
I clicked Reload.  Synaptic was not able to download package information.  I canceled that.  I got a new message:
Could not download all repository indexes.
The repository may no longer be available or could not be contacted because of network problems.
I closed that.  Synaptic’s status bar said, “30190 packages listed, 1277 installed, 0 broken, 135 to install/upgrade, 7 to remove; 51.6 MB will be used.”  That sounded good.  I clicked Apply.  It asked me, “Apply the following changes?”  It had a warning:  “You are about to install software that can’t be authenticated!”  If it had been one or two items, I might have thought twice, but it was dozens of packages, some of which (e.g., seed) even had community documentation.  So I disregarded that warning.  Again, Synaptic tried to download package files and couldn’t, and it wouldn’t go any further until that was done.  So at this point I hibernated the Ubuntu installation and used the laptop solely in Vista mode until I could work through the ethernet problem or go to a wireless location again to continue.

When I did get back to this situation, I tried a number of solutions but ultimately was not able to recover from the interrupted upgrade process.  I therefore started over:  I used an Acronis True Image backup to restore Ubuntu 9.10 and then tried the upgrade again from there.

Ubuntu 10.04: Broken Packages - Unable to Correct Dependencies

I was trying to finish an installation of Ubuntu 10.04 (Lucid Lynx). It got interrupted partway through. When I tried to finish it, I got error messages. At the point where I decided to start blogging the situation, I had just tried the advice to enter these commands:

apt-get clean
apt-get autoclean
apt-get update
apt-get upgrade
apt-get dist-upgrade
(These required "sudo" before each command or "sudo -i" by itself first.)  The first three went OK, but after "apt-get upgrade," I got this:

You might want to run `apt-get -f install' to correct these.
The following packages have unmet dependencies:
  gnome-power-manager: Depends: devicekit-power (>= 011) but it is not installable
  indicator-session: Depends: devicekit-power but it is not installable
  initramfs-tools: Breaks: mountall (< 2.0~) but 1.0 is installed
  mountall: PreDepends: libc6 (< 2.11) but 2.11.1-0ubuntu7 is installed
  ubuntu-desktop: Depends: usplash but it is not installed
  usplash-theme-ubuntu: Depends: usplash (>= 0.5.30) but it is not installed
E: Unmet dependencies. Try using -f.
Running "apt-get -f install" generated a similar message, ending with these two lines:
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies
Just before this, I had run into an error, "Could not resolve 'us.archive.ubuntu.com,'" to which one suggested solution was just to wait for a certain software repository to sort out a problem with its server.  In the present case, however, I had been having these dependency errors for weeks, each time I had booted up Ubuntu on this particular computer and had attempted to update it.  So I did not think the problem was with the repository in my case.

I ran a different search and got a new set of suggestions.  In at least one case, the suggestion to uninstall and reinstall the Gnome and KDE desktops did not seem to have solved the problem.  I tried the approach of going through the list of problem packages (quoted above) and attacking them one by one.  The error for initramfs-tools (above) looked simple enough:  I went into Synaptic, clicked on Edit > Fix Broken Packages, right-clicked on initramfs-tools, and marked it for reinstallation.  But when I clicked "Apply," it said, "Could not apply changes!  Fix broken packages first."  I tried again, this time selecting "Mark for removal."  It said it would have to "mark additional required changes."  I said OK.  It marked dozens of other packages, including some that Synaptic labeled as "(ESSENTIAL)."  I clicked Apply.  It said, "Essential packages will be removed.  This may render your system unusable!"  I cancelled that.  I tried marking a different package -- usplash-theme-ubuntu -- for reinstallation.  Again, it showed me a list of dozens of other packages that would be removed; and again, when I tried to go ahead with that, I got an indication that I was trying to remove essential packages.  I tried the suggestion to type "dpkg --purge (package name)," beginning with initramfs-tools.  I had to quit Symantec to make that go.  But it still just listed a dozen programs that depended on initramfs-tools.  I figured that trying to remove those would quickly lead to the same long list as before.

It seemed that the option, mentioned by many, of just reinstalling Ubuntu might turn out to be the fastest (if not the only) option left.  Facing that possibility, I went back and proceeded through the option of uninstalling initramfs-tools in Synaptic, including the essential packages.  This generated a new list of problems.

I had to call it quits for the time being.  I got back to this situation a few days later.  To see where things stood now, I went back into Symantec.  It said I had seven broken packages.  I marked the first on the list, gnome-power-manager, for updating, and clicked Apply.  It said this:
An error occurred
The following details are provided:
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/f/fontconfig/fontconfig-config_2.8.0-2ubuntu1_all.deb
Undetermined error [IP: 91.189.92.166 80]
[It gave me a number of other error messages similar to this one.]
That made it look like us.archive was still definitely dysfunctional.  I killed Synaptic and went into System > Administration > Software Sources > Other Software.  I checked all of those us.archive.ubuntu.com/ubuntu/ sources and clicked Remove.  Then I clicked Close > Reload.  Not surprisingly, I got this:
Could not download all repository indexes
The repository may no longer be available . . . .
I closed that.  Now I got another message:
An error occurred
The following details are provided:
E: The package fontconfig-config needs to be reinstalled, but I can't find an archive for it.
I closed that too.  Software Sources closed.  I tried restarting Synaptic, but that last error message ("An error occurred") recurred.  I retried the sequence suggested at the start of this post:commands:

sudo -i
apt-get clean
apt-get autoclean
apt-get update
apt-get upgrade
apt-get dist-upgrade
The "apt-get update" line gave me a bunch of error messages along the lines of "Ign http://security.ubuntu.com/ lucid-security" and then another bunch along the lines of "W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/lucid-security" errors, and closed with this:
E: Some index files failed to download, they have been ignored, or old one used instead.
I repeated the apt-get update command, but got the same thing.  I went ahead with "apt-get upgrade," but got this:  "E: The package fontconfig-config needs to be reinstalled, but I can't find an archive for it."  So Synaptic wouldn't start.  I tried "dpkg --purge fontconfig-config."  It said "dependency problems prevent removal of fontconfig-config."  Those problems were that "libfontconfig1 depends on fontconfig-config" and "fontconfig depends on fontconfig-config." I tried dpkg with libfontconfig1, but that gave me a list of about a hundred dependencies.

I had seen several other threads in which a complete reinstall seemed to be the only solution.  I had now reached that point myself.

Monday, May 10, 2010

Tweaking Ubuntu 10.04

I had upgraded from Ubuntu 9.10 to Ubuntu 10.04 (Lucid Lynx).  Now I wanted to make some adjustments.  For this purpose, I would be drawing upon the first and second lists of adjustments I had made when I had installed 9.10.

The first of those other things was to install a PAE-enabled 10.04 kernel, so that I would have access to all of my system's RAM.  I also found that VMware Workstation 7.0 was requiring me to enter my serial number.  I had not entered it after installing it on 9.10; I had just been using the trial serial number.  Now, unfortunately, Workstation was not cooperating:  it was saying "Unknown error entering serial number."  The solution to this problem was to run Workstation as root (i.e., type "sudo vmware" at the Terminal prompt) and enter the serial number there.

Since I was doing an upgrade of a previous installation, I did not have to reinstall packages, but I did have a problem with Software Sources.  I have described that one in a separate post.  (Even if I had needed to reinstall packages, the "installed-software" trick described in the lists of adjustments (above) would have made short work of it.)  On my laptop, I was doing the same upgrade, and there I made some problems for myself when I had to interrupt the upgrade.  Here on the desktop, the next task was (as described in separate posts) to try to get the printing and scanning features of my Brother MFC-7340 printer working from within Ubuntu.  After doing that, I tackled a problem that I had wanted to solve for years:  how to import the list of AutoCorrect entries that I had created in Microsoft Word into OpenOffice.org Writer, running on Ubuntu.  That took some time, but then I was able to get back to the project of working through those notes from previous installations.

The upgrade from Ubuntu 9.10 to 10.04 had preserved much of the configuration I had already set up.  So as I worked through the Ubuntu tweaking steps described in one of my previous posts, I had to deal with only a fraction of the issues addressed there.  One was to prevent icons for mounted drives from appearing on the desktop.  That called for Terminal:  “gconf-editor” > /apps/nautilus/desktop > unclick volumes_visible.  But it was already unclicked, and yet I did have icons for mounted drives visible on the desktop.  I went into Applications > System Tools > Ubuntu Tweak > Desktop Icon Settings and clicked Show desktop icons and left everything else unchecked, but this made no difference.  I tried again, this time using “sudo gconf-editor.”  Ah, yes.  The volumes_visible box was checked for root.  Unchecking it removed the icons from the desktop.

I had not noticed, but somewhere along the line, I had evidently installed nautilus-open-terminal via Synaptic, or possibly it came installed by default.  As its name suggested, this tool added a right-click (context menu) option in Nautilus, "Open in Terminal."  Unlike Windows Explorer, this option was only available for folders in the file listing in Nautilus -- in the right pane, that is, not in the left pane that would typically show the folder tree.  In that left pane, this and other options were absent.

Had another little problem.  During the upgrade to 10.04, the Firefox icon changed, on the left-side (formerly top) panel, to a red do-not-enter or not-allowed kind of icon; and in Applications > Internet, it changed to a grey question-mark box.  I fixed this by going to the panel, right-clicking on Applications > Edit Menus > Internet > Firefox > Properties, clicking on the icon, and selecting /usr/share/pixmaps/firefox.png.  Speaking of Firefox, I wanted Ubuntu to open Firefox and Google Chrome on startup.  I wanted to add these to a script that would run at startup, since I suspected that I would be coming up with other things that I wanted to have happen at startup too.  It seemed pretty technical – beyond my current ability, anyway – but it looked like I might be able to just write a script and put it into /etc./init.d.  I typed “sudo gedit” and then created a file called /etc./init.d/a_startup_script.sh.  I put, into it, the line that I got from e.g., right-clicking on Applications and choosing Edit Menus > Applications > Internet > Firefox > Properties:  “firefox %u.”  I saved it and typed “chmod +x /etc./init.d/a_startup_script.sh.”  Then I rebooted.  This achieved nothing.  So creating a general-purpose startup script remained a goal for the future.

I also went down Gizmo’s Freeware list of tweaks.  I had already done most of the ones I wanted, but there were a few others.  One was to install Windows TrueType fonts in Ubuntu.  I decided to extend their advice somewhat.  I took a look at System > Preferences > Appearance > Fonts.  I could see that a lot of Windows fonts were not present on the list there.  So in Windows XP, I went to C:\Windows\Fonts.  I selected and copied everything to another, temporary folder called UbuFonts.  In UbuFonts, I sorted by file type and deleted the ones that were not TTF files.  Back in Ubuntu, I typed “sudo nautilus” and went to /usr/share/fonts/truetype.  It already had a folder called msttcorefonts, but with only a fraction of the fonts that I had just copied from C:\Windows\Fonts to UbuFonts, and the font files there seemed older and smaller.  I made a backup copy of the msttcorefonts folder and then copied everything from UbuFonts into /usr/share/fonts/truetype/msttcorefonts.  Now System > Preferences > Appearance > Fonts had a much wider selection.  I changed the fonts to Tahoma 10 and the monospace to Courier 10.  Tahoma allowed me to see more information on each line onscreen.

Another tweak from Gizmo called for some playing around with Compiz.  This was a bad idea, as described in a separate post.  Another tweak of interest was to clean up the GRUB boot menu.  I typed “uname -r” and saw that I was using the 2.6.32-22-generic-pae kernel.  In Synaptic, I searched for linux-image, clicked at the top of the left-hand column to sort by those that were installed, and marked for removal all numbered items other than that kernel.  In this case, that included just two items:  linux-image-2.6.31-21-generic-pae and linux-image-2.6.32-22.generic (i.e., not pae).  I did another search for linux-headers and marked all non-2.6.32-22-generic-pae items there too.  In this case, trying to remove linux-headers-2.6.32-22 threatened to remove linux-headers-2.6.32-22-generic-pae as well; but I wanted to keep that, so I didn’t remove linux-headers-2.6.32-22.  On restart, I saw that GRUB now listed just the 2.6.32-22-generic-pae kernel and its recovery mode, along with memtest and Windows XP (it was a dual-boot machine).  I went back into Ubuntu without a problem.  I did later have a VMware problem that might have been related to this, though.

Gizmo also pointed me toward a number of recommended freeware apps.  These were for the KDE (not GNOME) desktop.  I thought it might be time to try KDE, if only to check out these programs.  One was the Wally wallpaper changer, which I installed through Synaptic.  Getting Wally (and the whole KDE desktop) involved a total of 91 files.  Other interesting pieces of Gizmo-recommended software I got through Synaptic:  gtk-recordMyDesktop and Dolphin file manager.  Downloaded directly from creators’ websites, I got WinkFreeFile Sync, and Parted Magic.  I did consider using Dropbox as well, because of its good reviews (by e.g., PC MagazineOnline Backup ToolsLaptop, and alternativeTo; but I decided that Windows Live Sync had important advantages even though I would have to run it in a virtual machine when I was booted into Ubuntu.

(Note:  a few days later -- possibly the first time I tried it after installing KDE -- Google Desktop search was no longer responding to its default Ctrl-Ctrl hotkey.  That is, its Quick Search Box was not coming up.  Something I saw on some webpage, as I was trying to fix that problem, made me wonder whether the KDE installation was to blame.  A tip that fixed it was to open the Google Desktop Search preferences and change the hotkey to Ctrl-F1.)

The last thing to do, in this round of tweaking, was to clean out unnecessary stuff from the drive on which I had installed Ubuntu, so that I could make a backup image in case I needed to reinstall – so that I could just restore the image, that is, instead of having to go back through all these steps.  This, I thought, called for something like the TreeSize utility that I had used in Windows to see where I might have files or folders taking up huge amounts of space.  Among what seemed to be several possibilities, I found an actual Linux version of TreeSize, so I downloaded that – but I also discovered Ubuntu’s Applications > Accessories > Disk Usage Analyzer, whose Treemap Chart was especially interesting.  These revealed that my Ubuntu installation was not presently very large, so I didn’t have to worry too much about shrinking it for this particular image.  It also revealed that by far the largest space hog, within that installation, was the Google Desktop index of stuff on my hard drive, at 5.2GB.  I did see that the Google Chrome cache was also taking 400MB.  I went into Chrome’s Settings (the wrench icon at the upper-right corner) > Options but didn’t see any way to control that, other than to just clear the cache.  I decided to leave it for now, and changed some other settings while I was there.  And that was it.  Ubuntu 10.04 was tweaked, at least for now.

Tuesday, December 29, 2009

Full Disk in Ubuntu 9.04

I was using Ubuntu 9.04 (Jaunty Jackalope). I started getting error messages indicating that my Linux program partition (mounted as / ) was full. For example: "Error while copying to 'tmp'. There is not enough space on the destination." This surprised me, because when I went to Gparted (Ubuntu > System > Administration > Partition Editor, installed via System > Administration > Synaptic Package Manager), I saw that the Linux root partition was 107GB, of which 102GB was used and only 5GB free.

Andre Mangan advised typing "sudo find / -type f -size +100000k" in Terminal to see what large files I had (with the option of changing the 100000 value). I added a zero, so I was looking for files of roughly 1GB and larger in size. This searched everywhere, including on my mounted data partitions (in /media and/or /mnt), so probably I should have unmounted those before searching: it included .avi (video) and other large but known files. It didn't seem to turn up any unexpected large files, though.

I posted a question on this. Meanwhile, I was noticing all kinds of errors resulting from this problem. Once I closed Gparted, I was not able to start it again: I got an error message, "Failed to run /usr/sbin/gparted as user root. Unable to copy the user's Xauthorization file." I got the same message when attempting to run Synaptic and other programs. I suspected this was also the culprit behind the recent failure of certain rsync (backup) jobs. Whatever was filling space on my drive was still operating; I had had 5MB free just a half-hour earlier.

Drs305's response to my post pointed me to his tutorial on disk space problems. Following the relevant portions of that tutorial, I first unmounted all partitions other than the active root ( / ) partition by typing "sudo umount -a". Then I typed "sudo find / -name '*' -size +1G" and saw that the /media/OFFSITE folder, which was supposed to be a reference to my external OFFSITE hard drive, was instead referring to a folder on the root partition. No wonder I had been having problems with my external backup! I deleted /media/OFFSITE and then typed this:

sudo find / -type d -name '*Trash*' | sudo xargs du -h | sort

This seemed to show me that there were lots of files in the /root trash folder(s), which I probably had never emptied. They appeared to be in /root/.local/share/Trash/files, and maybe elsewhere. To delete root trash, I typed "gksudo nautilus" and, in Nautilus (i.e., File Browser), I made sure to check View > Show Hidden Files. Then, in that session of Nautilus, I navigated to File System /root/.local/share/Trash. I selected the Trash folder and hit Shift-Delete. This said, "Are you sure you want to permanently delete 'Trash'?" I said Delete! with joy. It notified me that it was deleting about 37,000 files. So, duh, this could have been part of the problem. Then I noticed that the faster way to check disk space was, instead of using GParted, to type "df -Th | grep -v "fs".When it was done, I refreshed GParted. Now it showed only 37GB used. Still a lot!  So I thought I should probably pursue some of the other options described in the tutorial.

Before I could do that, though, I ran into a separate problem: my programs drive completely wiped itself out, so I had to restore Ubuntu from a backup.

Tuesday, August 25, 2009

Installing Ubuntu 9.04 (Jaunty Jackalope): Update?

In a previous post, I detailed the steps I took to install and configure 64-bit Ubuntu 9.04 (Jaunty Jackalope). A few months later, I had an opportunity to install 64-bit Jaunty again - this time on a laptop. I used that previous post as an installation guide. This post refines and summarizes the steps detailed in that previous post.

First, in Ubuntu, choose these options: System > Administration > Update Manager > Check. (This one would ideally be postponed until you've done a couple of these other steps, but it may insist upon being run early in the process, in which case you may want to repeat it later.) Install updates. Restart if advised, and then run Check again, until there's nothing left to update. Applications > Add/Remove > Show All Available Applications. Then search for "restricted extras." Check the box next to "Ubuntu restricted extras." Click Apply Changes > Apply. System > Administration > Hardware Drivers. I was using an nVidia graphics card, and here I saw that my system was not using nVidia drivers, and that I did have a couple options to choose from. I chose to activate the recommended driver. I had to reboot before it would take effect.

System > Administration > Software Sources. Go to the Ubuntu Software tab > Download From > Other > Select Best Server > Choose Server. Also, go to the Third-Party Software tab, click Add, and type (or copy and paste) these lines, one at a time, from Launchpad's X-updates webpage into the "APT line" box:

deb http://ppa.launchpad.net/ubuntu-x-swat/x-updates/ubuntu jaunty main

deb-src http://ppa.launchpad.net/ubuntu-x-swat/x-updates/ubuntu jaunty main

(Each of those is a one-line command.) I had to click "Add Source" after each one in order to be able to install the next one. I also checked the boxes next to the two archive.canonical.com sources on that Third-Party Software tab. Then click Close. This called for a Reload of current software information. Before doing the reload, open Terminal and type these two lines:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys [OpenPGP key id]

sudo apt-get update

The OpenPGP key id came from the same (in this case, Launchpad's) webpage. What appeared on that webpage was "Signing key: 1024R/AF1CDFA9." The part that I needed to paste into the "sudo apt-key adv" command (above) was the part after the slash, i.e., AF1CDFA9. (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.)

Remove Partition Icons from Desktop. A mere tweak, but it's easy. Alt-F2 > gconf-editor > Run > apps/nautilus/desktop. Unclick volumes_visible. Close the Configuration Editor. System > Administration > Synaptic Package Manager. Search for each of these items and mark for installation when it comes up: boinc-manager; cups-pdf; fdutils (if you expect to be using a floppy drive); flashplugin-installer; gparted; ntfs-config; ntfsprogs; p7zip-full; pysdm; sun-java6-jre; and sysinfo. Also, optionally, uninstall evolution. (If numerous items come up in response to your search, click on the Package heading to sort them alphabetically. If some are already installed, no worries. Some of these may ask if you want to "Mark additional required changes?" Click "Mark" and go on to the next one.) Then click Apply > Apply. Then run System > Administration > Update Manager once more.

Optionally, move and/or reconfigure panels (i.e., the bars running across the top and bottom of the screen) and/or items on panels. Example: to make the bottom right-hand corner of the screen more similar to that of Windows, right-click on the left edge of the segment of the top panel that containts the date and time, unlock, move, and relock.

At this point, in a problem that had not come up during my previous installations of Ubuntu 9.04, I was not able to get the system to recognize my external USB hard drive. I have detailed the process of fixing that in a separate post. That problem ultimately involved wiping my hard drive and starting over with a new Vista-Ubuntu dual-boot installation.

Sunday, July 19, 2009

Recognizing Partitions Automatically in Ubuntu 9.04

In Ubuntu 9.04 (Jaunty Jackalope), disk partitions normally remain unmounted until you mount them manually. One way to do this is to start Ubuntu's File Browser (also known as Nautilus). You can do this by choosing the Places > Computer menu option. In File Browser, just double-click on the drive you want to mount, and its name will appear under the File System > Media folder there in File Browser. You can also mount drives by typing commands into Ubuntu's command-line window (Applications > Accessories > Terminal). First, type "sudo mkdir /media/[drivename]" to create a mount point. After doing this for all unrecognized drives, type "sudo mount -a".
But instead of doing this sort of thing, I wanted the system to recognize my drives on bootup, so that I would not have to mount them manually each time I rebooted. In my first approach to this problem, I typed "sudo ntfs-config." This approach worked OK on one computer, where I was doing a clean installation -- where, that is, I had formatted the partition before installing 9.04 on it. But on another computer, I installed 9.04 on top of 8.04 without formatting the partition. This was advantageous in that it preserved lots of files and settings from before. The drawback was that I was running into funky problems with ntfs-config.
On this system, I got an error message when I ran ntfs-config. The message was, literally, "Error : An error occured when trying to configure [partition name], please retry. Thanks." (For those who are searching with the correct spelling, let me retype that error message: "Error: An error occurred when trying to configure . . . ." When I tried to examine the partition in GParted (i.e., System > Administration > Partition Editor (see above)), I got this: "Warning: Unable to read the contents of this file system!" The partition had been available a minute earlier, when I had booted into Windows XP, and I had shut down WinXP normally before rebooting into Ubuntu. So I didn't think the partition was truly hosed.
I found a very, very long thread on the subject, but post no. 2015 in that thread said the thread's advice was outdated for purposes of newer versions of Ubuntu. In another thread, someone said they got this error message after installing a newer version without formatting the partition, and solved it by deleting the mount points. I had a fresh backup of the partition in question, so I tried taking that approach. First, I opened File Browser and went to File System > Media > CURRENT. File Browser said that partition was empty. When I right-clicked on it, however, File Browser didn't give me an option of deleting it. Its Properties said it was owned by root, so I logged in as root (see above), typed "cd /media", typed "dir" to make sure CURRENT was there, typed "dir CURRENT" to make sure it was empty, and then typed "rm -r CURRENT" to delete it. I restarted the system, started File Browser, went to Computer (in the Tools bar), double-clicked on CURRENT, and it was there, with all its contents. CURRENT was formatted in ext3 (i.e., Linux). I had another partition that was having the same problem. It was formatted in NTFS (i.e., Windows). But now that I had rebooted, it too was available and looking fine.
I dropped this issue for the time being. Next day, when I rebooted, I found that, predictably, the various partitions were not mounted. In Terminal, I typed "sudo gedit /etc/fstab." My fstab file did not show the partitions I wanted to be mounted automatically. I reviewed one of my old posts on ntfs-3g. It seemed to say that ntfs-config was the solution. I tried running ntfs-config again. This time, it ran. It recognized two NTFS partitions. Now I just had two ext3 partitions to set up for automatic mounting. I went back into fstab and saw the lines that ntfs-config had added. I hadn't thought to save the fstab file from my previous installation; it would have been handy to copy over the relevant lines. From the previous post, I gathered that the trick was to write something like this in fstab:
/dev/sda3 /media/VMS ext3 defaults 0 0
for the VMS partition, and likewise for the other ext3 partition. I double-checked that I had the right device addresses by checking them in System > Administration > Partition Editor (i.e., GParted). I rebooted, but the ext3 partitions were still not automounted, though the NTFS partitions continued to be automounted nicely. I didn't know why the line just shown, for the VMS ext3 partition, did not work in fstab now; according to the old post, it had worked in Ubuntu 8.04. Ubuntu documentation said something about pysdm, so I looked into that. They suggested typing this into Terminal:
sudo apt-get install pysdm
but I saw it was available in Synaptic (i.e., Ubuntu's System > Administration > Synaptic Package Manager menu pick), so I used that instead to install pysdm. I typed "pysdm" at the Terminal prompt, but got an error message indicating that I had to have root privileges, so I tried again with "sudo pysdm." (Also available via System > Administration > Storage Device Manager.) That gave me a Storage Device Manager (SDM) window that listed some, but not all, of my partitions. I noticed that, if I started pysdm while I still had the foregoing /dev/sda3 line for my VMS partition in my fstab file, SDM would not give me an option of configuring the VMS partition; but if I deleted that line from fstab and then started pysdm and clicked on sda3, SDM would give me a "Configure now?" dialog with the message, "/dev/sda3 hasn't been configured. Do you want to configure it now?" I said OK. I told it to set the mount point to File System > Media > VMS. Then I clicked on the Assistant button and saw that the option was checked that said "The file system is mounted at boot time." I also checked the option that said, "Check file system at mount time" on the options dialog's Mounting tab. I didn't change any other options. When I checked OK to leave Assistant, I saw an error message in Terminal: "wrong fs type, bad option, bad superblock on /dev/sda3, missing codepage or helper program, or other error." I went back into Assistant and removed the "Check file system" option I had just checked. This time, when I left Assistant, I got Warning messages that said, "Unknown option: rw" and "nouser is not suitable for user" and "Unknown option: async." I clicked on the "Set defaults" button in SDM and then clicked Apply. This produced no additional Warning messages in Terminal. Trying once more, I just went into Assistant and immediately executed, and this did produce the same Warning messages, plus an additional one that said, "Unknown option: defaults." I tried just emptying out the Options box altogether in SDM. Then I clicked Apply. I did the same with the other ext3 partition that was not yet mounting automatically. I restarted the system.
It occurred to me that I may not have restarted the system previously, but may merely have logged out and logged back in. Ubuntu 9.04 seemed to require two steps to reboot, and it seemed that I had forgotten to take that second step last time around. This occurred to me right around the time when I tried to restart the system and found that it froze with a black screen. Evidently my fstab file was not presently in an acceptable form. I punched the computer's reset button and rebooted with the Ubuntu installation CD, chose the "Try Ubuntu" option, and edited fstab as above. (Note that there's an fstab on the CD too; make sure you're editing the one on the hard drive.) I saw that I had failed to add the preferred mountpoint for one of my ext3 partitions: it said "/media/sdc5" instead of "/media/CURRENT." I fixed that and rebooted without the CD. This time, the system booted OK. But those two ext3 partitions were still not automounted.
In File System > media (i.e., /media), I noticed that there was a mount point for the VMS partition, but it had nothing in it. I typed "dir" to make sure there was nothing there, and then typed "sudo rm -r VMS" to delete it. I also deleted the "sc5" mountpoint mentioned above. In File Browser, I clicked on the Computer button at the top and then double-clicked on each of these two partitions (i.e., VMS and CURRENT) to create mountpoints (i.e., /media folders) for them. I tried rebooting again. They still weren't automounting, and the mount points I had created for them were gone, as I should have expected. Incidentally, at this point I discovered that the custom was apparently to mount fixed hard drives at /mnt, and use /media for removable hard drives.
About this time, I discovered that I had commented out the lines added by SDM (i.e., I put # signs (also called hash marks) in front of each of those lines). I forgot. I had done that to troubleshoot fstab, and then didn't go that route after all, and forgot to remove them. So I removed the hash marks now and rebooted. But that wasn't the solution. I re-ran SDM, went through more or less the steps described above, and rebooted. This time, it worked: the partitions were automounted, and their contents were visible. Not sure exactly what was different this time, but something was. So I guess the conclusion is, if it doesn't work in SDM the first time, tinker around for a while, reboot a couple of times, try SDM again, and reboot.