Recommended EndevourOS System Maintenance

Hello!

I was just wondering if there is any recommended system maintenance to consider / do with an Arch Based distro like EndevourOS.

I mostly thinking about simple stuff like everyone once in a while run yay -Yc to clean up unused dependencies. That’s really the only maintenance I know about, so there must be more things I should do. :smiley:

I would love to hear more such recommendations that I should add to my monthly system maintenance day. :slight_smile: E.G. folders to backup, files that should be backed up, terminal commands, things that can and should be automated, etc.

1 Like

You need to manage the pacman cache or it will grow infinitely large over time.

https://wiki.archlinux.org/index.php/Pacman#Cleaning_the_package_cache

You also want to keep an eye on pacnew/pacsave files

https://wiki.archlinux.org/index.php/Pacman/Pacnew_and_Pacsave

6 Likes

My easy solution for the paccache is to create an alias that automatically trim the cache during updates. For example.

Edit: To be fair, I actually think that there not being an automatic flag for pacman that does it puzzling.

4 Likes

So just do a paccache -r , weekly/monthly?

2 Likes

Sure, you could do that.

It is more a personal preference thing about how often to do it. If you aren’t tight on disk space, I wouldn’t se any reason to do it more often than once per month.

2 Likes

Thanks to both of you. I didn’t know about this and, what the heck, it doesn’t seem to hurt anything to do it. I just freed up 2.71 GB on my computer.

Lawrence

1 Like

Having cache can be very handy, it allows you downgrade packages easily and re-install them without having to download them again.
I remember at the beginning of my Arch career (lol), I accidentally removed Network Manager and was left with my network not working. I wish I knew there’s such thing as pacman cache… Had to learn how to set up my network by other means, it was a nice experience after all :slight_smile:

3 Likes

Interesting. How do you actually use the cache to downgrade or for anything else? And where do you find it?

Thank you.

Lawrence

The cache is in /var/cache/pacman/pkg. To reinstall or downgrade something you can simply do sudo pacman -U /var/cache/pacman/pkg/package.tar.xz.
If you want to downgrade you just choose an older version (that’s why it is useful to keep some “old” cache).

3 Likes

You can also use the command downgrade if you have it installed. It will read both your cache and the Arch archives if they are available.

3 Likes

Thanks to both of you for this information. The longer I stay on this forum, the more I learn. This is by far the best forum in which I have ever participated. Everyone here is most helpful.

Thank you both again - and everyone else too.

Lawrence

4 Likes

The thought just occurred to me: if I downgrade using either of these methods, will they downgrade everything that can be downgraded or just what I want (or need to be) downgraded?

Lawrence

The latter. If you do it manually via pacman -U, you point it at a single package. If you do it via downgrade, you actually would type downgrade packagename.

That being said, be aware that downgrading packages is inherently risky no matter how you do it. Downgrade the wrong package and your system might not boot.

2 Likes

THANK YOU AGAIN very much!

Lawrence

3 Likes

It’s not a coincidence that this forum often is said to be the best and friendliest Arch forum around. :smile:

8 Likes

The problem with the cache is that Arch never trims it by default. At all.
So you can actually fill up your drive with 50 copies of every package.

Now, I auto-clean my cache so it always keep one backup copy of every upgraded package. Very rarely you will ever need to downgrade more than one version. And if you do, I also run daily backups with Timeshift so…

2 Likes

Now, I auto-clean my cache so it always keep one backup copy of every upgraded package

Would you mind telling me how you do that? Sounds like a really good thing to have automated like that. :slight_smile:

2 Likes

Edit: Post corrected.

I just made an alias. A lot of people create pacman hooks and what not but an alias is just must simplier. I use Fish shell so the actual creation of the alias is a bit different but here are the commands it runs, automatic first refreshing the mirror list, rank mirror list, update, update AUR then trim. First the alias that refreshes the mirror and then the alias that combine that with the trimming (basically having an Alias call and Alias):

sudo reflector --verbose --protocol https --latest 20 --sort rate --save /etc/pacman.d/mirrorlist

This is the code for my alias “mirrors” that creates a mirror list of the 20 latest updated mirrors in the world at the moment ranked on speed.

mirrors && sudo pacman -Syyu && yay -Syyua && sudo paccache -rk 2

This is the alias “update”; first it runs the alias mirrors above, combine it with a pacman and yay complete system upgrade (I know yay can do it all, but…) and then the last command trims the paccache.
The -rk flag determins how many backup copies are saved. Default, if you don’t use the flag, it saves 3. That seems exsessive to me so I run it with the -rk 2 to only keep one backup.

4 Likes

But that means only the latest version will be saved, so if an update caused problems you won’t be able to downgrade…

paccache also has a timer which will run weekly by default. Can be activated with systemctl enable paccache.timer :nerd_face:

7 Likes

No, it means it keeps one additional copy. From the Arch wiki:
"You can also define how many recent versions you want to keep. To retain only one past version use:

#paccache -rk1"

2 Likes