Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
12
rated 0 times [  12] [ 0]  / answers: 1 / hits: 1577  / 2 Years ago, sat, april 30, 2022, 11:05:09

Disk Capacity 256.1 GB


Ubuntu 22.04.1 LTS
OS Type 64-bit
GNOME Version 42.4
Windows System Wayland


I am running out of disk space. My computer keeps telling me so.


Can I delete usr or var? there folders are 6 and 11 GB, respectively. That's a lot of disk space.


Here are the results of sudo du -hxd1 /var


108K    /var/tmp
4.0K /var/local
4.8G /var/lib
4.0K /var/crash
132K /var/spool
4.0K /var/mail
4.0K /var/metrics
1.6G /var/log
4.0K /var/opt
16K /var/ipp-usb
11M /var/snap
5.6M /var/backups
58M /var/cache
6.4G /var

Here are the results of df -h


Filesystem      Size  Used Avail Use% Mounted on
tmpfs 771M 2.7M 768M 1% /run
/dev/nvme0n1p3 19G 19G 0 100% /
tmpfs 3.8G 0 3.8G 0% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
/dev/nvme0n1p5 203G 67G 126G 35% /home
/dev/nvme0n1p1 483M 32M 451M 7% /boot/efi
tmpfs 771M 2.4M 769M 1% /run/user/1001
/dev/nvme0n1p2 4.4G 3.1G 1.4G 69% /media/michael/PQSERVICE

Here are the results of journalctl --disk-usage


Archived and active journals take up 1.5G in the file system.

More From » disk-usage

 Answers
6

Definitely no. Deleting /usr or /var will break your system!


The best choice (if possible) is to install Ubuntu on a larger disk partition. I don't know how to clean up /usr, but /var usually filled up with journal log, Flatpak & Snap apps.


Open terminal (Ctrl+Alt+T) and run this command to check journalctl log size (usually 4GB in my case):


journalctl --disk-usage

Then you may clean up and set a lower log size via: sudo journalctl --rotate && sudo journalctl --vacuum-size=100M.


List all install flatpak packages via flatpak list --app and remove unused via flatpak uninstall --delete-data app-id. List all snap apps via snap list and remove unused via snap remove packagename.


You may also search for and open Disk Usage Analyzer tool to check out who are eating your disk space and remove them accordingly. And here are a few tips to clean up your disk space.


[#209] Sunday, May 1, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
clegian

Total Points: 283
Total Questions: 115
Total Answers: 115

Location: Morocco
Member since Tue, Feb 2, 2021
3 Years ago
;