Skip to content

Instantly share code, notes, and snippets.

View AltiUP's full-sized avatar

Christophe Gherardi AltiUP

  • CirrusLab - Gherardi Solutions
  • Switzerland
View GitHub Profile
@AltiUP
AltiUP / oci_ubuntu_to_debian.multiarch.sh
Created November 14, 2022 15:38 — forked from ishad0w/README.md
Debian 11 on Oracle Cloud (Free Tier) - (AMD64/ARM64)
# clean arm64/amd64 instance with (ubuntu 22.04 minimal)
# all actions require root privileges (aka "sudo -i")
export DEBIAN_FRONTEND=noninteractive; apt update && apt dist-upgrade -y && apt install lsof && reboot
# prepare
snap remove --purge oracle-cloud-agent && snap remove --purge core18 && \
apt-get purge -y $(dpkg-query -Wf '${Package}\n' | grep header) $(dpkg-query -Wf '${Package}\n' | grep -oP "^linux.*\d\d\d\d-oracle" | grep -v "$(uname -r)") linux-modules-extra-$(uname -r) lxc* lxd* vim* snapd* python* && \
apt-get -y autoremove --purge && apt-get -y autoclean && rm -rf /var/log/* /var/lib/apt/* /var/cache/apt/* && cd / && \
mount -t tmpfs -o size=700m tmpfs mnt && tar --one-file-system -c . | tar -C /mnt -x && \
mount --make-private -o remount,rw / && \