Ultima attività 6 months ago

crossgrade_jessie_i386_amd64.sh Raw
1# Crossgrade jessie over to amd64 along https://stbuehler.de/blog/article/2017/06/28/debian_stretch__upgrade_32-bit_to_64-bit.html,
2# but on jessie downloading the correct packages is a bit more complicated
3
4aptitude search ~M | cut -c5- | cut -d' ' -f1 > aptitude.auto
5dpkg -l | grep '^ii' | awk '{print $2}' > packages
6dpkg --print-architecture
7dpkg --print-foreign-architectures
8dpkg --add-architecture amd64
9apt-get update
10
11apt-get --no-install-recommends install linux-image-amd64:amd64
12reboot
13uname -r
14
15apt-get clean
16apt-get -y --no-install-recommends --download-only install dash:amd64 bash:amd64
17dpkg --install /var/cache/apt/archives/*.deb
18dpkg --install /var/cache/apt/archives/dash_*.deb /var/cache/apt/archives/bash_*.deb
19
20apt-get clean
21apt-get -y --no-install-recommends --download-only install dpkg:amd64 apt:amd64 aptitude:amd64 apt-utils:amd64
22dpkg --install /var/cache/apt/archives/*.deb
23dpkg --install /var/cache/apt/archives/dpkg_*.deb
24
25dpkg --print-architecture
26dpkg --print-foreign-architectures
27
28cd /var/cache/apt/archives/ && \
29apt-get download $(dpkg -l | grep '^.i' | grep -vE " (amd64|all) " | sed s/:i386// | awk '{print $2":amd64"}'|xargs) && \
30apt-get download libblas-common:amd64 && \
31mv /var/cache/apt/archives/libapache2-mod-*.deb /tmp/ && \
32dpkg --install /var/cache/apt/archives/lib*.deb /var/cache/apt/archives/perl*.deb /var/cache/apt/archives/mlock_*.deb && \
33 mkdir /tmp/archives/ && \
34 mv /var/cache/apt/archives/lib*.deb /var/cache/apt/archives/perl*.deb /var/cache/apt/archives/mlock_*.deb /tmp/archives/ && \
35dpkg --install /var/cache/apt/archives/lib*.deb /var/cache/apt/archives/*python*.deb && \
36 mv /var/cache/apt/archives/lib*.deb /var/cache/apt/archives/*python*.deb /tmp/archives/ && \
37mv /tmp/libapache2-mod-php*.deb /var/cache/apt/archives/ && \
38dpkg --install /var/cache/apt/archives/lib*.deb /var/cache/apt/archives/*php*.deb /var/cache/apt/archives/*apache2*.deb /var/cache/apt/archives/sed_4.2.2-4+deb8u1_amd64.deb /var/cache/apt/archives/lsof_4.86+dfsg-1_amd64.deb && \
39 mv /var/cache/apt/archives/lib*.deb /var/cache/apt/archives/*php*.deb /var/cache/apt/archives/*apache2*.deb /var/cache/apt/archives/sed_4.2.2-4+deb8u1_amd64.deb /var/cache/apt/archives/lsof_4.86+dfsg-1_amd64.deb /tmp/archives/ && \
40dpkg --install /var/cache/apt/archives/lib*.deb /var/cache/apt/archives/*openss*.deb && \
41 mv /var/cache/apt/archives/lib*.deb /var/cache/apt/archives/*openss*.deb /tmp/archives/ && \
42dpkg --install /var/cache/apt/archives/lib*.deb /var/cache/apt/archives/*mysql*.deb && \
43 mv /var/cache/apt/archives/lib*.deb /var/cache/apt/archives/*mysql*.deb /tmp/archives/ && \
44dpkg -i /var/cache/apt/archives/*.deb && \
45 mv /var/cache/apt/archives/*.deb /tmp/archives/ && \
46 cd
47
48apt-get clean
49apt-get --download-only -y --no-install-recommends install `dpkg -l | grep '^.i' | awk '{print $2}' | grep :i386 | sed -e 's/\(.*\):i386/\1:i386- \1:amd64/'`
50dpkg --install /var/cache/apt/archives/*.deb
51
52apt-get remove `dpkg -l | grep '^.i' | awk '{print $2}' | grep :i386`
53apt-get autoremove
54
55aptitude markauto `cat aptitude.auto | sed -e s/:i386/:amd64/`
56
57diff -u <(sed s/:.*// packages | uniq) <(dpkg -l | grep '^ii' | awk '{print $2}' | sed s/:.*// | uniq) | less
58
59dpkg --remove-architecture i386
60