Hacker News

ensocode
Ask HN: Arch Users – What is your long-term system maintenance routine?

Hi Community, been a happy Arch Linux user for many years, keeping up with minimal system maintenance and occasionally performing some package cleanups (using commands like pacman -Qtd).

I'm curious about your long-term system maintenance routines. What steps do you take to ensure your system stays stable and up-to-date, and how long have you managed to keep your system running smoothly without needing to reinstall?

Thanks for your insights!


pritambaral4 days ago

Been using an install from 2012. Cloned every time I moved laptops or internal storage drives. Two surviving clones, one main laptop and older laptop as home server and backup.

Haven't had to do much, really. Just regular package updates (including AUR ones) and cleanup of stale packages. The main laptop gets updates applied frequently, but the backup only once every six months / a year, except security updates (e.g., ssh, OpenSSL, the recent xz backdoor was a no-op because I hadn't ever updated the backup to a vulnerable version). Then there was the KDE 6 release recently.

Every once in a while I go through the list of every package installed and see if I should remove any. This is a no-op for most packages, since they are usually mandatory dependencies of another package, but there's always some packages I'd installed for some limited purpose that no longer applies.

I've cleaned up dead config files a few times. Especially around KDE major version updates. Not that it took up too much space or broke anything; just that I didn't want those files around.

I've kept around a bootable USB key for emergencies, but now that I think about it, I'm surprised I've never had to use it for a system rescue. There was that one time I changed my password and promptly forgot the new one. But it's been such a long time since I've used it.

hebocon4 days ago

I installed `paccache` which can automate package cleanup. I configured it to retain only the latest version and only for about a week. Everytime I update I'm notified of how much space had been freed. I don't understand why the default is to retain everything. The likelihood that I need to perform rollbacks/reinstalls without internet access is very low.

Beyond that: `pacman -Rsnc` is my "yeet" command. Check the dependent packages carefully. Safer to run this regularly to avoid a build up.

I use `paru` for an AUR helper. Cache cleared manually but could probably be automated too.

I have been running the same install for a couple years and despite my early Linux ignorance and complete abuse of my desktop by experimenting with everything I've only ever had one failed Grub boot that wasn't my own fault.

78392840233 days ago

Ah, I See You're a Man of Culture As Well

This is in my config.fish file:

  abbr -- yeet 'yay -Rns'
  abbr -- gib 'yay -S'

mksrew4 days ago

Mine is running just fine since 2022-03-10 (just checked with `btrfs subvol show /home`).

The only maintenance I do is for btrfs, which I learned the hard way one year after running the system without caring.

It's just a regular `btrfs balance` to ensure the system never run out of metadata space.

Other than that, just `pacman -Syu` and `flatpak update` whenever I feel like I want to.

I rarely clean Pacman's cache because I've been through some cases that I needed to downgrade some packages, and I always uninstall with `pacman -Rs`, so no leftover dependencies. And anything that `paru` installs as build dependencies, I uninstall right after.

freedomben4 days ago

It won't be a popular answer, but the truth is nuke and pave every so often. The problem isn't Arch itself, the problem is that I like to try new things pretty regularly, and occasionally install junk that I don't want long-term, but that I forget to clean up.

Quite a few years back I just started a bash script that stays in my dot files repo, that has all the base packages and configuration in it that I need for a new system. When it's time for a fresh install, I can run that script and have 95% of my system set up. I even include gnome settings and stuff in there using the CLI tools.

yjftsjthsd-h4 days ago

In fairness, that's not an issue with the OS - you can maintain a single install for a long time (see other comments in this thread running a continuous Arch system for over a decade), but equally nothing prevents you from accumulating mutations until it's easier to reinstall the whole thing, and Arch is probably more popular with folks who are inclined to tinker:) And to be clear, I say that without judgement - I've gotten better at not messing up my system over time, and for that matter knowing when something is likely to break things and so test in a VM or whatever, but a lot of my knowledge of how things work comes from having done terrible things to poor innocent machines. Of course, I've always been an incorrigible distro-hopper, so I always just took that as part of the lifecycle: Install shiny new OS, kick the tires, use it for a while, slowly accumulate hacks until the thing is slightly broken, then wipe and install the new shiny OS. It's just that after enough years, it takes longer and longer for it to get slightly broken:)

cookiengineer3 days ago

For this very reason I wish there was a different flag for pacman, which would allow to effectively differ between packages installed for the base system itself, and for the local packages that can be installed and wiped without bricking the system afterwards. Similar to how a rootless system works on MacOS, where restoring the OEM state involves just wiping the folders (e.g. /usr/local) with the differences that override changes to the base system.

But for that to work, we desperately need a different POSIX incompatible filesystem structure, because /etc/ has to become /local/etc or something like that.

/usr/local is theoretically there but on most distributions /sbin and others are just symbolic links these days, so they are pretty much pointless.

snapplebobapplea day ago

Pikaur -Syyu every couple days, dot files managed with yadm, replace computer every 3 or 4 years to get a fresh start.

smitty1e3 days ago

I just do `sudo pacman -Syu` more or less daily.

Thanks for posing this question, as it should prove instructive.

[deleted]4 days agocollapsed

nvy4 days ago

>been a happy Arch Linux user for many years

>how long have you managed to keep your system running smoothly without needing to reinstall?

I'm baffled as to how someone could be a happy user of a system that requires regular reinstalls to be usable/stable.

Is it that installing Arch is itself a hobby for some people?

pritambaral4 days ago

I installed Arch once, back in 2012, on my first laptop, which was the only computer I had back then.

When that laptop died I swapped the HDD into a loaner from a friend, only to swap it into a new laptop I bought a few months later.

When I grew tired of the HDD's speed, and could afford to, I bought a SATA SSD and cloned the HDD onto it.

When I upgraded to a more powerful laptop a few years ago, it didn't come with a SATA bay, so I cloned the SSD from my old laptop onto the NVMe SSD of the new one. Today, I run both laptops; the old one as a home server and backup and the new one as my main computer. Both run Arch on Wayland and KDE 6. The same Arch I installed back in 2012 with KDE 3.

bediger40004 days ago

I've used Arch for about 10 years now, and I haven't done a reinstall ever. I've moved to new hardware (laptops and servers) several times over the years, so I've done fresh installs on the new hardware. Does that count?

> a system that requires regular reinstalls to be usable/stable.

Windows 95, 98 and XP were like that, no? Those have been the standard business operating system over the years.

nvy3 days ago

>Windows 95, 98 and XP were like that, no?

I'm not sure that being on par with a 30-year old operating system is much of an accolade.

Windows sucked back then, it's just that it sucked less than DOS.

bediger40003 days ago

I've used Arch since 2012 or 2013 and never done a reinstall. I'm just mentioning that amazingly popular Standard Business Operating Systems, that virtually everyone used, loved and defended, were like that. Arch, in my experience, is not like that.

nvy3 days ago

> that virtually everyone used, loved and defended, were like that

Were you actually using Windows back in those days? Absolutely nobody loved or defended them. We used them because we had to, not because they were good.

oDot4 days ago

Your question is partly why I moved to Nix after many years with Arch -- a perpetually clean install

wasted_intel4 days ago

Yep, same. Thoroughly enjoyed Arch, but slowly accruing implicit config state means you'll eventually have to re-install and configure everything again. You can mitigate some of that with dotfiles and some hand-rolled scripts, but NixOS is effectively that "done right".

shrimp_emoji3 days ago

I haven't had problems in years on the same install. I don't understand.

wasted_intel3 days ago

Oh, Arch was rock solid and I was also able to keep my install going for years. However, in the few instances where I would get a new laptop or experience a drive failure, it was non-trivial to get it going again. If you're using a stock install + Gnome, it's not bad, but I had lots of things set up (e.g. Secure Boot, udev rules, usbguard, tiling WM, etc.) and those are all things you can declare in a NixOS + Home Manager config, have versioned, and re-establish in ~30 minutes instead of days.

timetraveller264 days ago

I use Nix BTW

sshine4 days ago

  pacman -Syu
That’s it. :)

sam_lowry_3 days ago

Indeed. I did just that on a regular basis for well over a decade.

Once in a year or two the update breaks and I have to read up the news section of archlinux.org, but it's usually not a big deal, fixable within minutes.

friend_and_foe3 days ago

i keep a list of installed packages and the package manager I used to install them. I don't track dependencies that I didn't manually install. This is manual, every time I type "pacman" or "yay" or even "pip" I write it down in a text file.

Other than that pacman -Syu every couple of weeks.

I'm probably going to start using paccache.

I've never had an arch system explode on me. I've had Debian systems do that. Using arch has been smooth sailing for me for the most part.

I_am_tiberius3 days ago

My learning is that using the lts kernel improves the situation with arch big way.

cranberryturkey4 days ago

I just do `yay -Syu` every week or so. What does `-Qtd` do?

timetraveller264 days ago

Same, also the ocassional paccache (https://wiki.archlinux.org/title/Pacman#Cleaning_the_package...). I think -Qtd list orphaned packages.

Of course all's in the wiki, some useful links:

https://wiki.archlinux.org/title/System_maintenance https://wiki.archlinux.org/title/Pacman/Tips_and_tricks

basemi4 days ago

From [0]:

> To list all packages no longer required as dependencies (orphans):

    $ pacman -Qdt
[0] https://wiki.archlinux.org/title/Pacman

cranberryturkey4 days ago

That just lists them, how do you remove them?

denysvitali3 days ago

`sudo pacman -R $(pacman -Qtd | awk '{print $1}')` ?

Am4TIfIsER0ppos3 days ago

`pacman -Qtdq` will list the package names

`pacman -R -` will read names from stdin

[deleted]4 days agocollapsed

shaneevan213 days ago

[dead]

hn-front (c) 2024 voximity
source