7

I'm still new to the Linux world, My disk size is 493 G

And when I use the command du -hs * /opt/conda, The total size I use is less than 95g

enter image description here

But when I use the df -h command:

  • Disk Size is 493 G
  • Used 404 G
  • Available 89 G

enter image description here

  • So, (493 - 95) = 398 G available not just only 89 G

What can i do with that ?

I tried to use this command sudo apt-get autoremove to remove any unnecessary packages but it just free about 50 M only.

And when i try this sudo parted -l & lsblk -f This is the output:

enter image description here

The OS & release :

enter image description here

2 Answers2

8

This command covers the most common tasks I use to create disk space:

sudo journalctl --rotate && sudo journalctl --vacuum-size=100M && sudo apt-get autoremove && sudo apt-get autoclean

This is because the local apt-get repo and the journal logs are a common source of unneeded large files, sometimes taking up many GB of space.

journalctl --rotate marks all journal logs as archived, journalctl --vacuum-size=100M limits the journal logs to 100MB total, apt-get autoremove removes apt dependencies that are no longer dependencies, and apt-get autoclean clears the local cache of package files that can no longer be downloaded.

This may not entirely solve your disk space problem, but it's a good place to start.

A good next step is to install and use the nCurses Disk Usage tool to locate large files:

sudo apt-get install ncdu
sudo ncdu /
2

You can use the Disk Usage Analyzer tool to find files and directories occupying majority of your space.

In case it is not installed, you can install it with the terminal command

sudo apt install baobab