|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +# From: https://github.com/apache/arrow/blob/82324f/ci/scripts/util_free_space.sh |
| 4 | + |
| 5 | +# |
| 6 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 7 | +# or more contributor license agreements. See the NOTICE file |
| 8 | +# distributed with this work for additional information |
| 9 | +# regarding copyright ownership. The ASF licenses this file |
| 10 | +# to you under the Apache License, Version 2.0 (the |
| 11 | +# "License"); you may not use this file except in compliance |
| 12 | +# with the License. You may obtain a copy of the License at |
| 13 | +# |
| 14 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 15 | +# |
| 16 | +# Unless required by applicable law or agreed to in writing, |
| 17 | +# software distributed under the License is distributed on an |
| 18 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 19 | +# KIND, either express or implied. See the License for the |
| 20 | +# specific language governing permissions and limitations |
| 21 | +# under the License. |
| 22 | + |
| 23 | +set -eux |
| 24 | + |
| 25 | +df -h |
| 26 | +echo "::group::/usr/local/*" |
| 27 | +du -hsc /usr/local/* |
| 28 | +echo "::endgroup::" |
| 29 | +# ~1GB |
| 30 | +sudo rm -rf \ |
| 31 | + /usr/local/aws-sam-cli \ |
| 32 | + /usr/local/julia* || : |
| 33 | +echo "::group::/usr/local/bin/*" |
| 34 | +du -hsc /usr/local/bin/* |
| 35 | +echo "::endgroup::" |
| 36 | +# ~1GB (From 1.2GB to 214MB) |
| 37 | +sudo rm -rf \ |
| 38 | + /usr/local/bin/aliyun \ |
| 39 | + /usr/local/bin/azcopy \ |
| 40 | + /usr/local/bin/bicep \ |
| 41 | + /usr/local/bin/cmake-gui \ |
| 42 | + /usr/local/bin/cpack \ |
| 43 | + /usr/local/bin/helm \ |
| 44 | + /usr/local/bin/hub \ |
| 45 | + /usr/local/bin/kubectl \ |
| 46 | + /usr/local/bin/minikube \ |
| 47 | + /usr/local/bin/node \ |
| 48 | + /usr/local/bin/packer \ |
| 49 | + /usr/local/bin/pulumi* \ |
| 50 | + /usr/local/bin/sam \ |
| 51 | + /usr/local/bin/stack \ |
| 52 | + /usr/local/bin/terraform || : |
| 53 | +# 142M |
| 54 | +sudo rm -rf /usr/local/bin/oc || : \ |
| 55 | +echo "::group::/usr/local/share/*" |
| 56 | +du -hsc /usr/local/share/* |
| 57 | +echo "::endgroup::" |
| 58 | +# 506MB |
| 59 | +sudo rm -rf /usr/local/share/chromium || : |
| 60 | +# 1.3GB |
| 61 | +sudo rm -rf /usr/local/share/powershell || : |
| 62 | +echo "::group::/usr/local/lib/*" |
| 63 | +du -hsc /usr/local/lib/* |
| 64 | +echo "::endgroup::" |
| 65 | +# 15GB |
| 66 | +sudo rm -rf /usr/local/lib/android || : |
| 67 | +# 341MB |
| 68 | +sudo rm -rf /usr/local/lib/heroku || : |
| 69 | +# 1.2GB |
| 70 | +sudo rm -rf /usr/local/lib/node_modules || : |
| 71 | +echo "::group::/opt/*" |
| 72 | +du -hsc /opt/* |
| 73 | +echo "::endgroup::" |
| 74 | +# 679MB |
| 75 | +sudo rm -rf /opt/az || : |
| 76 | +echo "::group::/opt/microsoft/*" |
| 77 | +du -hsc /opt/microsoft/* |
| 78 | +echo "::endgroup::" |
| 79 | +# 197MB |
| 80 | +sudo rm -rf /opt/microsoft/powershell || : |
| 81 | +echo "::group::/opt/hostedtoolcache/*" |
| 82 | +du -hsc /opt/hostedtoolcache/* |
| 83 | +echo "::endgroup::" |
| 84 | +# 5.3GB |
| 85 | +sudo rm -rf /opt/hostedtoolcache/CodeQL || : |
| 86 | +# 1.4GB |
| 87 | +sudo rm -rf /opt/hostedtoolcache/go || : |
| 88 | +# 489MB |
| 89 | +sudo rm -rf /opt/hostedtoolcache/PyPy || : |
| 90 | +# 376MB |
| 91 | +sudo rm -rf /opt/hostedtoolcache/node || : |
| 92 | +# Remove Web browser packages |
| 93 | +sudo apt purge -y firefox |
| 94 | +# google-chrome-stable isn't installed on arm64 image. |
| 95 | +sudo apt purge -y google-chrome-stable || : |
| 96 | +# microsoft-edge-stable isn't installed on arm64 image. |
| 97 | +sudo apt purge -y microsoft-edge-stable || : |
| 98 | +df -h |
0 commit comments