From 8b010d3fe92872ff36e0794785e3a73a435a2e7f Mon Sep 17 00:00:00 2001 From: Mike Miller <87874+mikeage@users.noreply.github.com> Date: Fri, 2 Aug 2024 08:18:21 +0300 Subject: [PATCH] Remove more unneeded files to free more disk space (#753) Also update measurements as of Aug 2 2024 --- .github/workflows/build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ccd06a60cd..8ff1686f9b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 /