get weird with it

This commit is contained in:
Daylin Morgan 2024-06-14 15:02:01 -05:00
parent e4d08c4195
commit 7187134e95
Signed by: daylin
GPG key ID: 950D13E9719334AD

View file

@ -17,32 +17,43 @@ runs:
run: |
set -euo pipefail
non_manifest_packages() {
manifest='https://releases.ubuntu.com/jammy/ubuntu-22.04.4-live-server-amd64.manifest'
comm -2 -3 \
<(sudo apt-mark showmanual | sort) \
<(curl --silent "$manifest" | grep --perl-regexp --only-matching '^[\w-.+]+' | sort)
}
# remove_non_essential_package_files() {
# # dpkg -L $(non_manifest_packages) | while read p; do [ -f "$p" ] && echo "$p"; done | xargs -n 10000 sudo rm -f
# # dpkg -L $(non_manifest_packages) | while read p; do {[ -f "$p" ] && rm -f "$p";} &; done
# while read -r p; do
# {
# if [[ -f "$p" ]]; then
# sudo rm -f "$p"
# fi
# } &
# done <<< "$(dpkg -L $(non_manifest_packages))"
# }
echo "Removing unwanted software... "
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /opt/hostedtoolcache
sudo docker image prune --all --force > /dev/null
sudo rm -rf /usr/local
sudo apt-get remove -y '^aspnetcore-.*' > /dev/null
sudo apt-get remove -y '^dotnet-.*' > /dev/null
sudo apt-get remove -y '^llvm-.*' > /dev/null
sudo apt-get remove -y 'php.*' > /dev/null
sudo apt-get remove -y '^mongodb-.*' > /dev/null
sudo apt-get remove -y '^mysql-.*' > /dev/null
sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing > /dev/null
sudo apt-get remove -y google-cloud-sdk --fix-missing > /dev/null
sudo apt-get remove -y google-cloud-cli --fix-missing > /dev/null
sudo apt-get autoremove -y > /dev/null
sudo apt-get clean > /dev/null
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf /opt &
sudo rm -rf "$AGENT_TOOLSDIRECTORY" &
sudo apt-get purge -y --allow-remove-essential \
$(non_manifest_packages) &
wait
sudo rm -rf /var/lib/docker &
sudo rm -rf /usr/{local,share} &
{
sudo swapoff -a
sudo rm -f /mnt/swapfile
free -h
sudo rm -f /mnt/swapfile &
} &
wait
echo "... done"
- name: Disk space report after modification