Upgrading Linux Systems from etch 32bit to lenny 64bit

Before doing this you must know what you are doing … since this is quite a serious attempt …
starts from many broken packages, a broken system, to a disastrous result not even “ls” will work.

a known successfull method for this :

    etch to lenny

  1. Edit “sources.list” (/etc/apt/) from etch to lenny then execute “apt-get update”
  2. deb http://ftp.debian.net/debian/ (etch => lenny) main non-free contrib
    deb http://ftp.debian.net/debian-security/ (etch => lenny)/updates main non-free contrib

  3. Upgrade etch to lenny latest package by doing “apt-get dist-upgrade”, make sure all package is the latest so the transition goes smooth.
  4. Transition from etch to lenny end here.

    32bit to 64bit kernel

  5. Install the latest 64bit kernel by doing “apt-get install linux-image-2.6.XX-XX-amd64” or what ever it is the newest version, then reboot. Don’t worry compatibilities … since 64bit kernel have the capabilities of running 32bit system without hiccup but not the other way around.
  6. 32bit to 64bit system

  7. Download 32bit compability library from your sources.list :
  8. ia32-libs_1.19_amd64.deb

    and then the 64bit library & packager :


  9. Then install the most crucial on to the system, that is libc6 by doing “dpkg -i –force-architecture –force-depends –force-overwrite libc6-i386_2.7-18_amd64.deb”. Yes … all that force are necessary … When you’re done, /lib/ld-linux.so.2 should be a symlink into /emul/ia32-linux, you need to force it … and then Check that it worked; there should be lots of stuff in /emul/ia32-linux, Example :
  10. $ln -sf /emul/ia32-linux/lib/ld-linux.so.2 /lib/ld-linux.so.2
    lrwxrwxrwx 1 root root 34 Jun 26 08:57 /lib/ld-linux.so.2 -> /emul/ia32-linux/lib/ld-linux.so.2*

    $ ls -l /usr/lib32 /lib32
    lrwxrwxrwx 1 root root 20 Jun 26 08:56 /lib32 -> /emul/ia32-linux/lib/
    lrwxrwxrwx 1 root root 24 Jun 26 08:56 /usr/lib32 -> /emul/ia32-linux/usr/lib/

    Then run “dpkg –force-architecture -i” for all of the other 32-bit compat libs until they’re all installed. Should be a breeze with a little dependencies problem.

  11. Next is to install the real libc6 amd64, by doing “dpkg -i –force-architecture libc6_2.7-18_amd64.deb”. After it done … check wheter you can ls, if then lucky the system is alright …
  12. Then install the apt and dpkg by doing “dpkg -i apt_0.7.21_amd64.deb dpkg_1.15.2_amd64.deb” should be enough, if not install apt-utils and apt-listchanges which will need other package such as phyton-2.4-minimal, phyton-24, phyton-apt, libdb, and libstdc++. After dpkg and apt have been installed, now its time to check the system architecture by doing “dpkg –print-architecture” it should say “amd64” or else something wrong has going on.
  13. Next its time to install vim 64bit and force all broken 64bit package by doing “apt-get install vim vim-runtime vim-common” and “apt-get -f install”. Keep doing “apt-get -f install” until all 64bit package has no errors, download all requirement deb if you have to.
  14. If all the step above is complete then you already have a minimal 64bit system, now all the package have to be converted from 32bit to 64bit, list all 32bit package then convert all of it, by doing :
  15. dpkp –get-selection ‘*’ > dpkg_get_selections.out
    for package in $(grep ‘[^e]install’ dpkg_get_selections.out | awk ‘{ print $1 }’)
    dpkg -s $package | grep -q ‘Architecture: i386’ && echo $package
    done >update.list

    This will create 2 file dpkg_get_selections.out which contain all installed package (including unwanted) and update.list which contain to be converted package. Open up yourself a copy of update.list edit it (so you can fix the many problems that will occur) preferably on other terminal.

    apt-get –reinstall install $(cat update.list | tr ’12’ ‘ ‘)

    Fix broken package name and not found name with and replace the package in update.list:

    apt-cache search ‘package-name
    vi update.list

    Keep editing and running until all of it works.

  16. Wait until all packages have been installed (may take a long time…), all that left is removing unwanted package (you may want to remove necessary package from update2.list first) :
  17. for package in $(dpkg -l | grep ‘^i’ | awk ‘{ print $2 }’)
    dpkg -s $package | grep -q ‘Architecture: i386′ && echo $package
    done >update2.list
    dpkg -r $(cat update2.list | tr ’12’ ‘ ‘)

  18. Viola … here comes a near perfect converted 64bit system …

*thanks to rlpowell from teddyb.org which has done this before the writer.

Leave a Reply

Your email address will not be published. Required fields are marked *