Updated cleanup method
Updated till April 27 Signed-off-by: rokibhasansagar <rokibhasansagar2014@outlook.com>
This commit is contained in:
parent
4d51e9067a
commit
c38bb2b8b5
1 changed files with 55 additions and 89 deletions
70
cleanup.sh
70
cleanup.sh
|
@ -30,7 +30,7 @@ REL=$(grep "UBUNTU_CODENAME" /etc/os-release | cut -d'=' -f2)
|
||||||
if [[ ${REL} == "focal" ]]; then
|
if [[ ${REL} == "focal" ]]; then
|
||||||
APT_Pac4Purge="alsa-topology-conf alsa-ucm-conf python2-dev python2-minimal libpython-dev clang-9 clang-format-9 llvm-10-dev llvm-10-runtime llvm-10-tools llvm-10 lld-10 lld-9 libllvm10 libllvm9 libclang-common-10-dev libclang-cpp10 libclang1-10 clang-10 clang-format-10"
|
APT_Pac4Purge="alsa-topology-conf alsa-ucm-conf python2-dev python2-minimal libpython-dev clang-9 clang-format-9 llvm-10-dev llvm-10-runtime llvm-10-tools llvm-10 lld-10 lld-9 libllvm10 libllvm9 libclang-common-10-dev libclang-cpp10 libclang1-10 clang-10 clang-format-10"
|
||||||
elif [[ ${REL} == "bionic" ]]; then
|
elif [[ ${REL} == "bionic" ]]; then
|
||||||
APT_Pac4Purge="python-dev clang-6.0 clang-format-6.0 libclang-common-6.0-dev libclang1-6.0 liblldb-6.0 libllvm6.0 llvm-6.0-dev lld-6.0"
|
APT_Pac4Purge="python-dev"
|
||||||
fi
|
fi
|
||||||
unset REL
|
unset REL
|
||||||
sudo -EH apt-fast -qq -y purge \
|
sudo -EH apt-fast -qq -y purge \
|
||||||
|
@ -42,7 +42,6 @@ sudo -EH apt-fast -qq -y purge \
|
||||||
apport* popularity-contest \
|
apport* popularity-contest \
|
||||||
aspnetcore-* dotnet* \
|
aspnetcore-* dotnet* \
|
||||||
azure-cli session-manager-plugin \
|
azure-cli session-manager-plugin \
|
||||||
bazel* \
|
|
||||||
brltty byobu htop \
|
brltty byobu htop \
|
||||||
buildah hhvm kubectl packagekit* podman podman-plugins skopeo \
|
buildah hhvm kubectl packagekit* podman podman-plugins skopeo \
|
||||||
chromium-browser firebird* firefox google-chrome* xvfb \
|
chromium-browser firebird* firefox google-chrome* xvfb \
|
||||||
|
@ -60,6 +59,10 @@ sudo -EH apt-fast -qq -y purge \
|
||||||
sudo -EH apt-fast -qq -y autoremove &>/dev/null
|
sudo -EH apt-fast -qq -y autoremove &>/dev/null
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
|
{
|
||||||
|
echo "will cite" | parallel --citation
|
||||||
|
} &>/dev/null
|
||||||
|
|
||||||
echo "::group::Removing Homebrew Completely"
|
echo "::group::Removing Homebrew Completely"
|
||||||
curl -sL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh -o uninstall-brew.sh && chmod a+x uninstall-brew.sh
|
curl -sL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh -o uninstall-brew.sh && chmod a+x uninstall-brew.sh
|
||||||
./uninstall-brew.sh -f -q &>/dev/null
|
./uninstall-brew.sh -f -q &>/dev/null
|
||||||
|
@ -70,8 +73,7 @@ echo "::group::Removing NodeJS, NPM & NPX"
|
||||||
{
|
{
|
||||||
sudo npm list -g --depth=0. 2>/dev/null | awk -F ' ' '{print $2}' | awk -F '@[0-9]' '{print $1}' | grep -v "^n$" | sudo xargs npm remove -g
|
sudo npm list -g --depth=0. 2>/dev/null | awk -F ' ' '{print $2}' | awk -F '@[0-9]' '{print $1}' | grep -v "^n$" | sudo xargs npm remove -g
|
||||||
yes | sudo n uninstall
|
yes | sudo n uninstall
|
||||||
sudo rm -rf -- /usr/local/lib/node_modules /usr/local/n /usr/local/bin/n \
|
parallel --use-cpus-instead-of-cores sudo rm -rf {} 2>/dev/null ::: /usr/local/lib/node_modules ::: /usr/local/n ::: /usr/local/bin/n /usr/local/bin/vercel /usr/local/bin/now
|
||||||
/usr/local/bin/vercel /usr/local/bin/now
|
|
||||||
} &>/dev/null
|
} &>/dev/null
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
|
@ -84,54 +86,18 @@ echo "::group::Purging PIPX & PIP packages"
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
echo "::group::Removing Lots of Cached Programs & Unneeded Folders"
|
echo "::group::Removing Lots of Cached Programs & Unneeded Folders"
|
||||||
{
|
printf "Removing Runner Tool Cache, Android SDK, NDK, Platform Tools, Gradle, Maven...\n"
|
||||||
printf "Removing Runner Tool Cache...\n"
|
parallel --use-cpus-instead-of-cores sudo rm -rf -- {} 2>/dev/null ::: /opt/hostedtoolcache ::: /usr/local/lib/android ::: /usr/share/gradle* /usr/bin/gradle /usr/share/apache-maven* /usr/bin/mvn
|
||||||
sudo rm -rf -- /opt/hostedtoolcache
|
printf "Removing Microsoft vcpkg, Miniconda, Leiningen, Pulumi...\n"
|
||||||
printf "Removing Android SDK, NDK, Platform Tools, Gradle, Maven...\n"
|
parallel --use-cpus-instead-of-cores sudo rm -rf -- {} 2>/dev/null ::: /usr/local/share/vcpkg /usr/local/bin/vcpkg ::: /usr/share/miniconda ::: /usr/bin/conda /usr/local/lib/lein /usr/local/bin/lein /usr/local/bin/pulumi*
|
||||||
sudo rm -rf -- /usr/local/lib/android \
|
printf "Removing Browser-based Webdrivers, PHP, Composer, Database Management Program Remains...\n"
|
||||||
/usr/share/gradle* /usr/bin/gradle /usr/share/apache-maven* /usr/bin/mvn
|
parallel --use-cpus-instead-of-cores sudo rm -rf -- {} 2>/dev/null ::: /usr/share/java/selenium-server-standalone.jar /usr/local/share/phantomjs* /usr/local/bin/phantomjs /usr/local/share/chrome_driver /usr/bin/chromedriver /usr/local/share/gecko_driver /usr/bin/geckodriver ::: /etc/php /usr/bin/composer /usr/local/bin/phpunit ::: /var/lib/mysql /etc/mysql /usr/local/bin/sqlcmd /usr/local/bin/bcp /usr/local/bin/session-manager-plugin
|
||||||
printf "Removing Microsoft vcpkg, Miniconda, Leiningen, Pulumi...\n"
|
printf "Removing Julia, Rust, Cargo, Rubygems, Rake, Swift, Haskell, Erlang...\n"
|
||||||
sudo rm -rf -- /usr/local/share/vcpkg /usr/local/bin/vcpkg \
|
parallel --use-cpus-instead-of-cores sudo rm -rf -- {} 2>/dev/null ::: /usr/local/julia* /usr/bin/julia ::: /usr/share/rust /home/runner/.cargo /home/runner/.rustup /home/runner/.ghcup ::: /usr/local/bin/rake /usr/local/bin/rdoc /usr/local/bin/ri /usr/local/bin/racc /usr/local/bin/rougify ::: /usr/local/bin/bundle /usr/local/bin/bundler /var/lib/gems ::: /usr/share/swift /usr/local/bin/swift /usr/local/bin/swiftc /usr/bin/ghc /usr/local/.ghcup /usr/local/bin/stack /usr/local/bin/rebar3 /usr/share/sbt /usr/bin/sbt /usr/bin/go /usr/bin/gofmt
|
||||||
/usr/share/miniconda /usr/bin/conda \
|
printf "Removing Various Cloud CLI Tools, Different Kubernetes & Container Management Programs...\n"
|
||||||
/usr/local/lib/lein /usr/local/bin/lein /usr/local/bin/pulumi*
|
parallel --use-cpus-instead-of-cores sudo rm -rf -- {} 2>/dev/null ::: /usr/local/bin/aws /usr/local/bin/aws_completer /usr/local/aws-cli /usr/local/aws /usr/local/bin/aliyun /usr/share/az_* /opt/az /usr/bin/az /usr/local/bin/azcopy* /usr/bin/azcopy /usr/lib/azcopy /usr/local/bin/oc /usr/local/bin/oras ::: /usr/local/bin/packer /usr/local/bin/terraform /usr/local/bin/helm /usr/local/bin/kubectl /usr/local/bin/kind /usr/local/bin/kustomize /usr/local/bin/minikube /usr/libexec/catatonit/catatonit
|
||||||
printf "Removing Browser-based Webdrivers...\n"
|
printf "Removing Microsoft dotnet Application Remains, Java GraalVM, Manpages, Remains of Apt Packages...\n"
|
||||||
sudo rm -rf -- /usr/share/java/selenium-server-standalone.jar \
|
parallel --use-cpus-instead-of-cores sudo rm -rf -- {} 2>/dev/null ::: /usr/share/dotnet ::: /usr/local/graalvm ::: /usr/share/man ::: /var/lib/apt/lists/* /var/cache/apt/archives/* /etc/apt/sources.list.d/*
|
||||||
/usr/local/share/phantomjs* /usr/local/bin/phantomjs \
|
|
||||||
/usr/local/share/chrome_driver /usr/bin/chromedriver \
|
|
||||||
/usr/local/share/gecko_driver /usr/bin/geckodriver
|
|
||||||
printf "Removing PHP, Composer, Database Management Program Remains...\n"
|
|
||||||
sudo rm -rf -- /etc/php /usr/bin/composer /usr/local/bin/phpunit \
|
|
||||||
/var/lib/mysql /etc/mysql /usr/local/bin/sqlcmd /usr/local/bin/bcp \
|
|
||||||
/usr/local/bin/session-manager-plugin
|
|
||||||
printf "Removing Julia, Rust, Cargo, Rubugems, Rake, Swift, Haskell, Erlang...\n"
|
|
||||||
sudo rm -rf -- /usr/local/julia* /usr/bin/julia \
|
|
||||||
/usr/share/rust /home/runner/.cargo /home/runner/.rustup /home/runner/.ghcup \
|
|
||||||
/usr/local/bin/rake /usr/local/bin/rdoc /usr/local/bin/ri /usr/local/bin/racc /usr/local/bin/rougify \
|
|
||||||
/usr/local/bin/bundle /usr/local/bin/bundler /var/lib/gems \
|
|
||||||
/usr/share/swift /usr/local/bin/swift /usr/local/bin/swiftc \
|
|
||||||
/usr/bin/ghc /usr/local/.ghcup /usr/local/bin/stack \
|
|
||||||
/usr/local/bin/rebar3 /usr/share/sbt /usr/bin/sbt \
|
|
||||||
/usr/bin/go /usr/bin/gofmt
|
|
||||||
printf "Removing Various Cloud CLI Tools...\n"
|
|
||||||
sudo rm -rf -- /usr/local/bin/aws /usr/local/bin/aws_completer /usr/local/aws-cli /usr/local/aws \
|
|
||||||
/usr/local/bin/aliyun /usr/share/az_* /opt/az /usr/bin/az \
|
|
||||||
/usr/local/bin/azcopy* /usr/bin/azcopy /usr/lib/azcopy \
|
|
||||||
/usr/local/bin/oc /usr/local/bin/oras \
|
|
||||||
/usr/local/bin/README.md
|
|
||||||
printf "Removing Different Kubernetes & Container Management Programs...\n"
|
|
||||||
sudo rm -rf -- /usr/local/bin/packer /usr/local/bin/terraform \
|
|
||||||
/usr/local/bin/helm /usr/local/bin/kubectl /usr/local/bin/kind \
|
|
||||||
/usr/local/bin/kustomize /usr/local/bin/minikube \
|
|
||||||
/usr/libexec/catatonit/catatonit
|
|
||||||
printf "Removing Microsoft dotnet Application Remains...\n"
|
|
||||||
sudo rm -rf -- /usr/share/dotnet
|
|
||||||
printf "Removing Java GraalVM...\n"
|
|
||||||
sudo rm -rf -- /usr/local/graalvm
|
|
||||||
printf "Removing Manpages...\n"
|
|
||||||
sudo rm -rf -- /usr/share/man
|
|
||||||
printf "Clearing Remains of Apt Packages...\n"
|
|
||||||
sudo rm -rf -- /var/lib/apt/lists/* /var/cache/apt/archives/* /etc/apt/sources.list.d/*
|
|
||||||
} 2>/dev/null
|
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
echo "::group::Clearing Unwanted Environment Variables"
|
echo "::group::Clearing Unwanted Environment Variables"
|
||||||
|
|
Loading…
Reference in a new issue