Skip to content

Instantly share code, notes, and snippets.

@koumaza
Last active Dec 16, 2020
Embed
What would you like to do?
Increase the storage capacity of GitHub Action.

Not yet

Preface

Based on ubuntu-20.04.

Step 1 - Purge from dpkg

Remove these packages

-- Top to bottom | Largest to smallest.
ghc-8.8.4
ghc-8.10.2
ghc-8.6.5
azure-cli
google-cloud-sdk
adoptopenjdk-11-hotspot
hhvm
libgl1-mesa-dri
google-chrome-stable
dotnet-sdk-5.0
firefox
adoptopenjdk-8-hotspot
llvm-10-dev
llvm-9-dev
dotnet-sdk-3.1
powershell
llvm-8-dev
moby-containerd
snapd
mysql-server-core-8.0
mono-devel
moby-engine
moby-cli
podman
mongodb-org-server
libllvm10
dotnet-runtime-3.1
linux-azure-headers-5.4.0-1032
dotnet-runtime-5.0
libllvm9
linux-modules-5.4.0-1032-azure
mysql-client-core-8.0
mongodb-org-mongos
mono-llvm-tools
libllvm8
gcc-10
ansible
libclang-common-10-dev
moby-buildx
mecab-ipadic
containernetworking-plugins
mongodb-org-shell
postgresql-13
libclang-common-9-dev
msbuild
libclang-common-8-dev
libclang-cpp10
libicu-dev
kubectl
r-base-core
liblldb-9
libclang-cpp9
git
libclang1-10
libicu66
liblldb-8
cabal-install-3.4
clang-8
vim-runtime
g++-10
gcc-9
gfortran-10
gcc-8
dotnet-targeting-pack-5.0
mono-llvm-support
cpp-10
referenceassemblies-pcl
g++-9
g++-8
gcc-7
gfortran-9
libperl5.30
gfortran-8
cpp-9
libclang1-8
g++-7
cpp-8
liblapack-dev
dotnet-targeting-pack-3.1
cpp-7
linux-azure-tools-5.4.0-1032
skopeo
mono-utils
ruby2.7-doc
libz3-4
buildah
monodoc-manual
humanity-icon-theme
llvm-10
netstandard-targeting-pack-2.1
iso-codes
libpython3.8-dev
libc6-dev
sphinxsearch
aspnetcore-runtime-5.0
moby-runc
libstdc++-10-dev
llvm-9
libstdc++-9-dev
libwxgtk3.0-gtk3-0v5
aspnetcore-runtime-3.1
perl-modules-5.30
locales
shellcheck
libruby2.7
llvm-8
libgs9
libstdc++-8-dev
git-lfs
gh
libstdc++-7-dev
systemd
liblldb-10
mono-roslyn
libc6-i386
libgcc-9-dev
libgcc-10-dev
mercurial-common
libgcc-8-dev
grub-common
libc6
libgcc-7-dev
aspnetcore-targeting-pack-5.0
python3-twisted
linux-headers-5.4.0-1032-azure
poppler-data
fonts-lato
texinfo
fonts-urw-base35
dotnet-apphost-pack-5.0
perl-base
aspnetcore-targeting-pack-3.1
ieee-data
binutils-x86-64-linux-gnu
libglib2.0-dev
libgtk-3-0
libmonosgen-2.0-dev
libmysqlclient-dev
librsvg2-2
php8.0-cgi
php7.4-cgi
udev
liblcms2-dev
libpython2.7-stdlib
r-cran-survival
linux-image-5.4.0-1032-azure
php8.0-common
libpython3.8-stdlib
libssl-dev
Package Size Details
-- Top to bottom | Largest to smallest.
-- KB(KiloByte) in the first line
-- Package Name in the second line
980641  ghc-8.8.4
965589  ghc-8.10.2
774055  ghc-8.6.5
614280  azure-cli
405475  google-cloud-sdk
317258  adoptopenjdk-11-hotspot
277378  hhvm
266577  libgl1-mesa-dri
232425  google-chrome-stable
213465  dotnet-sdk-5.0
211986  firefox
202146  adoptopenjdk-8-hotspot
198212  llvm-10-dev
194023  llvm-9-dev
189443  dotnet-sdk-3.1
174304  powershell
167062  llvm-8-dev
126931  moby-containerd
123228  snapd
120989  mysql-server-core-8.0
112098  mono-devel
103382  moby-engine
83570   moby-cli
83060   podman
80364   mongodb-org-server
71983   libllvm10
71100   dotnet-runtime-3.1
69656   linux-azure-headers-5.4.0-1032
68316   dotnet-runtime-5.0
67657   libllvm9
63814   linux-modules-5.4.0-1032-azure
63206   mysql-client-core-8.0
62926   mongodb-org-mongos
61421   mono-llvm-tools
61226   libllvm8
58298   gcc-10
56658   ansible
56438   libclang-common-10-dev
56247   moby-buildx
53074   mecab-ipadic
53028   containernetworking-plugins
52182   mongodb-org-shell
47574   postgresql-13
45708   libclang-common-9-dev
45619   msbuild
43756   libclang-common-8-dev
43621   libclang-cpp10
43616   libicu-dev
39293   kubectl
38917   r-base-core
38386   liblldb-9
37008   libclang-cpp9
33975   git
33501   libclang1-10
32773   libicu66
32428   liblldb-8
31181   cabal-install-3.4
31124   clang-8
30765   vim-runtime
30412   g++-10
29794   gcc-9
29524   gfortran-10
29361   gcc-8
28828   dotnet-targeting-pack-5.0
28653   mono-llvm-support
28435   cpp-10
28028   referenceassemblies-pcl
27989   g++-9
27895   g++-8
27369   gcc-7
27213   gfortran-9
27080   libperl5.30
26799   gfortran-8
26218   cpp-9
26204   libclang1-8
26066   g++-7
25718   cpp-8
24866   liblapack-dev
24673   dotnet-targeting-pack-3.1
24018   cpp-7
23807   linux-azure-tools-5.4.0-1032
22741   skopeo
22459   mono-utils
22325   ruby2.7-doc
22171   libz3-4
21648   buildah
21586   monodoc-manual
20754   humanity-icon-theme
20482   llvm-10
19773   netstandard-targeting-pack-2.1
19553   iso-codes
19535   libpython3.8-dev
19070   libc6-dev
18660   sphinxsearch
18560   aspnetcore-runtime-5.0
18424   moby-runc
17868   libstdc++-10-dev
17634   llvm-9
17631   libstdc++-9-dev
17496   libwxgtk3.0-gtk3-0v5
17475   aspnetcore-runtime-3.1
17226   perl-modules-5.30
17196   locales
17179   shellcheck
16817   libruby2.7
16698   llvm-8
16164   libgs9
16115   libstdc++-8-dev
16048   git-lfs
15860   gh
15353   libstdc++-7-dev
15292   systemd
14918   liblldb-10
14823   mono-roslyn
14398   libc6-i386
13892   libgcc-9-dev
13773   libgcc-10-dev
13714   mercurial-common
13369   libgcc-8-dev
13328   grub-common
13245   libc6
13100   libgcc-7-dev
12348   aspnetcore-targeting-pack-5.0
12319   python3-twisted
12246   linux-headers-5.4.0-1032-azure
12219   poppler-data
11749   fonts-lato
11320   texinfo
11058   fonts-urw-base35
10790   dotnet-apphost-pack-5.0
10786   perl-base
10691   aspnetcore-targeting-pack-3.1
10137   ieee-data
9848    binutils-x86-64-linux-gnu
9839    libglib2.0-dev
9831    libgtk-3-0
9606    libmonosgen-2.0-dev
9562    libmysqlclient-dev
9508    librsvg2-2
9459    php8.0-cgi
9147    php7.4-cgi
9145    udev
9071    liblcms2-dev
8855    libpython2.7-stdlib
8671    r-cran-survival
8646    linux-image-5.4.0-1032-azure
8451    php8.0-common
7871    libpython3.8-stdlib
7818    libssl-dev
How to remove these packages
echo 'PASTE'|tr '\n' ' ' # Copy the output.
sudo apt apt remove --purge PACKAGES
# If you need to install the required packages, install them here.
sudo apt install YOURNEEDPACKAGES

Purge unused things

rm -rf /var/lib/apt/lists/
rm -rf /var/cache/apt/archives/

Step 2 - Remove Docker Cache

docker system prune -a

Step 3 - Purge unnecessary things

Remove these directories

/usr/share/{dotnet,swift,rust,miniconda,az_*,gradle-*}
/usr/local/lib/{android,node_modules}
/opt
#!/usr/bin/env bash
# WTFPL by koumaza
# Apt
## Removed git and git-lfs
sudo apt remove --purge ghc-8.8.4 ghc-8.10.2 ghc-8.6.5 azure-cli google-cloud-sdk adoptopenjdk-11-hotspot hhvm libgl1-mesa-dri google-chrome-stable dotnet-sdk-5.0 firefox adoptopenjdk-8-hotspot llvm-10-dev llvm-9-dev dotnet-sdk-3.1 powershell llvm-8-dev moby-containerd snapd mysql-server-core-8.0 mono-devel moby-engine moby-cli podman mongodb-org-server libllvm10 dotnet-runtime-3.1 linux-azure-headers-5.4.0-1032 dotnet-runtime-5.0 libllvm9 linux-modules-5.4.0-1032-azure mysql-client-core-8.0 mongodb-org-mongos mono-llvm-tools libllvm8 gcc-10 ansible libclang-common-10-dev moby-buildx mecab-ipadic containernetworking-plugins mongodb-org-shell postgresql-13 libclang-common-9-dev msbuild libclang-common-8-dev libclang-cpp10 libicu-dev kubectl r-base-core liblldb-9 libclang-cpp9 libclang1-10 libicu66 liblldb-8 cabal-install-3.4 clang-8 vim-runtime g++-10 gcc-9 gfortran-10 gcc-8 dotnet-targeting-pack-5.0 mono-llvm-support cpp-10 referenceassemblies-pcl g++-9 g++-8 gcc-7 gfortran-9 libperl5.30 gfortran-8 cpp-9 libclang1-8 g++-7 cpp-8 liblapack-dev dotnet-targeting-pack-3.1 cpp-7 linux-azure-tools-5.4.0-1032 skopeo mono-utils ruby2.7-doc libz3-4 buildah monodoc-manual humanity-icon-theme llvm-10 netstandard-targeting-pack-2.1 iso-codes libpython3.8-dev libc6-dev sphinxsearch aspnetcore-runtime-5.0 moby-runc libstdc++-10-dev llvm-9 libstdc++-9-dev libwxgtk3.0-gtk3-0v5 aspnetcore-runtime-3.1 perl-modules-5.30 locales shellcheck libruby2.7 llvm-8 libgs9 libstdc++-8-dev gh libstdc++-7-dev systemd liblldb-10 mono-roslyn libc6-i386 libgcc-9-dev libgcc-10-dev mercurial-common libgcc-8-dev grub-common libc6 libgcc-7-dev aspnetcore-targeting-pack-5.0 python3-twisted linux-headers-5.4.0-1032-azure poppler-data fonts-lato texinfo fonts-urw-base35 dotnet-apphost-pack-5.0 perl-base aspnetcore-targeting-pack-3.1 ieee-data binutils-x86-64-linux-gnu libglib2.0-dev libgtk-3-0 libmonosgen-2.0-dev libmysqlclient-dev librsvg2-2 php8.0-cgi php7.4-cgi udev liblcms2-dev libpython2.7-stdlib r-cran-survival linux-image-5.4.0-1032-azure php8.0-common libpython3.8-stdlib libssl-dev
rm -rf /var/lib/apt/lists/
rm -rf /var/cache/apt/archives/
# Docker
docker system prune -a
# Dir
rm -rf \
/usr/share/{dotnet,swift,rust,miniconda,az_*,gradle-*} \
/usr/local/lib/{android,node_modules} \
/opt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment