Open cmahnke opened 12 months ago
Thanks to everyone who works on this project. I've looked a little bit deeper today. Based on PR #20 following things to add:
sudo apt-get purge -y '^llvm-.*' azure-cli powershell mono-devel
removePackages=`apt list --manual-installed | awk '{print $1}' | sed 's|\(.*\)/.*|\1|' | grep -E -v 'base*|bash|binutils|bsdutils|bzip2|ca-certificates|coreutils|curl|dbus|diffutils|dpkg*|file|findutils|git*|grep|gzip|hostname|init|iproute2|iputils-ping|keyutils|lib*|linux-headers*|linux-image*|lld*|locales|login|lsb-release|make|net-tools|openssh-*|openssl|patchelf|rpm|rsync|session-manager-plugin|shellcheck|ssh|sudo|sysvinit-utils|tar|tcl*|time|tk|tzdata|ubuntu-*|unzip|upx-ucl|walinuxagent|wget|xz-utils|zip*|zsync|apt|dash|ncurses-bin|shim-signed|grub-efi-*|mokutil|sbsigntool|secureboot-db|docker-*|containerd.io' | tr '\n' ' '`
echo "Removing following userinstalled packages: $removePackages"
sudo apt-get purge -y $removePackages
sudo apt-get clean && sudo apt-get autoremove --purge -y $(dpkg -l | grep '^rc' | awk '{print $2}') && sudo rm -rf /var/lib/apt/lists/*
As said that would remove nearly everything (even things like haskell, even if you say haskell:false), therefore this would need more effort to get it into a PR, don't think having enough time in the near future, but maybe someone finds the time (or can use this info)
Since the Runner VMs are populated by a script, the knowledge of the contents of its configuration can help with identifying further target to remove. For example: https://github.com/actions/runner-images/blob/main/images/linux/toolsets/toolset-2204.json
How about either generating the options of this option directly from the JSON file or create some sort of rollback mechanism, than can take a similar script and just remove the software missing from the modified json file?