crossgrade_jessie_i386_amd64.sh
· 3.2 KiB · Bash
Sin formato
# 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
aptitude search ~M | cut -c5- | cut -d' ' -f1 > aptitude.auto
dpkg -l | grep '^ii' | awk '{print $2}' > packages
dpkg --print-architecture
dpkg --print-foreign-architectures
dpkg --add-architecture amd64
apt-get update
apt-get --no-install-recommends install linux-image-amd64:amd64
reboot
uname -r
apt-get clean
apt-get -y --no-install-recommends --download-only install dash:amd64 bash:amd64
dpkg --install /var/cache/apt/archives/*.deb
dpkg --install /var/cache/apt/archives/dash_*.deb /var/cache/apt/archives/bash_*.deb
apt-get clean
apt-get -y --no-install-recommends --download-only install dpkg:amd64 apt:amd64 aptitude:amd64 apt-utils:amd64
dpkg --install /var/cache/apt/archives/*.deb
dpkg --install /var/cache/apt/archives/dpkg_*.deb
dpkg --print-architecture
dpkg --print-foreign-architectures
cd /var/cache/apt/archives/ && \
apt-get download $(dpkg -l | grep '^.i' | grep -vE " (amd64|all) " | sed s/:i386// | awk '{print $2":amd64"}'|xargs) && \
apt-get download libblas-common:amd64 && \
mv /var/cache/apt/archives/libapache2-mod-*.deb /tmp/ && \
dpkg --install /var/cache/apt/archives/lib*.deb /var/cache/apt/archives/perl*.deb /var/cache/apt/archives/mlock_*.deb && \
mkdir /tmp/archives/ && \
mv /var/cache/apt/archives/lib*.deb /var/cache/apt/archives/perl*.deb /var/cache/apt/archives/mlock_*.deb /tmp/archives/ && \
dpkg --install /var/cache/apt/archives/lib*.deb /var/cache/apt/archives/*python*.deb && \
mv /var/cache/apt/archives/lib*.deb /var/cache/apt/archives/*python*.deb /tmp/archives/ && \
mv /tmp/libapache2-mod-php*.deb /var/cache/apt/archives/ && \
dpkg --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 && \
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/ && \
dpkg --install /var/cache/apt/archives/lib*.deb /var/cache/apt/archives/*openss*.deb && \
mv /var/cache/apt/archives/lib*.deb /var/cache/apt/archives/*openss*.deb /tmp/archives/ && \
dpkg --install /var/cache/apt/archives/lib*.deb /var/cache/apt/archives/*mysql*.deb && \
mv /var/cache/apt/archives/lib*.deb /var/cache/apt/archives/*mysql*.deb /tmp/archives/ && \
dpkg -i /var/cache/apt/archives/*.deb && \
mv /var/cache/apt/archives/*.deb /tmp/archives/ && \
cd
apt-get clean
apt-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/'`
dpkg --install /var/cache/apt/archives/*.deb
apt-get remove `dpkg -l | grep '^.i' | awk '{print $2}' | grep :i386`
apt-get autoremove
aptitude markauto `cat aptitude.auto | sed -e s/:i386/:amd64/`
diff -u <(sed s/:.*// packages | uniq) <(dpkg -l | grep '^ii' | awk '{print $2}' | sed s/:.*// | uniq) | less
dpkg --remove-architecture i386
| 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 | |
| 4 | aptitude search ~M | cut -c5- | cut -d' ' -f1 > aptitude.auto |
| 5 | dpkg -l | grep '^ii' | awk '{print $2}' > packages |
| 6 | dpkg --print-architecture |
| 7 | dpkg --print-foreign-architectures |
| 8 | dpkg --add-architecture amd64 |
| 9 | apt-get update |
| 10 | |
| 11 | apt-get --no-install-recommends install linux-image-amd64:amd64 |
| 12 | reboot |
| 13 | uname -r |
| 14 | |
| 15 | apt-get clean |
| 16 | apt-get -y --no-install-recommends --download-only install dash:amd64 bash:amd64 |
| 17 | dpkg --install /var/cache/apt/archives/*.deb |
| 18 | dpkg --install /var/cache/apt/archives/dash_*.deb /var/cache/apt/archives/bash_*.deb |
| 19 | |
| 20 | apt-get clean |
| 21 | apt-get -y --no-install-recommends --download-only install dpkg:amd64 apt:amd64 aptitude:amd64 apt-utils:amd64 |
| 22 | dpkg --install /var/cache/apt/archives/*.deb |
| 23 | dpkg --install /var/cache/apt/archives/dpkg_*.deb |
| 24 | |
| 25 | dpkg --print-architecture |
| 26 | dpkg --print-foreign-architectures |
| 27 | |
| 28 | cd /var/cache/apt/archives/ && \ |
| 29 | apt-get download $(dpkg -l | grep '^.i' | grep -vE " (amd64|all) " | sed s/:i386// | awk '{print $2":amd64"}'|xargs) && \ |
| 30 | apt-get download libblas-common:amd64 && \ |
| 31 | mv /var/cache/apt/archives/libapache2-mod-*.deb /tmp/ && \ |
| 32 | dpkg --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/ && \ |
| 35 | dpkg --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/ && \ |
| 37 | mv /tmp/libapache2-mod-php*.deb /var/cache/apt/archives/ && \ |
| 38 | dpkg --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/ && \ |
| 40 | dpkg --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/ && \ |
| 42 | dpkg --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/ && \ |
| 44 | dpkg -i /var/cache/apt/archives/*.deb && \ |
| 45 | mv /var/cache/apt/archives/*.deb /tmp/archives/ && \ |
| 46 | cd |
| 47 | |
| 48 | apt-get clean |
| 49 | apt-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/'` |
| 50 | dpkg --install /var/cache/apt/archives/*.deb |
| 51 | |
| 52 | apt-get remove `dpkg -l | grep '^.i' | awk '{print $2}' | grep :i386` |
| 53 | apt-get autoremove |
| 54 | |
| 55 | aptitude markauto `cat aptitude.auto | sed -e s/:i386/:amd64/` |
| 56 | |
| 57 | diff -u <(sed s/:.*// packages | uniq) <(dpkg -l | grep '^ii' | awk '{print $2}' | sed s/:.*// | uniq) | less |
| 58 | |
| 59 | dpkg --remove-architecture i386 |
| 60 |