You are not logged in.

#1 2010-03-12 23:24:16

Askr
Member
From: Germany, Leipzig
Registered: 2010-01-17
Posts: 6

Migrating Between Architectures Without Reinstalling

hi
just followed this guide to upgrade my fully working 32-bit archlinux with alles packages.

well, not exactly. method 1, just the way it is written there, won't do the trick alone, it requires some small, but necessary tweaks. I will try to write them down here, and if no errors are found, edit the wiki page respectivly.

the preparation step just worked fine and is self-explanatory. so i here's what I did:

   1. Download, burn and boot the 64-bit Arch ISO LiveCD (or a USB-image like I did) and boot into the root shell
   2. Configure your network on the LiveCD, then pacman to use 64-bit repos ( /etc/pacman.d/mirrolist is configured correctly in the new images to use 64-bit repos, just select a server near you)
   3. Mount your existing installation (aka your / partition) to /mnt directory. For example: mount /dev/sda2 /mnt
   4. If you got a different partition for your /boot (which is standard in the arch-install process if I remember right) make sure your mounted /mnt/boot/ is empty
       If not, rm the files in there. Then mount your /boot partition into /mnt/boot. For example: mount /dev/sda1 /mnt/boot
       Now there should be your old 32-bit kernel images in there, check with ls -l (they can stay there, they will be upgraded during the further process)
   5. Use the following script to update the local pacman database, get a list of all your installed packages and then reinstall them:

#!/bin/bash

MOUNTED_INSTALL='/mnt'
TEMP_FILE='/tmp/packages.list'

pacman --root $MOUNTED_INSTALL -Sy
pacman --root $MOUNTED_INSTALL -Qq > $TEMP_FILE

for PKG in $(cat $TEMP_FILE) ; do
   pacman --root $MOUNTED_INSTALL -S $PKG --noconfirm
done

exit 0

i had to replace -Qqet with -Qq, since -Qqet would only upgrade the explicitly installed packages. But we want to upgrade ALL packages, including core and kernel headers etc.
save this script on your live session and chmod -x it

   6. Read complete step!
       At the first time, i just started the old script with -Qqet and found the first error in the upgrade process (see above)
       So i updated the shell script accordingly with -Qq and ran it again. This time all 32-bit packages were found and pacman beginns to download the new ones and upgrade them.
       Since here, the upgrade is irreversible, so be sure to have alle things in place and to do them right
       (p.e. have enough free space on / since you will download all packages again and have the 32 and 64 bit ones there)
       But the second time i got an error with readline.so (damn you!) so i had to check what was wrong (my guess was that the calling shellscript used a 64bit binary and tried to read some 32-bit files or something like that)

so finally you have to upgrade readline first with: pacman -root /mnt -S readline and then run the shell script for once ( ./script.sh )
this step takes some time, since pacman has to download and upgrade every single package that you installed on your system alphabetically  (except AUR-packages or packages you build from source code from somewhere else)
if you don't see any errors in the update process, everything worked fine
if you see some SH errors with readline, update readline or waith till the script comes to the letter "R" and updates readline on its own, then you have to rerun the script
if you see some pacman errors ... well i had some ^^ i had to rerun the script 2 times till every error was gone, this shouldn't happen if you upgrade readline first and everything else is okay

make sure that mkinitcpio builds new kernel images in your /mnt/boot (it still just says /boot, but that should be okay) during the upgrade process and check the timestamps in your /mnt/boot with ls-l


so what i executed at all was something like

pacman -Syy
pacman -root /mnt -Syy
pacman -root /mnt -S readline
./script.sh

and for the sake of building the kernelimages again i entered this to rebuild them
pacman -root /mnt -S kernel26

7. now you should be ready to reboot into your new 64-bit system



it worked flawlessly for me that way. everything worked just as it was supposed to, even xmonad recompiled itself on the first start into a 64bit binary

comments are welcome smile

Last edited by Askr (2010-03-12 23:27:35)

Offline

Board footer

Powered by FluxBB