Showing posts with label repositories. Show all posts
Showing posts with label repositories. Show all posts

Saturday, October 30, 2010

Ubuntu 10.10: Tweaked Installation

I had previously installed Ubuntu 10.04, and had arrived at a fast way of adjusting the basic installation to my needs. This post updates and simplifies the separate post in which I described that process.  Here, I was using Ubuntu 10.10, not 10.04.

This post begins with a basic Ubuntu setup already installed.  That basic installation process was very straightforward; but for those unfamiliar with Ubuntu, there were many webpages on how to install Ubuntu 10.10.  The question addressed in this post was, what additional steps did I need to take, in order to make Ubuntu look and act the way I wanted?  Of course, people will have various preferences.  This post does not go into that kind of individual detail.  It is more a matter of how to go about choosing and preserving one's desired setup.

In this case, I had installed Ubuntu 10.10 in a two-drive RAID0 setup.  I have written a separate post on that as well.  It looked and acted the same as a normal single-drive Ubuntu installation.  But the following discussion contains a few references to the setup described in that other post, for those who have come to this description from there.

The Home Partition

If I had been installing Ubuntu without using RAID, I probably would have decided, in the initial installation, to install everything in a single root ("/") partition.  But the RAID process had required the creation of a separate /boot partition, so I now had those two partitions instead of one.  Either way, though, my installation did not yet include a separate /home partition.  I did want a separate /home partition to be part of the mix, because /home was where all kinds of program settings were preserved.

I had retained a copy of my previous /home partition.  It was on a third hard drive.  That is, it was not part of the RAID array, and I did not plan to copy it into the RAID array.  RAID 0 is risky, in the sense that failure of any drive in the array means the end of the entire array and everything on it.  So I was just going to leave the /home partition on that separate drive, and back it up from there.  The question was, how should I get the new installation to recognize that separate /home partition?  I had struggled with this step previously, but now I wanted to write it up in simpler form.

On that third drive, I had a folder called Saved Settings.  In that folder, I had kept a copy of my old fstab (that is, the file called "fstab," from the /etc folder, viewable by typing "sudo gedit /etc/fstab").  I added lines from that copy into my current fstab, making sure that its lines referred to UUIDs (available via "sudo blkid") rather than to drive letters (e.g., sda, sdb), so that the commands in the fstab would still function if I rearranged partitions in my computer.  I also made sure it had a line referring to the correct UUID for the /home partition.  I saved and closed fstab.

To give /home a place to be mounted, I typed "sudo mkdir /media/home."  To prevent the newly installed (and nearly empty) /home partition from interfering with the selection and use of my preferred, preexisting /home partition, I typed "sudo mv /home /old_home."  I had meanwhile allowed Update Manager to install updates, and that process was done, so at this point I rebooted.  I got an error message, "Could not update ICEauthority file /home/ray/.ICEauthority."  I clicked through that, and after a moment my old, preferred desktop layout was there and seemed to be functioning normally.  (I worked through the ICEauthority problem as described in a separate post.  Basically, the solution was to make sure the user (i.e., ray, not root) had ownership of the home folder.)  The last step was to delete the temporary old_home folder I had created by typing "sudo rm -r /old_home."

Repositories

Having the home folder in place meant that about 90% of the work of installing and configuring programs was already done and saved.  This was one huge advantage over Windows XP installations, where the only programs that did not have to be reinstalled in the event of a new operating system installation were portable applications.  This section describes the relatively few steps that I did have to take to install applications and configure my Ubuntu system, as compared to the writeup in a separate post on Windows XP reinstallation.

I could not rely on my previously saved sources.list file to set up my repositories, since I was now dealing with a new version of Ubuntu.  Instead, I went into System > Administration and discovered that, unlike Ubuntu 10.04 (as discussed in a separate post), Ubuntu 10.10 no longer had a Software Sources option.  A search revealed that this change was made to make Ubuntu more user-friendly.  I could either edit the menu to add back the Software Sources option or use System > Administration > Synaptic Package Manager as an alternative.  Choosing the latter, I went into Synaptic's Settings > Repositories > Other Software and selected the non-source options.  In the Authentication tab, I saw a list of Trusted Software Providers, and the names on it were Ubuntu (archive, CD image, and extras), GetDeb, and Google.  I had no problem with any of these except maybe Ubuntu extras.  I wasn't sure if these had come from my previous installation or were pre-supplied with Ubuntu 10.10.  I could have hit "Restore Defaults" to find out, but then I would have had to figure out how to restore them.  I closed out of that and, back in Synaptic, clicked Reload.

In Terminal, I typed "sudo gedit /etc/apt/sources.list."  I saw that it contained a handful of repositories.  I wondered if there were others I should include, so I went to the Ubuntu Sources List Generator and got a list that was more concise and that also included a few third-party repos of interest (i.e., GetDeb, Google, Medibuntu, Wine, and X Updates).  I ran the commands in the "Getting the GPG Keys" list from the bottom of the page, one at a time.  In previous installations, I had saved such commands in a text file and had executed it, but that had made it easier to overlook error messages.  In this case, the Medibuntu command gave me "Unable to locate package medibuntu-keyring."  A search indicated that virtually nobody had gotten precisely that message.  Not a good sign.  A community documentation page gave me a different command to add Medibuntu:

sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list && sudo apt-get --quiet update && sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring && sudo apt-get --quiet update
... all on one line!  It also said that Medibuntu's repository is deactivated whenever you upgrade to a newer Ubuntu release, so this reinstallation would have to happen each time.  I copied and pasted that command and ran it.  It gave me an error message:
Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
to which the answer was yes, of course, Synaptic is still running.  I shut down Synaptic and tried again.  This time, it ran.  I took another look at the Authentication tab in Synaptic (see above), and now Medibuntu was on the list of trusted software providers.  So the answer to my question was, this was my customized list.

I went back to the process of running commands generated by the Ubuntu Sources List Generator.  They ran without further difficulty.  I typed "sudo gedit /etc/apt/sources.list" again, and replaced its contents with the lines generated by that Generator.  I took another look at Synaptic's Authentication tab, and this produced an error indicating that I had duplicate entries for Medibuntu and, I think, something else.  But when I tried to figure out what that was about, the error went away, and I didn't seem to be able to get it back.  Anyway, the Authentication tab did show that I now had the five third-party repos that had interested me (above), so all that remained was to go into System > Administration > Update Manager > Check and download the additional updates that it detected.

Installing Programs & Other Adjustments

In Terminal, I navigated to my Saved Settings folder (basically, cd "/folder name/" -- using quotes because "folder name" has a space in it) and verified that I had a copy of the installed-software file that I had created, in my previous installation, by typing "dpkg --get-selections > installed-software."  Now that I wanted to restore the programs listed in installed-software, I entered these commands:
sudo dpkg --set-selections < installed-software
sudo apt-get install dselect
sudo dselect
That opened up dselect.  The dpkg command had provided the list of what I wanted to install, so all I had to do now, in dselect, was to arrow down and hit Enter at the Install option.  This gave me an option of installing a large quantity of stuff, and I said OK, do it.  That took an hour.  At the end, I declined to let it erase previously downloaded .deb files, when it asked.  The last time I used this installed-software approach, I got a bunch of errors after reboot, and had to work back through the process manually.  There were some errors this time, too (see below), but they did not appear to be related to the dselect process.

As before, I navigated to the folders containing other program downloads (with .deb, .gz, .bin, and .bundle extensions).  I typed "sudo sh [filename]" to install my .bin and .bundle downloads (e.g., GoogleEarthLinux.bin).  Double-clicking on the filename in Nautilus no longer installed my .deb downloads; instead, I had to right-click and choose "Open with GDebi Package Installer."  In the case of my Synology software, I typed "sudo sh install.sh."  I wasn't sure where to install it, so I told it to install in /home, just in case that would spare me from having to install it again.  But I should have said /home/ray.  When I was done with all installations, I went into Update Manager, and ran and reran it until I was all caught up.

GRUB2 menu edits were the same as before:  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 also needed to make some adjustments for VMware.  First, I typed "sudo vmware" and made some root adjustments there.  As before, I typed "sudo gedit [path][filename].vmx," for the .vmx file pertaining to this VM; and at the end of that file I added a line that said this:
bios.bootDelay = "10000"
and that bought me ten seconds instead of one or two, when that vmware logo came up.  In a variation from Ubuntu 10.04, the restricted drivers for my monitor were now at System > Administration > Additional Drivers.

Bugs and Other Problems

There were some problems.  First, BOINC would not suspend itself when the system was in use, so I just suspended it, period.  Also, as discussed in a separate post, there were some Firefox errors.  The solution there was to completely uninstall and reinstall Firefox, though possibly it would have been sufficient just to uninstall firefox-gnome-support and delete my profile.

Another problem was that Ubuntu was not clearly recognizing all local and network partitions.  The problem of mapping the drive in my Synology NAS required another separate post.  In that case, it came down to a problem with the line used to mount the drive in fstab.  It had seemed like there were other drive recognition problems, but evidently they sorted themselves out, or perhaps I was just mistaken.  At this point, the drives seemed to be recognized in good form.

There was also the problem that GParted wouldn't run.  It wasn't just in my installation; it wasn't running when I booted from the live CD either.  I guessed that this was some kind of brand-new bug in Ubuntu 10.10 that would be fixed shortly.  When I started GParted from System > Administration, it would start up, but then it would disappear after just a few seconds.  When I typed "sudo gparted" or "gksu gparted," it did the same thing, but it gave me an error message:
glibmm-ERROR **:
unhandled exception (type std::exception) in signal handler:
what: basicI_string::_S_create
aborting...
A search indicated that this was indeed a bug in Ubuntu.  It looked like a new release would be fixing the problem imminently.  Another problem:  Google Earth would not install.  I got this error message:
parser error : Document is empty
parser error: Start tag expected, '<' not found
Couldn't load 'setup.data/setup.xml'
The command I used was "sudo sh GoogleEarthLinux.bin."  The first response to it was "Verifying archive integrity... All good."  Just in case, I downloaded a replacement of GoogleEarthLinux.bin, but got the same result.  It looked like others had also had this problem.  It seemed to be another instance of Ubuntu 10.10 not yet having all the kinks worked out.  I started with a lengthy thread on the issue.  One post in that thread recommended a command-line alternative, which in full form went like this:
sudo apt-get install googleearth-package
sudo make-googleearth-package --force
sudo dpkg -i googleearth_5.2.1.1588+0.5.7-1_i386.deb
I tried that.  The make-googleearth-package command generated a lot of errors that included the sentence, "Can't extract name and version from library name."  I got that long package name shown in the last line (googleearth_5.2.1 etc.) from one of the last lines produced by the make-googleearth-package command:  it said this was the name of the package it was building.  (It also seemed to say that simply "googleearth" was the name of the package, but that didn't work.)  The third command (sudo dpkg etc.) seemed to run successfully.  There was also now a Google Earth icon in Applications > Internet > Google Earth.  I clicked on that, and it worked.

Another problem involved VMCI Sockets.  I have addressed that one in a separate post.  I ran out of time to continue this project at the time.  When I returned to it two months later, I had decided to stop trying to maintain a primarily Ubuntu machine, but instead to return to Windows 7 for the foreseeable future.

Wednesday, September 8, 2010

Ubuntu 10.04: Repositories

In the process of reinstalling Ubuntu 10.04, it came time to install my software sources (i.e., repositories).  To start off, I visited my most recent post on that.  It told a tale of difficulty in getting my list of "repos" to work, and referred me to one of my earlier posts.

I decided to start by simply copying the finalized list of repos that I had developed and posted in that earlier note.  This replaced my existing /etc/apt/sources.list.  I wasn't sure if I needed to reboot, but having done all those updates and such, I decided it couldn't hurt.  On reboot, I went into System > Administration > Software Sources to see what we had.  There were some items on the list that had to do with individual programs.  I found another such list that was even longer.  I wasn't sure why I needed repositories for individual programs; I was under the impression that repositories were places where you could get a variety of programs.  So rather than add to the list (and increase the number of repositories that might report problems later on, as I had experienced previously), I pared down the list.  My final list, preserved in a backup copy of /etc/apt/sources.list, was as follows:

http://archive.canonical.com/ubuntu lucid partner
http://archive.canonical.com/ubuntu lucid partner (Source Code)
http://archive.getdeb.net/ubuntu lucid-getdeb apps
http://packages.medibuntu.org/ lucid free non-free
http://ppa.launchpad.net/tualatrix/ubuntu lucid main
http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu lucid main
http://ppa.launchpad.net/ubuntu-x-swat/x-updates/ubuntu lucid main

I clicked Close.  It gave me a chance to Reload, which I took.  It said this:

Could not download all repository indexes
The repository may no longer be available or could not be contacted because of network problems ...
I closed out of that and typed "sudo gedit /etc/apt/sources.list."  Sources.list still had some lines for repositories that I had deleted, so I deleted those surplus lines.  It also had commands I should run in connection with the rest, so I copied those lines into a separate file in gedit, saved it as RunForRepositories, made it executable ("sudo chmod +x RunForRepositories"), saved a copy for future use, and then ran it ("sh RunForRepositories).  I went back into Software Sources, changed one thing, closed, reloaded, and got the "Could not download all repository indexes" error again.  At this point, I rediscovered that you could add repositories via System > Administration > Synaptic Package Manager.  In Synaptic, I went to Settings > Repositories.  But this turned out to be the same thing as the Software Sources tool.  In Software Sources > Other Software, I unclicked and then reclicked an item to trigger the Close > Reload option.  Once again, I got the "Could not download all repository indexes" error.  The first item on the list was the Medibuntu repository, with this message:  "The following signatures could not be verified because the public key is not available."  Following advice, I closed out of that, went into Synaptic, searched for medibuntu-keyring, and applied that.  In Synaptic, I went again into Settings > Repositories and retriggered the Reload.  But it didn't work -- no Reload option -- so I did it via System > Administration > Software Sources.  This time the Medibuntu error was gone, and the first error in the list had to do with the Ubuntu CD.  I decided I didn't want the Ubuntu CD to be a source, so in Software Sources I unchecked the CD on the Ubuntu Software tab, and then retriggered the Reload option again.  No more errors.

For some reason, /etc/apt/sources.list did not show some of these changes.  Maybe I had it open in a separate window while I ws going through my paces.  So I edited it manually to reflect my current preference and resaved a copy on a separate partition.  Now that this was done, I ran System > Administration > Update Manager and installed the new updates they had for me there.  I clicked Check to repeat that step.  It said my system was up-to-date.  I concluded that the repository step was done.

Sunday, July 11, 2010

Ubuntu 10.04: Problems with Update Manager and Software Sources

As described elsewhere, I was in the process of upgrading from Ubuntu 9.10 to 10.04 (Lucid Lynx).  I went into System > Administration > Update Manager.  At first, the system reported that I was up to date, as it often would do even when the system was terribly out of date.  I clicked Check and wound up with a message indicating that there was a problem with a repository.  I looked into System > Administration > Software Sources > Other Software.  The error message didn't make sense in light of what I saw there.  I tried Update Manager again.  This time it worked:  it was ready to install a bunch of updates for 9.10.  I skipped that and instead told it to upgrade the system to 10.04.  It did.

I ran Update Manager again, just to be sure.  Now I got the repository error message mentioned above.  It said this:

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/lucid/Release.gpg.  Could not resolve 'us.archive.ubuntu.com'
There were a bunch of other, similar messages after that one, referring to other "Failed to fetch" problems.  I closed Update Manager and went into Software Sources, to see what this was about.  The sources listed there did not make sense, given that System > About Ubuntu reported that I was indeed running 10.04.  I checked them all -- the 9.10 CDROM, two "Unsupported updates" entries, and the http://archive.canonical.com/update karmic entries.  I went through the other tabs in Software Sources, while I was there, and made a few other changes, and then closed out.  It checked for updates and again gave me an error:
Could not download all repository indexes
The repository may no longer be available or could not be contacted because of network problems . . . .
followed by similar "Failed to fetch" messages, e.g., "Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/lucid/main/i18n/Translate-en_US.bz2 Connection failed."  Before attacking that, I decided to take care of the next of my previous posts on the whole upgrade and tweaking process.  This post had to do with installing a PAE kernel to take advantage of all of my RAM.  This was just a matter of searching for PAE in Synaptic and selecting and installing linux-generic-pae and linux-headers-generic-pae.  But that process failed with, again, some "Failed to fetch" messages.  This time, though, the messages said something about "Got a single header line over 360 chars" and "Bad header line."

So, OK, I was going to have to fix this repository problem before going any further.  I ran a search and came up with Salamane Moustapha's To-Do List After Installing Ubuntu 9.10.  The first thing on his list was to expand the software repository list.  That was actually the very next thing in my own sequence of previous posts, so I went to that one.  It called for installing Ubuntu Tweak, which I had already downloaded, and then running it from Applications > System Tools.  I went down the list in Ubuntu Tweak, making various adjustments.  When I got to the Source Center option, there were no sources listed.  This was no surprise; I had removed all those old ones from Software Sources, and now there was nothing left.  I moved on to the next Ubuntu Tweak item, Source Editor, and here I saw a number of repositories listed.  These seemed to be the ones actually active on my system at this point, as represented by the Ubuntu Software tab in Software Sources.  So far, in other words, Ubuntu Tweak was not solving all of my problems.  The only other things I changed in Ubuntu Tweak at this point were under Default Folder Locations, Manage Scripts, and Nautilus Settings.

Moustapha's To-Do List gave me a large set of repositories.  I was going to follow his instructions and just replace my sources.list with his.  His list was for Ubuntu 9.10, so I figured I would wind up deleting or modifying some from his list.  Then I rediscovered the Ubuntu Sources List Generator, and used that instead.  I didn't select any source code items, and in the Third Parties list I only chose GetDeb, Google Linux Software Repositories, MediaInfo, Medibuntu, Themes, Wine, and X Updates.  There were lots of other interesting programs there, but I thought it might be simpler to just install them via Synaptic as I needed them.  I clicked "Generate List."  Then, in Terminal, I typed "sudo gedit /etc/apt/sources.list."  I deleted its contents and copied their generated list over into it.  I saved and closed that and then copied and pasted, into Terminal, their supplied list of commands to get keys.  The first one, for GetDeb, produced an error:  "gpg: no valid OpenPGP data found."  The solution there was to execute the command with "sudo" in front; so I typed "sudo -i" to eliminate further recurrences of that problem in this session.  The next command provided by the Ubuntu Sources List Generator was "sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F9D8BC54."  This one produced these errors:
gpgkeys: HTTP fetch error 7:  couldn't connect to host
gpg: no valid OpenPGP data found.
A search for that specific key number (F9D8BC54) turned up nothing.  I skipped that command for the moment and went on to the next.  This one was for Medibuntu.  It gave me five error messages.  One was for medibuntu itself, and it went like this:
W: GPG error: http://packages.medibuntu.org/ lucid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 2EBC26B60C5A2783
The other four were of the same form, but they referred to http://ppa.launchpad.net/ and their public keys were 61260473F9D8BC54 (see above), 6E871C4A881574DE, 5A9A06AEF9CB8DB0, and 3B22AB97AF1CDFA9.  These four (but not the Medibuntu one) repeated again at the end of the installation.  Despite these errors, I ran the next command.  This one referred to key 881574DE, which seeems to have been one of the several just listed.  It seemed that maybe the Ubuntu Sources List Generator had gotten things out of order -- that perhaps I should have run this key request first.  But no, it gave me the same error messages as above, regarding HTTP fetch error 7 and no valid OpenPGP data.  Same thing for the final two commands supplied by the Ubuntu Sources List Generator, regarding keys F9CB8DB0 and AF1CDFA9.  Searches for these led to the suggestion to use this command (inserting, here, the full numbers from above):
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 2EBC26B60C5A2783 61260473F9D8BC54 6E871C4A881574DE 5A9A06AEF9CB8DB0 3B22AB97AF1CDFA9
But this still gave me the "HTTP fetch error 7."  A post from Oscar said that, in his case, the desired repository had been installed nonetheless.  In Software Sources > Authentication tab, I saw that I had keys for GetDeb, Google, and Medibuntu, from those that I had requested, along with Ubuntu Archive, Ubuntu CD Image, and Launchpad PPA, which came first in the list and which, I guessed, had been there before I made this request.  So the Authentication tab was not telling me that the others had been installed.  But Software Sources > Other Software did list them all, so in that sense I did seem to have added them successfully.  I posted a question on this and let the matter sit.  I went back to Update Manager, and this time it ran OK.  I ran it again, but unfortunately this time I got "the public key is not available" error messages for those same items again.  So I had not solved that problem.  I did not proceed further with this effort.  Instead, this and other problems prompted me to reinstall Ubuntu 10.04 from scratch.