Home>

Last questionAt that time, I understood that the error cause can be solved by deleting unnecessary files.
(The error text from the previous question is attached below.

for that reasonReference siteI am moving to delete while looking at it, but I do not know which file is treated as unnecessary and should be deleted.

* This time, I hope to solve the problem by deleting unnecessary files without expanding the capacity of EBS.

Error message (quoted from the previous error message)
ec2-user: ~/environment $brew install awsebcli
#Since it is quite long, some parts are omitted.
..
..
..
tar: [email protected]/3.9.0_1/include: Cannot mkdir: No space left on device
tar: [email protected]/3.9.0_1/include/python3.9/pystrtod.h: Cannot open: No such file or directory
tar: [email protected]/3.9.0_1/include: Cannot mkdir: No space left on device
tar: [email protected]/3.9.0_1/include/python3.9/memoryobject.h: Cannot open: No such file or directory
tar: [email protected]/3.9.0_1/include: Cannot mkdir: No space left on device
tar: [email protected]/3.9.0_1/include/python3.9/pyctype.h: Cannot open: No such file or directory
tar: [email protected]/3.9.0_1/LICENSE: Cannot write: No space left on device
tar: Exiting with failure status due to previous errors
Warning: Bottle installation failed: building from source.
==>Installing dependencies for [email protected]: pkg-config
==>Installing [email protected] dependency: pkg-config
==>Pouring pkg-config-0.29.2_4.x86_64_linux.bottle.tar.gz
tar: /home/ec2-user/.cache/Homebrew/downloads/9ae792be0ff044cacdab5b0bbb96110b61ccaf488d49843e4b2fdc4cb66ca3a5--pkg-config-0.29.2_4.x86_64_linux.bottle.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
Error: Failure while executing;`tar xof /home/ec2-user/.cache/Homebrew/downloads/9ae792be0ff044cacdab5b0bbb96110b61ccaf488d49843e4b2fdc4cb66ca3a5--pkg-config-0.29.2_4.x86_64_linux.bottle.tar.gz -C/tmp/2020 47muv9` exited with 2. Here's the output:
tar: /home/ec2-user/.cache/Homebrew/downloads/9ae792be0ff044cacdab5b0bbb96110b61ccaf488d49843e4b2fdc4cb66ca3a5--pkg-config-0.29.2_4.x86_64_linux.bottle.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
Warning: Bottle installation failed: building from source.
cp: error writing ‘/tmp/pkg-config-20201119-2364-1d6qg2p/pkg-config-0.29.2/glib/glib/libcharset/Makefile.in’: No space left on devicecp: failed to extend ‘/tmp/pkg-config-20201119-2364-1d6qg2p/pkg-config-0.29.2/glib/glib/libcharset/Makefile.in’: No space left on device
cp: error writing ‘/tmp/pkg-config-20201119-2364-1d6qg2p/pkg-config-0.29.2/glib/glib/libcharset/make-patch.sh’: No space left on device
cp: failed to extend ‘/tmp/pkg-config-20201119-2364-1d6qg2p/pkg-config-0.29.2/glib/glib/libcharset/make-patch.sh’: No space left on device
cp: error writing ‘/tmp/pkg-config-20201119-2364-1d6qg2p/pkg-config-0.29.2/glib/glib/libcharset/libcharset-glib.patch’: No space left on device
cp: failed to extend ‘/tmp/pkg-config-20201119-2364-1d6qg2p/pkg-config-0.29.2/glib/glib/libcharset/libcharset-glib.patch’: No space left on device
cp: error writing ‘/tmp/pkg-config-20201119-2364-1d6qg2p/pkg-config-0.29.2/glib/glib/libcharset/update.sh’: No space left on device
cp: failed to extend ‘/tmp/pkg-config-20201119-2364-1d6qg2p/pkg-config-0.29.2/glib/glib/libcharset/update.sh’: No space left on device
Applicable source code/what i am trying
#Delete unnecessary files because the capacity is too big (confirmation)
ec2-user: ~/environment $df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 483M 60K 483M 1%/dev
tmpfs 493M 0 493M 0%/dev/shm
/ dev/xvda1 9.8G 9.7G 14M 100% /
ec2-user: ~/environment $find/-xdev -type f | cut -d "/" -f 2 | sort | uniq -c | sort -nr
..
..
..
find: `/ etc/pki/rsyslog': Permission denied
find: `/ etc/pki/CA/private': Permission denied
find: `/ etc/dhcp': Permission denied
find: `/ lost + found': Permission denied
 160652 usr
  94671 home
  47034 opt
   4380 var
   3494 lib
    697 etc
    284 lib64
    167 sbin97 bin
     30 boot
      1 tmp
      1 nvm-install.txt
      1 .autorelabel
      1 .autofsck


Since the usr directory is the largest, specify it further

ec2-user: ~/environment $find/usr -xdev -type f | cut -d "/" -f 3 | sort | uniq -c | sort -nr
  53939 local
  43205 src
  31370 share
  15863 lib
  11912 lib64
   3181 include
    796 bin
    221 sbin
    165 libexec


When narrowed down, the local directory has the largest capacity. Specify further

ec2-user: ~/environment $find/usr/local -xdev -type f | cut -d "/" -f 3 | sort | uniq -c | sort -nr
  53939 local

I brought it so far.

$sudo rm -rf/usr/local


I think it can be deleted with
I think it is dangerous to delete all unnecessary files without knowing them.

I would appreciate it if you could tell me if there is an appropriate way to proceed with the deletion after this.

  • Answer # 1

    I think it is dangerous to delete all unnecessary files without knowing them.

    Yes normal/ usr/localIs a place for programs, so even if you make a mistake, you can delete everything.Do not do it..

    If you actually put in the necessary programs and the capacity is reached, there is a possibility that there is nothing you can do other than expanding the disk.