Cleaning up and freeing disk space

it appears to me that my Manjaro installation has grown fat overtime, and I was wondering if there is any efficient way to put it into an intensive diet.
Where should I start from?

p.s: wonderful new forum, it’ a shame my old posts got vaporized in the sea of bits, but hey stuff happens

edit: since there wasn’t a single solution, I grouped the procedure that solved the problem for me


Run the following commands in sequence:

Blockquote
sudo pacman -Sc
sudo pacman -Qdt
sudo pacman -Rns $(pacman -Qtdq)
sudo journalctl --vacuum-size=50M

5 Likes

In what way?
If you consider it ‘fat’ you must have a reason?

(also … as things like ‘minimal’ editions exist … are you referring to those as well?)

Perhaps a little cleanup?

yes, disk usage :slight_smile: although I understand that with years passing the files somehow got fatter and fatter for reasons that are beyond my understanding, I think that maybe there are still ways to get rid of most of them. I opened this thread to discover how :smiley:

this definitely seems like a good starting point…

Then maybe its worth finding things you dont use.
Extra software.
SNAPs for example take a lot of space… and the whole framework is a waste if you dont use it.

I tried to take a look in the “add/remove software” section but there is nothing resembling “SNAPs”… there is a chance I am doing something wrong of course xD

Indeed. So do FATpaks. :grinning:

I use Octopi CacheCleaner
image
At least I leave N versions in case I detected a problem in a recent package.

Regards
Mr. E



Addition:
Also, I periodically check that my partitions have enough space with

df -h

taking care that my “/” partition doesn’t fill up, and don’t neglect the “/home” either … terrible things happen with the first one and let’s not even talk about the second one.

image

2 Likes

For regular packages … lets sort you a list

pacman -Qi | egrep '^(Name|Installed)' | cut -f2 -d':' | paste - - | column -t | sort -nrk 2 | grep MiB | less 

Look through that (exit less with Q)…

3 Likes

Long ago I was running ubuntu and one day I decided to check if the packages I install with programs are uninstalled with the program. I was shocked to find out half of them were still there.
So I got the habit, I always reinstall after a certain amount of time.

These crazy orphans find new foster parents in the system and they stay. I don’t want to remove all optional dependencies either.
Is there a way to make sure my system stays completely the same after install/remove?

No … that isnt how package management works.

Maybe you are referring to files in your home directory ?
In which case … again … this is how package management works … it wont touch your home.
You dont want something like ‘windoze update - delete saved documents’

macintosh.js-bin                                 825.79   MiB

But… it’s fun! I don’t wanna clean my room! :stuck_out_tongue_winking_eye:

1 Like

oh wow.
Oregon Trail is already available online … but for some reason this got me itchy all over again.

(also mac+js … dirty dirty dirty. :laughing: )

What i mean to say, i install a program
Then i remove it
Then i run
pacman -Rns $(pacman -Qtdq)

Will there be any left over? Cause i really feel like i do. On ubuntu i remember uninstalling packages one by one cause commands i ran would not uninstall them.

But … thats weird.
You dont need to remove orphans after properly removing a package.
If you have no orphans, then do paman -Rns firefox … you still wont have any orphans afterwards.
Thats the whole point of s in that command … to recursively remove packages that are no longer required by anything else when you uninstall the item in the command.
It wont get things like what FF stored in ~/.cache

Furthermore … I heavily suggest not simply running that command.
Check for orphans preriodically if you like, sure (pacman -Qtdq) but dont just blindly remove.

This isnt ubuntu. One of the biggest reasons to use Arch over Ubuntu is the package management.

1 Like

So to follow up on the idea of finding big folders in your home (like seeing if your .cache is huge) then you can run this from your home directory:

du -sch .[!.]* * | sort -h | tail -n20

But … I had the impression you were talking about a new install being ‘bigger’.
In which case I also suggest using Architect and/or one of the minimal editions.
Thats what I would use … and then remove and add software according to my liking.
This will be the case for any system you install unless you tune/build/make/etc from the ground up.

1 Like

Ha ha …well how about this then. :stuck_out_tongue:

3 posts were split to a new topic: 13 Emojis per user post response

I applied some of the procedures recommended here but I am unsatisfied with the result :frowning:
maybe the only solution at this point is really Architect… I will tinker with it on a laptop, and then decide what to do.

Thanks all for the precious help!