Humble Trader

Saturday, January 07, 2006

Get Latest Packages

Introduction:

Looked at one way, the OS is simply a collection of packages which are under constant development. Here, we get the very latest.

Be warned, though, this can take a loooong time. I did this once and it took close to 36 hours!

This, then, is really optional. I describe how to get all available packages but you may want none of them or only a select few.

Normally, you would run 'yum -y update' and go for a few beers while everything gets installed. However, is potentially a problem with this - if there are any broken dependencies the download will just stop. The solution to this is to run '`yum list updates | some filtering`' in a loop. If a package has broken dependencies, the loop will just go on to the next package. This, however, introduces a performance issue; the list of updates that are process may well contain packages down the list which have already been installed by a dependency in an earlier package. The script then wastes time figuring out that it doesn't need to do something.

These scripts include an edit step which aims to get rid of these potential redundancies.

Aim:

Download any packages that have changed recently.

Requirements:

FC4 is installed and connected to the internet.

Procedure:

  • Log in as root.
  • Open Terminal.
  • Run this script:
#!/bin/sh

echo "" > pack

for i in `yum list updates | cut -f1 -d" " | grep -A 500 -e Updated | grep -v -e
Updated`
do
echo "$i" >> pack
done

  • This creates the file 'pack'. Edit this file:
    • Find any lines that look like language packs (e.g. openoffice.org-langpack-es.i386) and delete them. These will probably be installed with the master package (in this case; openoffice.org-core.i386).
    • Delete any lines that look like sub-packages. e.g. In the case where these are listed;
      • openldap.i386
      • openldap-clients.i386
      • openldap-devel.i386
      • openldap-servers.i386
      • openldap-servers-sql.i386
    • ...delete the last four.
    • Save the file and exit.
  • Now run this script to install the remaining list of packages in 'pack':
#!/bin/sh

for i in `cat pack`
do
echo "Updating $i"
yum -y update $i
done

  • Re-run the first script to pick up any remaining uninstalled packages, then re-run the second script to install them.
Testing:
  • If you run 'yum -y update' in Terminal, it should find nothing to do. It may attempt to install a package that has broken dependencies and fail. That's OK. You can always try for it later.

0 Comments:

Post a Comment

<< Home