Última atividade 6 months ago

Revisão 39fb143a352948d39fe48577d6964aa76a2d936e

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