Upgrading SusE 8.2 to 9.0 with apt

Thanx to Horst <horst.graffy_A_T_wiesbaden.netsurf.de> for the following hint. It may save you quite some time:

"You could manage the "broken" dependency for rpm(lib(PartialHardlinkSets) = 4.0.4-1 with an very easy trick: add to your apt.conf the following lines:

Fake-Provides {
   "rpmlib(PartialHardlinkSets) 4.0.4-1"
}

in the RPM { .. } section. This entry fakes apt, that the required rpm version is installed. With this little trick, you have only to fidlle out wich versions are "older" in SuSE 9.0 (e.g curl, xine, ...). and modify the preference file with PIN statements fpr the actual versions.

After upgrading, you can remove the FAKE-Entry and you're done."

==========================================================

This is how it worked for me, which does not mean it will work for you.

There were steps I did it wrong, and had to repair. I describe below just how I proceeded. If you know a better way, please share with us all.

Details on apt and on (my) upgrade from 8.1->8.2 can be found on the links at the top of the page.

Preparation

Adjust /etc/apt/[security.list, sources.list, apt.conf] files. Here are the mines:

# cat /etc/apt/security.list
#
# cat /etc/apt/sources.list
# The list can be found at: http://linix01.gwdg.de/apt4rpm
rpm      ftp://ftp.gwdg.de/pub/linux/suse/apt SuSE/9.0-i386 base update security kde
 gnome2 xfree86 mozilla suser-rbos usr-local-bin suser-kpietrz suser-tcousin suser-ollakka
 funktronics packman packman-i686 wine suse-projects
 
# Uncomment if you want to use SuSE's patch rpms.
# rpm ftp://ftp.gwdg.de/pub/linux/suse/apt SuSE/9.0-i386 update-prpm security-prpm

# Uncomment if you want to install (probably) highly experimental stuff
# rpm ftp://ftp.gwdg.de/pub/linux/suse/apt SuSE/9.0-i386 suse-people mantel-kernel
# 
# cat /etc/apt/apt.conf
// with "apt-config dump" all settings can be viewed

Acquire::CDROM::Copy "true";

Debug
{
    pkgRPMPM "false";
}

RPM
{
   // Hold (do not update) a list with pkgs:
   // Hold { "k_deflt"; "sane"; };
   // Leave list empty to disable
   //   Hold {"k_deflt"; };
    Hold { };
   //    Ignore {"gpg-pubkey"; };
   
   Options { };
   Install-Options "";
   Erase-Options "";
   Source {
          Build-Command "rpmbuild --rebuild";
   };
   
   // Run a post configure script, like SuSEconfig?
   PostConfigureScript true;
}

Dir {
   // If you want to run postscripts, check out:
   // http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/apt4rpm/apt4rpm/client
   //
   // Bin {
   //   rpm "/usr/bin/aptrpm"
   // }
}

SystemConfig
{
  // BootMgr /sbin/lilo;
  KernelPkg k_deflt,k_smp,kernel;
  ConfigureScript /sbin/SuSEconfig;
}

#

Then synchronise local apt database with the server, and simulate distribution upgrade:

# apt-get update
# apt-get -s dist-upgrade

Copy packages in all the sections except for "will be REPLACED" into a text editor on one line (press Ctrl key when selecting in the console) and test the install:

# apt-rpm --test install <all the packages on one line>

First analysis

After analysing the diagnosis of apt, the (almost) magic combination is obtained as follows:

  1. Delete from the list due to "Already the newest version and/or obsoleted by another package" the following packages: (MPlayer MPlayer-skins bind9-utils bonobo-conf cocoon cyrus-sasl2 eel2 gimp jakarta-ant kde2-compat kdeutils3-printing kdiff3 krusader librsvg2 medusa mysqlnavigator python rpmfind susewm-kcmyast themus yast2-printerdb)
  2. Add to the list: (cyrus-sasl gal2 gtkhtml2)
  3. Add to the list for removal (note "-" suffix): (gal2-0- gtkhtml3.0- gtkhtml-1.1- gtkhtml-)
  4. "Downgrade", since old (SuSE 8.2) versions wrongly interpreted as the newest: (curl=7.10.5-42 libgphoto2=2.1.2-40)

The result is (I've added the stuff in braces at 4 entries, to refer to them later on):

......
The following packages have unmet dependencies:
 e2fsprogs: PreDepends: rpmlib(PartialHardlinkSets) (<=4.0.4-1) but it is not installable
 glibc-locale: PreDepends: rpmlib(PartialHardlinkSets) (<=4.0.4-1) but it is not installable
 gzip: PreDepends: rpmlib(PartialHardlinkSets) (<= 4.0.4-1)but it is not installable
 jfsutils: PreDepends: rpmlib(PartialHardlinkSets) (<=4.0.4-1) but it is not installable
 k_deflt: PreDepends: rpmlib(PartialHardlinkSets) (<= 4.0.4-1) but it is not installable
 man: PreDepends: rpmlib(PartialHardlinkSets) (<= 4.0.4-1) but it is not installable
 openldap2-client: PreDepends: rpmlib(PartialHardlinkSets) (<= 4.0.4-1) but it is not installable [-]
 pam: PreDepends: rpmlib(PartialHardlinkSets) (<= 4.0.4-1) but it is not installable
 perl: PreDepends: rpmlib(PartialHardlinkSets) (<= 4.0.4-1) but it is not installable  [2]
 ps: PreDepends: rpmlib(PartialHardlinkSets) (<= 4.0.4-1) but it is not installable
 reiserfs: PreDepends: rpmlib(PartialHardlinkSets) (<= 4.0.4-1) but it is not installable
 shadow: PreDepends: rpmlib(PartialHardlinkSets) (<= 4.0.4-1) but it is not installable  [-]
 timezone: PreDepends: rpmlib(PartialHardlinkSets) (<= 4.0.4-1) but it is not installable
 wine: PreDepends: rpmlib(PartialHardlinkSets) (<= 4.0.4-1) but it is not installable
 yp-tools: PreDepends: rpmlib(PartialHardlinkSets) (<= 4.0.4-1) but it is not installable [-]

From this moment, apt is (temporarily) useless, since it can't do anything if there are broken dependencies.

Two ways to proceed

A) Here I decide to first install the new rpm (and apt), which are essential tools for upgrade. My concern is that the rpm4 and rpm3 database formats are different, and the people on the web do not suggest to do the upgrade from rpm3 to rpm4 on SuSE 8.2. I, however, prefer having those essential tools in place (if I'm lucky enough), and afterwards I'm pretty confident to be able to resolve broken dependencies.

B) An alternative way to go would be to use rpm -Uhv on these 15 packages and to see what the rpm -Uhv --force --nodeps gives. If somebody tries this way, please share your good / bad experience with me.

Choosing A: First install rpm4 (and corresponding apt)

I first found all the dependencies of apt and rpm with apt-cache depends <package>, and then dependencies of their dependencies, and so on. The list I get has non-problematic packages, and the problematic ones. In the output above, I marked the problematic packages with braces.

I simply install those that cause no problem, as it hurts nobody and most of them are dependencies for both rpm and apt:

# apt-rpm install libgcc ncurses readline libstdc++ libstdc++-devel zlib insserv bash
 glibc bzip2 suse-build-key fillup coreutils gdbm

There are 7 packages that cause problems: [popt db rpm | perl | lua apt apt-libs]. The first three are the dependencies for all too many packages, perl simply has a broken dependency on rpm 4 (see above [2]), and the last three are for apt. Since I've downloaded all of these packages while trying out apt-rpm, I first uninstall apt, then upgrade the other 4 packages to get rpm4 installed, and install apt back once when rpm4 is ok:

# rpm -e --nodeps apt apt-libs lua
#
# rpm -Uhv --nodeps popt_1.7-76_i586.rpm db_4.1.25-76_i586.rpm rpm_4.1.1-77_i586.rpm perl-5.8.1-51.i586.rpm
....
converting rpm-3 database to rpm-4 format...
....

To try whether rpm works:

# rpm -q rpm
rpm-3.0.6-478
rpm-4.1.1-77

Oooooops - I see a problem here (is this a bug in the rpm db3->db4 converting procedure???), but fortunately:

# rpm --version
RPM version 4.1.1

which means it's the new one that runs, so I just continue with installing apt. After doing that, I compare the newly installed apt configuration files with my originals, and decide to keep the mine (which apt installation saved as .rpmsave):

# rpm -Uhv apt_0.5.5cnc6-rb6_i586.rpm apt-libs_0.5.5cnc6-rb6_i586.rpm lua-5.0-rb3.i586.rpm
# mv /etc/apt/sources.list.rpmsave /etc/apt/sources.list
# mv /etc/apt/security.list.rpmsave /etc/apt/security.list
# mv /etc/apt/apt.conf.rpmsave /etc/apt/apt.conf

Now I synchronise the apt db (apt update), and it shows of course that there are two versions of rpm. Before continuing, I must congratulate the authors of apt for providing the simple "apt" command that hides apt-get, apt-cache, apt-rpm, etc. By the way, I was first panicked when apt-rpm returned: "bash: apt-rpm: command not found"! But then came to my mind the anouncement of "new" apt shell which facilitates the usage for different apt-xxx :-)

I try to install further. I download (by hand, at ftp://ftp.gwdg.de/pub/linux/suse/apt/SuSE/9.0-i386/RPMS.base) the latest rpms for the above 15 packages to /etc/apt/cache/archives. I first install those that have no dependencies broken (wine needs iwidgets):

# rpm -Uhv e2fsprogs-1.34-34.i586.rpm glibc-locale-2.3.2-92.i586.rpm gzip-1.3.5-51.i586.rpm
 jfsutils-1.1.2-77.i586.rpm k_deflt-2.4.21-144.i586.rpm man-2.4.1-90.i586.rpm
 pam-0.77-129.i586.rpm ps-2003.9.20-6.i586.rpm reiserfs-3.6.9-37.i586.rpm
 timezone-2.3.2-92.i586.rpm wine-20030813-76.i586.rpm iwidgets-4.0.1-135.noarch.rpm
# mk_initrd
# SuSEconfig

Here were some error messages of mk_initrd, whose meaning I discovered later on. You might consider to add already at this point aaa_base=9.0-7.

You will from this moment on notice the beauty of apt, which is much less verbose than the rpm itself :-)

By checking the versions of the other 4 packages, and of my currently installed ones, I find out that the latest perl has not been installed - no idea why (is this the reason for the 2 versions of rpm?). Anyway, I install it again and check this time that this is a good one:

# rpm -Uhv --nodeps perl-5.8.1-51.i586.rpm

The other 3 packages that are left are dependencies for too many other packages, and I don't want to force install if I don't have to. So I leave out those 3 packages (openldap2-client-2.1.22-73.i586.rpm shadow-4.0.3-191.i586.rpm yp-tools-2.8-100.i586.rpm) and think of what to do next, since at this point apt doesn't help a lot - the reason is that apt cannot proceed if you don't have a clean (read: no broken packages) rpm database. This also means that I can't (have apt) automatically download anything.

Solving conflicts with rpm

Therefore, I proceed in several iterations to resolve the broken packages (those of SuSE 8.2) which I ignored before in order to have rpm4 and its dependencies installed. The price to pay is:

Where apt helps is to list all the broken dependencies with apt check. That is my starting point and after a few hours, the solved dependencies are, in short, this (sorry, they are not in alphabetical order):

[MPlayer abiword apache bonobo bonobo-activation bug-buddy2 control-center2 eel eog2 evolution file-roller gconf gconf-editor gconf2 gdm2 gedit2 gnome-applets2 gnome-desktop gnome-games2 gnome-media2 gnome-panel gnome-session gnome-terminal gnome-utils2 gnome-vfs gnome-vfs2 gphoto gst-player gstreamer gstreamer-plugins gthumb gtkhtml heimdal-lib iproute2 kdebase3-SuSE libbonobo libbonoboui libdv libgnome libgnomeui librsvg2 libsmbclient logrotate metacity metacity-setup nautilus-media nautilus2 nautilus2-gtkhtml oaf openssh orbit2 postfix rhythmbox sodipodi sound-juicer synaptic themus xemacs yast2-core yast2-ncurses yast2-packagemanager yast2-qt yelp openssl libexif ImageMagick ImageMagick-Magick++ ImageMagick-devel newpg gpgme openssh-askpass saxtools sax2 yast2 3ddiag MyODBC-libiodbc perl-Msql-Mysql-modules MyODBC-unixODBC libgcrypt pinentry dirmngr libksba openct opensc gnome-filesystem gstreamer-plugins-default cryptplug hotplugctl hwinfo xemacs-packages libxcrypt libjasper perl-PDA-Pilot cups-client foomatic-filters mysql-shared postgresql-libs pptp cups-libs enchant libgda libgnomedb libgsf gucharmap libwmf gnome-pilot pilot-link desktop-data-SuSE libsoup libsmbclient autofs4 yast2-transfer wget openldap2-client kdebase3 curl mutt linc xchat shadow smpppd python cups-drivers-stp tcpdump w3m fetchmail kdelibs3 ghostscript-x11 libgnomeprint htmldoc sitecopy pine kinternet cups yast2-printer libgphoto2 kdegraphics3-kamera pixieplus apache mm]

And in long, you have to use the full rpm names! The reason for --force and --nodeps here are a few SuSE 8.2 packages that I remove immediately afterwards. If it were possible to use apt here, I could have added the packages to remove with "-" suffix, and there would be no need for forcing options, but I have no idea how to do that with rpm. I also run SuSEconfig immediately after:

# rpm -Uhv --force --nodeps gnome-session-2.2.2-102.i586.rpm ...
[OUTPUT]
16:shadow       warning: /usr/sbin/useradd.local created as /usr/sbin/useradd.local.rpmnew
19:postfix warning: /etc/postfix/main.cf created as /etc/postfix/main.cf.rpmnew
Updating etc/sysconfig/postfix...
Updating etc/sysconfig/mail...
Updating postfix configuration files
backing up etc/postfix/main.cf to etc/postfix/main.cf.2003-11-26
backing up etc/postfix/master.cf to etc/postfix/master.cf.2003-11-26
executing etc/postfix/post-install upgrade-package
SAFETY: editing main.cf, setting unknown_local_recipient_reject_code=450.
See the RELEASE_NOTES and LOCAL_RECIPIENT_README files for details.
post-install modified etc/postfix/main.cf, updating MD5SUM
47:python         ########################################### [ 34%]
error: unpacking of archive failed on file /usr/lib/python: cpio: rename failed - Is a directory
...........
# 
# SuSEconfig
...........
Directory /etc/gtk-2.0 should be empty, please fix!
Directory /etc/opt/gnome2 should be empty, please fix!
Directory /etc/pango should be empty, please fix!
Directory /opt/gnome2 should be empty, please fix!
Directory /usr/include/gtk-xmhtml should be empty, please fix!
Directory /usr/lib/gtk-2.0 should be empty, please fix!
Directory /usr/lib/pango should be empty, please fix!
Directory /usr/share/gnome should be empty, please fix!
Directory /var/opt/gnome2 should be empty, please fix!

From what I was writing (or rather pasting) as diagnosis through the iterations above, I deduce that (cyrus-sasl,gtkhtml2,bind-utils,gal2,gimp2,apache-ant) packages replace (cyrus-sasl2,gtkhtml3.0,bind9-utils,gal2-0,gimp,jakarta-ant) packages, respectively, and some more packages that I can safely remove:

# rpm -e gtkhtml ulb-gnome cyrus-sasl2 kde2-compat gtkhtml3.0 bind9-utils gal2-0 gimp mysqlnavigator
rpm2html rpmfind gtkhtml-1.1 jakarta-ant
# SuSEconfig

Now I come back to apt:

# apt update
# apt check
The following packages have unmet dependencies:
 python: Depends: libcrypto.so.0.9.6 but it is not installable
Depends: libssl.so.0.9.6 but it is not installable
 rpm#3.0.6-478: Depends: libpopt.so.0 but it is not installable

I still have 2 problems:

  1. In the previous run, python failed to upgrade due to some cpio problem. I find at http://qa.mandrakesoft.com/show_bug.cgi?id=5095 that for this kind of cpio error, I should remove the old version (python), remove the problematic directory (/usr/lib/python), and then do the install, which works :-)
    # rpm -e --nodeps python
    # rm /usr/lib/python
    # rpm -ihv python-2.3-49.i586.rpm
    

    So, this is solved.

  2. I have still rpm#3.0.6-478 shown by rpm as an uninstalled package:
    # rpm -e -test remove rpm#3.0.6-478
    error: package rpm#3.0.6-478 is not installed
    

    Here I pretended I knew what I was doing, since I beleive in apt, and it got it right!

    # apt-get -f install
    Reading Package Lists... Done
    Building Dependency Tree... Done
    Correcting dependencies... Done
    The following packages will be REMOVED:
     rpm#3.0.6-478
    WARNING: The following essential packages will be removed
    This should NOT be done unless you know exactly what you are doing!
     rpm#3.0.6-478 (due to apt)
    0 packages upgraded, 0 newly installed, 1 removed and 477 not upgraded.
    Executing RPM (-e)...
    # rpm -q rpm
    rpm-4.1.1-7
    

    So, this is solved as well.

Doing the upgrade with apt

Now this looks better:

# apt --test dist-upgrade
The following packages will be upgraded

 CheckHardware DirectFB FlightGear OpenOffice_org OpenOffice_org-en ...

The following packages will be REPLACED:
 XFree86-GLX (by XFree86-Mesa) abiword2 (by abiword)  bonobo-activation (by libbonobo)
 gstreamer-plugins-default (by gstreamer-plugins) inf2htm (by info2html) mesaglu (by
 XFree86-Mesa) mesasoft (by XFree86-Mesa) susetour_en (by susetour-en) themus (by
 control-center2) xlock (by xlockmore)
The following NEW packages will be installed:
 XFree86-Mesa abiword acpid avifile bitstream-vera ethtool gtksourceview info2html
 ldapcpplib libid3tag linux-atm-lib mdbtools mjpegtools myspell-american openmotif-libs
 perl-XML-Parser scsi susetour-cz susetour-en xdg-menu xemacs-packages-info xlockmore
 xpmroot yast2-ldap yast2-mail-aliases
475 packages upgraded, 25 newly installed, 10 replaced, 0 removed and 0 not upgraded.
Need to get 602MB/634MB of archives.
After unpacking 7250kB of additional disk space will be used.

Now I copy the packages from all the sections except for "will be REPLACED" on one line (press Ctrl and drag the mouse in the terminal window) into a separate file. I add two more packages:

  1. (apache-ant) It couldn't be installed before because of python, and,
  2. (aaa_base=9.0-7) Important: You must downgrade aaa_base to 9.0-7 (since SuSE 8.2 version is 2003.xxxx!), which goes with SuSE 9.0 and which will add also a (new) mkinitrd package (I suffered quite a bit until I discovered that).
# apt --test install CheckHardware DirectFB ... apache-ant aaa_base=9.0-7
....
Need to get 607MB/641MB of archives.
Executing RPM (-Uvh)...
warning: /var/cache/apt/archives/glib2_2.2.3-35_i586.rpm: V3 DSA signature: NOKEY, key ID 9c800aca
warning: /var/cache/apt/archives/wine_20031118-0_i586.rpm: V3 DSA signature: NOKEY, key ID 4009eaed
warning: /var/cache/apt/archives/k3b_0.10.2-0.pm.1_i586.rpm: V3 DSA signature: NOKEY, key ID cd3140cd
Preparing...
########################################### [100%]
file /etc/fonts/local.conf from install of fontconfig-2.2.1-29 conflicts with file from package
 ttf-bitstream-vera-1.10-SuSE.ulb.1
file /etc/inetd.conf from install of inetd-2.0-190 conflicts with file from package netcfg-2003.3.11-1

The two conflicts are related to configuration files. I guess that's the new packages (with default/fresh config files) that conflict with the packages I already have installed on my machine. Lets check:

# rpm -q fontconfig ttf-bitstream-vera
fontconfig-2.1-3
ttf-bitstream-vera-1.10-SuSE.ulb.1
# rpm -q inetd netcfg
inetd-2.0-84
netcfg-2003.3.11-1

I just make a backup of my existing config files, to be sure to have a working thing just in case something goes wrong:

# cp /etc/fonts/local.conf /etc/inetd.conf ~/

And now, I run the real install, with the force option. In the output, I keep only the significant lines where I'll have to do something after the installation has been completed:

# apt --force-rpm-install install CheckHardware ... apache-ant aaa_base=9.0-7
....
#
# SuSEconfig
...
Directory /etc/opt/gnome2 should be empty, please fix!
Directory /opt/gnome2 should be empty, please fix!
Directory /usr/lib/gtk-2.0 should be empty, please fix!
Directory /var/opt/gnome2 should be empty, please fix!
...
Executing /sbin/conf.d/SuSEconfig.hsflinmodem...
/sbin/conf.d/SuSEconfig.hsflinmodem: line 15: /sbin/hsfconfig: No such file or directory
#

The 4 gnome2 directories should be removed by the system itself within a week (I've got a mail from the installation), otherwise I should remove them - their current counterparts are simply */gnome. The hsflin modem will be fixed after I reboot (since I'm still logged in within SuSE 8.2 session).

And I cross fingers and reboot... and everything works perfect!

Summary

  1. Don't forget to install aaa_base=9.0-7!
  2. Remove existing python (rpm -e python), remove its directory (rm /usr/lib/python), and install python=2.3-49
  3. New packages (cyrus-sasl gtkhtml2 bind-utils gal2 gimp2 apache-ant) replace old (cyrus-sasl2 gtkhtml3.0 bind9-utils gal2-0 gimp jakarta-ant)
  4. Safe to remove packages: (cyrus-sasl2 gtkhtml3.0 bind9-utils gal2-0 gimp jakarta-ant gtkhtml ulb-gnome kde2-compat mysqlnavigator rpm2html rpmfind gtkhtml-1.1)
  5. Have fun!