In advance I am sorry if similar question has been answered, but none of those solutions work for me. I am fairly new in using Ubuntu (6-7 months now) and recently whenever I start my laptop a warning pops up that my /var is low on space (it has about 100MB left). I have been going through forums and I tried to delete my snaps and some journal files but it doesn't free up a lot of space with autoremove and similar commands. I would be very thankful if someone could give me at least explanation if there is no better solution than those mention above for my problem. These are screenshots how much space I parted for /var and my screenshot of disk usage in /var. Once again, thanks for your time, much appreciated!
Asked
Active
Viewed 9,040 times
3
-
4This is a perfect example of why you shouldn't multi-partition... especially a smallish 500G disk. I can certainly give you detailed instructions on how to fix your problem, but you also have other partitions that are way too small. Best recommendation is to back up your important Ubuntu files, start over, wipe the disk, reinstall Ubuntu, without manual partitioning, restore your data. Also, if your machine is BIOS only, then continue to use MBR disk formatting... however, if your machine is UEFI, then you should use GPT disk formatting. Questions? – heynnema Mar 23 '20 at 17:16
-
1Thank you for your answer. I was running dual-boot with Windows first couple of weeks so I created these partitions manually following some instructions on how much space these certain partitions should have. I will take your advice and hopefully I won't have these types of problems anymore. Thank you so much for your time. Best of luck! – Faruk Muminovic Mar 23 '20 at 17:36
1 Answers
5
This is how you can clean /var
in Ubuntu for storage issue:
Get rid of packages that are no longer required
sudo apt-get autoremove
Uninstall unnecessary applications from your store.
Clean up APT cache in Ubuntu
sudo du -sh /var/cache/apt # see the size of cache you have sudo apt-get clean # to clean the cache
Clear
systemd
journal logsjournalctl --disk-usage # check the storage used in old logs sudo journalctl --vacuum-time=3d # to clear logs before 3 days - number before d can be changed
Remove older versions of Snap applications. Create a file by any name and
.sh
extension and paste the following script#!/bin/bash # Removes old revisions of snaps # CLOSE ALL SNAPS BEFORE RUNNING THIS set -eu LANG=C snap list --all | awk '/disabled/{print $1, $3}' | while read snapname revision; do snap remove "$snapname" --revision="$revision" done
and then make it executable using this command in terminal
chmod +x <fileName>
Run the script using
./<fileName>
.Clean the thumbnail cache
du -sh ~/.cache/thumbnails # check the thumbnails size rm -rf ~/.cache/thumbnails/* # clean the thumbnails

Kulfy
- 17,696

shubham rathod
- 51
- 1
- 2