Celebrazio Net



Contact Us

Timely Maintenance of your Gentoo Linux Computer

November, 2005

Gentoo provides a lot of great help and documentation online. This is an attempt to add to that and help keep a little sanity here as I go through a maintenance period every few months. I don't do regular maintenance on the system, with emerge sync and emerge world all the time. I prefer to upgrade once and be done with it -- until I make time to do the next one.


Objectives of the maintenance

  • Upgrade from 2005.0 to 2005.1 profile
  • Upgrade kernel
  • Upgrade to newer KDE version
  • Migrate to KDE split ebuilds
  • Tweak USE settings a little
  • Emerge everything with the new toolchain, kernel, and USE config.

Preparation

First, upgrading only once in a while, as opposed to a more frequent basis, requires that we re-think the settings and configurations in use.

 user@system% cat /etc/portage/package.mask
 user@system% cat /etc/portage/package.keywords
 user@system% emerge -pv world 
 user@system% emerge --info 
 user@system% equery --help

The first 2 lines here are to read and check over the masked packages or any other special keywords settings. If these were set up for a reason a few months ago, maybe that reason has since disappeared. Check out the Gentoo Portage handy site to learn whether a package at the version level you want is stable (x86) or not (~x86) now. And check dependencies and reverse dependencies if you want. Equery is also useful to learn about the packages. Emerging with --info gives the USE settings, among other things.

In the third line above, we are mainly trying to check whether there are any blocking issues. If you get blocking issues now, then you'll need to resolve them before trying to emerge world. Search the forums for your specific blocking issue. There are various possibilities for fixing the issue: sometimes just unmerge something you don't want, other times use a package.mask or package.keywords
Package.mask might look like this:

>sys-devel/gcc-3.4.3.20050110-r2
>sys-apps/groff-1.19.1-r2

It is a good time now, before any time has been spent, to verify that USE settings are as wanted. If you are upgrading PHP or Apache, maybe the USE settings have changed. Here is one way to keep your USE values tidy after modification: quickly re-organize them alphabetically, then just paste back to the file /etc/make.conf.

user@system% cat /etc/make.conf | grep "USE=" | grep -v "^#" | awk '{ for (
i = (NF -1); i >= 2; i-- )  print $i}' | sort | xargs echo

Profile Upgrade 2005.0 to 2005.1

First Reference: Gentoo Documentation, Upgrading
According to this guide, it's pretty easy to change profiles (at the time of writing, it was being changed from 2005.0 to 2005.1). So it can be done like this, first changing the symbolic link:

 user@system% rm /etc/make.profile
 user@system% ln -s ../usr/portage/profiles/default-linux/x86/2005.1  /etc/make.profile
[follow the guide and change the values in the 2nd line to fit your gentoo]
[next it is a good time to] 
 user@system% emerge sync

There is no 'emerge sync' again until the very end, so try to do this step at the beginning of your maintenance window. Try to do this sync as close to the following build steps as possible -- to ensure freshness. Next, check on any blocking issues that you found above. If you still have any blocking issues at 'emerge -puav system', they will need to be cleared now.

Toolchain Build

It is good to write all the names to a file, in the order in which they will be emerged. It sometimes happens that your emerge command does not complete through the entire list. It may get snagged on a single package. Normally, you would have to re-issue the whole "emerge system" command -- all the packages. But this way, you won't need to repeat from the start. Just edit your input list and continue where the "emerge" command left off. Here, I captured the package list from 'emerge -puvDN system' and formatted it into this format [=dev-libs/openssl-1.2], one per line. Then, it can be passed in to emerge, so the command is:

 
 user@system% emerge -uvDNp `cat /my/inputfilename`
 user@system% emerge -uvDN  `cat /my/inputfilename`

This is the equivalent of 'emerge -uvDN system' but simplified a bit (for dummies?) In my case, after this point, java-config was failing so I resolved "java-config" by unmerging, then emerging something. I also did "etc-update" as prompted, and did "python-updater" since python was changed. This also meant emerging several more packages to catch the python changes (python-updater took care of these emerges). I threw an "env-update" in there too.

 
 user@system% emerge -p --depclean

I don't like to do this depclean command on its own. I pretend it, then manually unmerge things I don't want. Again, the gentoo-portage.com reference is handy in determining whether I want it, or whether there are any reverse dependencies. Equery is good here too. Next I create a new input file, with the same package names as 'emerge -eaDv system' formatted for emerge. In this maintenance, I am not updating my gcc, but I am updating my glibc and other toolchain items, so I want to emerge the entire system with the new toolchain now. (world will come later). I create the file /my/inputfile2 containing the "emerge -eavp system" package list, formatted for emerge. Then I preview, and execute:

 
 user@system% emerge -eavp `cat /my/inputfile2`
 user@system% emerge -eav  `cat /my/inputfile2`
 user@system% man emerge 

Preparation and World

I had decided to unmerge apache as part of my upgrade to Apache2. And I am also upgrading KDE significantly, so:

 
 user@system% emerge --unmerge apache
 user@system% emerge --unmerge kde

There are several ways to make sure you get all the kde packages that need to be unmerged. Equery, Gentoo forums, and The KDE Config Guide were useful. When unmerging KDE, I did it from within Xfce, another window manager, but you can also safely unmerge KDE from within KDE (I am told). The KDE environment is loaded into memory when you start a session, which is why you can safely unmerge it while it is running. You just won't have a new session until you re-install KDE. I wanted to be sure, so I got out of KDE and worked from Xfce for a couple days. In my case, I had KDE 3.3 (monolithic ebuilds) and got out, completely removed it, made sure it was gone, then proceeded with KDE 3.4.1 (split ebuilds).

 
 user@system% revdep-rebuild -p
 user@system% revdep-rebuild
 user@system% java-config
   [revdep-rebuild made it look like I needed to java-config]

I then ran into an issue with a version of "pine-4.64-r1" and circular dependencies. After researching on gentoo-forums, I emerged with "--nodeps" as a workaround. This was a success.

Next, it's time to create the world file. Doing something like "emerge -puvDN world", I get the list. I use a text editor, and/or awk on the command line to edit it into the accepted format (about like [=dev-libs/openssl-1.2] without the brackets, with one package per line). By now, my world file is smaller because KDE is gone. I can also look over the list. If any part of KDE exists, I first check whether anything is depending on it (equery), and if not, I unmerge it and delete that line from the list. If it has a dependency, I try to resolve first. In the end, I think I actually left one small piece of KDE in, because of a dependency. Here is my emerge world equivalent (passing in list items from a file):

 
 user@system% emerge -uvDNp `cat /my/inputfile3`
 user@system% emerge -uvDN  `cat /my/inputfile3`

 user@system% emerge -p --depclean

I manually pick through the depclean list, and get rid of stuff. My success rate was about 50%: about half the stuff depclean wanted to toss, I was worried so I just left it in. 50% I manually unmerged. In this case, I had a list of about 16 items and got rid of 8.

 
 user@system% revdep-rebuild -p
 user@system% revdep-rebuild

Rebuilding the Kernel

After this revdep-rebuild, it was time for me to rebuild kernel. I needed a couple references:

I also had to make sure I had the correct value in /etc/localtime
and basically followed these guides. Things to remember: copy over your .config file to the new kernel build directory; run 'make oldconfig'; recommended run 'make menuconfig' just to eyeball it; and edit the grub.conf file. I think these instructions are a little later in the Handbook. Remember the grub.conf file. My kernel rebuild failed for a simple reason: I forgot to rebuild NVidia drivers. Just follow directions on the NVidia Guide -- it needs to be done with every new kernel. The iron law of NVidia. There was a "modprove nvidia" in there too.

Next, I have a new kernel and new toolchain and am about to rebuild the world. But not without KDE. So creating the emerge input file again went smoothly. I had 252 packages.

 
 user@system% cp -ip /usr/src/linux-2.6.11-gentoo-r6/.config /usr/src/linux/
  [copies my previous .config -- do not do this with 2.4 kernel config! ] 
 user@system% make oldconfig
 user@system% make menuconfig
  [maybe some things to confirm, tidy up]
 user@system% emerge -eav `cat /my/inputfile4`
  [gives me the new world]

I actually did the KDE packages in a separate command job, with a separate input list. That command succeeded with no hitches. I followed KDE Config Guide and looked at kde-apps.org to get ideas of what to put in. A few forums touched on the subject too.

The following files gave problems and were dropped from the KDE list: kalbum. And these files looked like they came with too much baggage (too many dependencies so I dropped them, but might consider them later): kmail, k3b, kalarm, digikam. And kaboodle, noatun, and knights were dropped because they wanted to install arts.

KDE Split Ebuilds

 
 user@system% emerge -eav `cat /my/inputfile5`
   [ gives me KDE goodies ] 

And finally, I start KDE (it works!), and configure KDE (a few of my themes got blown away).
And when all the above is confirmed, and the system seems stable, I do:

 user@system% emerge sync

Maintenance complete

SysInfo: Linux 2.6.13-gentoo-r5 | Intel(R) Pentium(R) 4 CPU 2.20GHz 2193.191 MHz
Mem: 242 used / 248 total / 6 Free  [|||||||||*]





1998-2024 Celebrazio.net
Serving AI Free since 1998.