Arch Linux: My Basic Maintenance

Thought I would share this video, pretty good video imho. Does anyone have any other commands they would add to Ermanno’s basic maintenance?

Arch Linux: My Basic Maintenance

Arch Wiki Maintenance

1 Like

There is no need to yay -Syu, when only yay does the same thing. It seems that nobody read the yay manual. Or people just like typing -Syu…


What he said.

Also, at the end of the video, he mentions updating the mirrors using reflector… There is typically no need to do that on Arch, unless you notice your package download speed suddenly gets low.

But when you do it, just in case, run sudo pacman -Syyu (with two y) immediately afterwards, so that the local package database is properly synced with new mirrors.


1 Bleachbit can screw your system up - use with care.
2 Deleting the cache can cause some programs to lose functionality, rofi uses it to build a recent history, browsers can store login cookies.

I lost the will to live after that :rofl:

I have a script that I just converted to use aura, that does my maintenance:



CURR=`date +%Y%m%d`

#β•‘ Updating Mirrors β•‘
boxp "Updating Mirrors" 1 $s_colour

#β•‘ Finding fastest Arch mirror....... β•‘
boxp "Finding fastest Arch mirror......." 1 $s_colour 

if [[ "$CURR" > "$PREV" ]]; then
   	sudo reflector --verbose --latest 40 --sort rate --save /etc/pacman.d/mirrorlist &> /dev/null
	echo "Ranking repos completed."
	boxp "Mirrors have already been updated today!" 0 green

date=~/.updates/$(date +%Y-%m-%dT%H:%M)
sudo aura  -Syy
checkupdates > ~/.up.txt
actualsize=$(wc -c <"$file")

#β•‘ Repos & AUR β•‘
boxp "Repos & AUR" 1 $s_colour

sudo aura -Syu --noconfirm
sudo aura -Auax --noconfirm

if [ $actualsize -ge $minimumsize ]; then
    cp $file $date
    echo size is under $minimumsize bytes

#β•‘ Clearing Cache β•‘
boxp "Clearing Cache" 1 $s_colour
#sudo aura -Cc 3 --noconfirm
sudo aura -Cc 3 -u --noconfirm
#zsudo paccache -ruk0

#β•‘ Clear saved states - leave 5. β•‘
boxp "Clear saved states - leave 5." 1 $s_colour
sudo aura -Bc 5 --noconfirm

#β•‘ Orphans β•‘
boxp "Orphans" 1 $s_colour 
sudo aura -Oj --noconfirm

#β•‘ Dotfiles β•‘
boxp "Dotfiles" 1 $s_colour 
if [[ "$CURR" > "$PREV" ]]; then
	if test -f "$FILE"; then
   		yadm commit -am "`date`" && yadm push -u origin master
	boxp "Dotfiles have already been backed up today." 0 cyan

#β•‘ Summary β•‘
if test -f "$date"; then
	boxp "Summary" 1 red
	bat $date --pager=never

#β•‘ updatedb β•‘
boxp "Running updatedb (fork)" 1 $s_colour
sudo updatedb&

#β•‘ Finished β•‘
date +%Y%m%d > ~/.updates/runonce
boxp "Finished" 1 $s_colour

Here is an Arch clean-up on isle 5 bookmark I keep handy;

How to clean Arch Linux

But honestly, I use Stacer which also supports Arch. I mostly only use the β€˜system cleaner’ function and I have never had an issue in all the years I have used it. Flush away gigs worth of uneeded cache :poop:.


Nice, thanks for the links.

1 Like

Thanks for reminding me I noticed with the kernel updates at least that EOS downloads the kernel components far faster than Manjaro or Garuda.

Arch, EndeavourOS and Garuda all use the same mirrors, so if you configure them the same way, you should have the same speeds (at least when it comes to packages from the Arch repos). Manjaro uses its own mirrors, and they seem to be much less reliable and much slower. Also, Manjaro has this super annoying Pamac timer that messes up your mirror configuration once a week. If you’re using Manjaro, my advice is to disable that.


Hmmm - amazing how easily β€˜hand holding’ can become more like handcuffs! :grin:


Looks interesting - but missing a piece? where’s boxp() ? Or is that a zsh thing… (or do I need to create it - I have several like items in my old code toolbox (β€˜C’, Basic, Modula-2 :grin:)

Sorry, it is a quick python script:

#!/usr/bin/env python

import sys

def boxprint(Mess, nStyle, Color):

    Mess - Text string to print
    nStyle - Box style (int)
    Color - uppercase string e.g. "RED"
    Colours = {'PURPLE': '\033[1;32;35m', 'CYAN': '\033[1;32;36m', 'DARKCYAN': '\033[0;32;36m',
               'BLUE': '\033[1;34;40m', 'GREEN': '\033[1;32;40m', 'YELLOW': '\033[1;32;33m',
               'RED': '\033[1;32;31m', 'BOLD': '\033[1;37;40m', 'UNDERLINE': '\033[2;37;40m',
               'END': '\033[0;37;48m'}

    print(Colours.get(Color), end='', flush=True)
    sp = " "

    #Catch errors:
    if nStyle <= 0:
        nStyle = 0

    if nStyle > 6:
        nStyle = 6

    #Set box style:
    if nStyle == 0:
        bx = ["", "", "", "", "", ""]

    if nStyle == 1:
        bx = ["β•”", "═", "β•—", "β•‘", "β•š", "╝"]

    if nStyle == 2:
        bx = ["*", "*", "*", "*", "*", "*"]

    if nStyle == 3:
        bx = ["β”Œ", "─", "┐", "β”‚", "β””", "β”˜"]

    if nStyle == 4:
        bx = ["β•“", "─", "β•–", "β•‘", "β•™", "β•œ"]

    if nStyle == 5:
        bx = ["β•’", "═", "β••", "β”‚", "β•˜", "β•›"]

    if nStyle == 6:
        bx = ["#", "#", "#", "#", "#", "#"]

    Mess= sp + Mess + sp
    if nStyle > 0:
        print(Colours.get(Color) + bx[0] + bx[1] * len(Mess) + bx[2] + Colours.get('END'))

    print(Colours.get(Color) + bx[3] + Mess + bx[3] +Colours.get('END'))

    if nStyle > 0:
        print(Colours.get(Color) + bx[4]+ bx[1] * len(Mess) + bx[5] + Colours.get('END'))

    print(Colours.get('END'), end='', flush=True)

    clp1 = sys.argv[1].upper()
    clp1 = " "

if clp1 == " ":
    print("usage: boxp \"string\" Style Colour")
    print('e.g. boxp \"This is a message\" 1 blue')

mess = sys.argv[1]
style = int(sys.argv[2])
colour = sys.argv[3].upper()

boxprint(mess, style, colour)

I couldn’t find anything that drew simple boxes, weird ones yes :rofl:

                   / .===. \
                   \/ 6 6 \/
                   ( \___/ )
     /                                   \
    |   joan stark   |
    | |
     \_______________________ooo_________/  jgs
                    |  |  |
                    |_ | _|
                    |  |  |
                   (__/ \__)

See what I mean!!!

Then their is the simple arch way it called a terminal, Yay -Sc to clean cache
yay -Scc the delete the total cache these command also allow you to clear the yay cache as well if you want.


My system maintenance:

  • update multiple times throughout the day with no regard for arch announcements
  • ignore pacnew files till something goes wrong
  • likewise basically never reboot after updates unless i notice quirky behaviors
  • don’t touch my pacman cache directory for years at a time and wonder where all my disk space has gone
  • run yay and keep hitting enter until a package installs with no regard for the promps