Hello! Due to the article: https://wiki.debian.org/CrossGrading and also very helpful blog: https://stbuehler.de/blog/article/2017/06/28/debian_stretch__upgrade_32-bit_to_64-bit.html I was able to crossgrade Debian Stretch production system with apache, samba, exim, fetchmail, dovecot, hylafax, pure-ftpd. Full procedure is in tree steps: -- install apt:64 and dpkg:64 with apt-get -- download all *.deb files, install lib.*deb with dpkg -- install all *.deb with dpkg This is good, because we don't see apt screaming about errors until instalation is complete. I have tried this procedure on three servers and always worked. ######################################## # 64 bit kernel running, current arch is i386, foreign amd64 root@test:~# dpkg --print-architecture i386 root@test:~# dpkg --print-foreign-architectures amd64 root@test:~# uname -a Linux test 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u2 (2018-02-21) x86_64 GNU/Linux ######################################## # sources.list -- minimalistic, only debian repositories, only three default lines root@test:~# cat /etc/apt/sources.list deb http://httpredir.debian.org/debian stretch main deb http://httpredir.debian.org/debian stretch-updates main deb http://security.debian.org stretch/updates main ######################################## # tell apt no to install suggested or recommended packages root@test:~# cat /etc/apt/apt.conf APT::Install-Recommends "false"; APT::Install-Suggests "false"; ######################################## # make sure everything is in clean state root@test:~# apt-get update; apt-get dist-upgrade ... # should do nothing root@test:~# dpkg -l | egrep -v '^ii' ... # should print no packages ######################################## # make sure all packages are installable root@test:~# apt-get clean; apt-get update .... # only files from minimalistic sources.list root@test:~# ls /var/lib/apt/lists/*_Packages /var/lib/apt/lists/httpredir.debian.org_debian_dists_stretch_main_binary-amd64_Packages /var/lib/apt/lists/httpredir.debian.org_debian_dists_stretch_main_binary-i386_Packages /var/lib/apt/lists/httpredir.debian.org_debian_dists_stretch-updates_main_binary-amd64_Packages /var/lib/apt/lists/httpredir.debian.org_debian_dists_stretch-updates_main_binary-i386_Packages /var/lib/apt/lists/security.debian.org_dists_stretch_updates_main_binary-amd64_Packages /var/lib/apt/lists/security.debian.org_dists_stretch_updates_main_binary-i386_Packages root@test:~# egrep '^Package' /var/lib/apt/lists/*_Packages -h | awk '{ print $2 }' | sort | sed 's/:(i386|amd64)$//' | uniq > /tmp/available_packages # should print nothing root@test:~# dpkg -l | grep '^.i' | awk '{ print $2 }' | sed -r 's/:(i386|amd64)$//' | while read F; do grep -Fxq "$F" /tmp/available_packages || echo $F; done ################################### # save data for later reference root@test:~# dpkg --get-selections > getsel.txt root@test:~# apt-mark showauto > auto.txt root@test:~# apt-mark showmanual > manual.txt root@test:~# apt-get clean; ls /var/cache/apt/archives/*.deb ls: nie ma dostępu do '/var/cache/apt/archives/*.deb': Nie ma takiego pliku ani katalogu *** migawka -- od nowa ############################################## # install dpkg and apt as in tutorials root@test:~# apt-get --download-only install dpkg:amd64 apt:amd64 root@test:~# ls /var/cache/apt/archives/ apt_1.4.8_amd64.deb libapt-pkg5.0_1.4.8_amd64.deb libstdc++6_6.3.0-18+deb9u1_amd64.deb partial dpkg_1.18.24_amd64.deb libbz2-1.0_1.0.6-8.1_amd64.deb lock root@test:~# dpkg -i /var/cache/apt/archives/*.deb # shows errors... run once again root@test:~# dpkg -i /var/cache/apt/archives/*.deb # no errors this time... root@test:~# dpkg --print-architecture amd64 root@test:~# dpkg --print-foreign-architectures i386 root@test:~# dpkg -l | egrep amd64 | wc -l 26 root@test:~# dpkg -l | egrep i386 | wc -l 395 ###################################################################### # download all packages needed for installation; these are all packages # marked as "i386" but in "amd64" version; this just download to the current # directory; root@test:~# mkdir working-dir; cd working-dir; root@test:~# apt-get download $(dpkg -l | awk '{print $2}' | egrep ':i386$' | egrep -v '^linux-image-' | sed 's/i386$/amd64/g') ... root@test:~# ls *.deb | wc -l 393 ####################################################### # install libraries, only libraries first; libraries amd64 # use dpkg, not apt; you can run that command a few times root@test:~# dpkg -i lib*.deb ... # shows many lines... 15 packages failed liblocale-gettext-perl_1.07-3+b1_amd64.deb libautovivification-perl libbit-vector-perl libclone-perl libdbd-sybase-perl libdbi-perl libhtml-parser-perl liblist-moreutils-perl libnet-ssleay-perl libparams-util-perl libsmbclient:amd64 libtext-charwidth-perl libtext-iconv-perl libxml-libxml-perl root@test:~# dpkg --configure -a root@test:~# dpkg --configure -a ########################################################## # almost all libraries are in place, so install all *.deb files root@test:~# dpkg -i *.deb # run this a few times root@test:~# dpkg --configure -a root@test:~# dpkg --configure -a root@test:~# dpkg --configure -a ######################################################## # now try to run "apt-get install" as in tutorials; when errors are about # python, then install all debs with python; if errors are about samba install # all debs with samba; when errors are about i386 libraries remove them; # to remove or add use "dpkg -i"; try also "dpkg --configure -a" root@test:~# dpkg -i python*.deb root@test:~# dpkg -i samba-libs_2%3a4.5.12+dfsg-2+deb9u1_amd64.deb root@test:~# apt-get install ... # errors root@test:~# dpkg -i bash_4.4-5_amd64.deb dash_0.5.8-2.4_amd64.deb liblocale-gettext-perl_1.07-3+b1_amd64.deb root@test:~# apt-get install ... # errors root@test:~# dpkg -r libisccc-export140:i386 liblognorm5:i386 samba-libs:i386 libsmbclient:i386 ... # no erorrs ################################################ # check if everything is in place, reboot root@test:~# apt-get install ... # no erorrs, shows many packages for autoremoval root@test:~# dpkg -l | egrep 'i386' | wc -l 213 root@test:~# dpkg -l | egrep 'amd64' | wc -l 399 # make sure that every package :i386 has installed :amd64 version root@test:~# dpkg -l | awk '{ print $2 }' | egrep i386 | sed 's/:i386//' | while read F; do dpkg -l | egrep "$F.*amd64" -q || echo "$F"; done libstdc++6 linux-image-4.9.0-6-686-pae linux-image-686-pae ... # this is okey, kernel is old, and "++" is wrong regex for grep # remove i386 packages root@test:~# apt-get purge $(dpkg -l | egrep :i386 | awk '{ print $2; }' | egrep ':i386$' ) # check if errors root@test:~# apt-get clean; apt-get update; apt-get dist-upgrade ... # errors, warns, I see login problem and e2fsprogs problem -- tries to remove them; STOP! root@test:~# dpkg -i e2fsprogs_1.43.4-2_amd64.deb ... root@test:~# dpkg -i login_1%3a4.4-4.1_amd64.deb ... # check if errors root@test:~# apt-get clean; apt-get update; apt-get dist-upgrade ... # no errors # remove architecutre root@test:~# dpkg --remove-architecture i386 root@test:~# dpkg --print-architecture amd64 root@test:~# dpkg --print-foreign-architectures root@test:~# apt-get clean; apt-get update; apt-get dist-upgrade ... # no errors at all! t@test:~# dpkg -l | egrep -v '^ii' ... # completely clean! # update lilo or grub; reboot email: leszek \shift-2 dubiel \point pl