Skip to content

Commit

Permalink
Remove more unneeded files to free more disk space (#753)
Browse files Browse the repository at this point in the history
Also update measurements as of Aug 2 2024
  • Loading branch information
mikeage authored Aug 2, 2024
1 parent 362cf51 commit 8b010d3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -260,27 +260,27 @@ jobs:
- name: Set masking
run: echo "::add-mask::DoNotStealThis1"
- name: Free extra space
# As of 06/07/2024, this increases free space from 21GB to 38GB
# As of 02/08/2024, this increases free space from 21GB to 47GB
run: |
echo "Initial free space"
df -h /
echo "Removing all pre-loaded docker images"
docker rmi $(docker image ls -aq) # Removes ~6GB
docker rmi $(docker image ls -aq) # Removes ~3GB
df -h /
echo "Listing 100 largest packages"
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -rn | head -n 100
echo "Removing unneeded large packages"
sudo apt update
sudo apt remove -y '^ghc-.*' '^dotnet-.*' azure-cli powershell google-chrome-stable firefox microsoft-edge-stable 'mongodb-*' 'mysql-*' 'mariadb-*' 'temurin-*' 'openjdk-*' default-jre-headless # Removes ~7GB # Adding 'google-cloud-*' removes another 750MB but takes about a minute; not worth it
sudo apt remove -y '^ghc-.*' '^dotnet-.*' azure-cli powershell google-chrome-stable firefox microsoft-edge-stable 'mongodb-*' 'mysql-*' 'mariadb-*' 'temurin-*' 'openjdk-*' default-jre-headless mono-devel libgl1-mesa-dri # Removes ~6GB
sudo apt autoremove -y
sudo apt clean
df -h /
echo "Listing 100 largest remaining packages"
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -rn | head -n 100
echo "Removing remaining large directories"
echo "Removing Android"
sudo rm -rf /usr/local/lib/android # Removes ~9GB
df -h /
echo "Removing remaining large directories"
rm -rf /usr/share/dotnet/ # Removes ~1GB
rm -rf "$AGENT_TOOLSDIRECTORY" # Removes ~6GB
rm -rf "$AGENT_TOOLSDIRECTORY" # Removes ~7GB
echo "Disk space after cleanup"
df -h /
Expand Down

0 comments on commit 8b010d3

Please sign in to comment.