Skip to content

Instantly share code, notes, and snippets.

@sokolster
sokolster / oci_ubuntu_to_debian.multiarch.sh
Last active October 5, 2022 15:23 — forked from ishad0w/oci_ubuntu_to_debian.multiarch.sh
Debian 11 on Oracle Cloud (Free Tier) - (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 install lsof
# 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=1700m tmpfs mnt && tar --one-file-system -c . | tar -C /mnt -x && \
mount --make-private -o remount,rw / && \
#!/bin/bash
python3 bot.py