Skip to content

u/LiteracyFanatic

In this archive from Jun 2019 to Sep 2023

7
posts
137
comments
0
media
1.1k
score

Top posts

After Arch, Windows is Pain...

So I booted into Windows for the first time in months because I needed to check that a small GUI application I had written for a client worked properly (I developed it on Arch with Avalonia a crossplatform GUI framework for dotnet). Had to wait a while for updates to finish before I could do anythin...

395 points126 comments
Open on Reddit

Top comments

pacman -Qqe | grep -v base > ~/packages.txt will create a text file in you home directory with a list of all of the packages you have explicitly installed other than base. Open the file in a text editor. Delete any packages you want to keep. When you are done, save the file. It should now contain a list of the explicitly installed packages you would like to remove. Remove them by running pacman -Rs < ~/packages.txt. If you aren't sure what a particular package does, use pacman -Qii $PACKAGE_NAME or look it up on the wiki. Be sure to leave things like Xorg/Wayland, pulseaudio, graphics drivers etc. alone unless you actually want to go through the trouble of reinstalling them.

51 points

Subscribe to arch-announce to get a heads up on updates that require manual intervention. Install mlocate and then run locate pacnew after an update to find any config files you need to tend to. rsync is a very flexible tool you can use to transfer files or create backups. I use this script to create incremental backups of my home directory to an external hard drive.

#!/bin/bash
dir="/mnt/seagate/snapshots/"
date="$(date --iso-8601=seconds)"
lastBackup="$dir/last"
newBackup="$dir/$date/"

mkdir -p "$XDG_DATA_HOME/rsync"

# Errors can be found by grepping for 'rsync:' in log file

t0="$(date +'%s')"
rsync \
    --archive \
    --partial \
    --info progress2 \
    --human-readable \
    --link-dest="$lastBackup" \
    --log-file="$XDG_DATA_HOME/rsync/log" \
    --filter "-/ $XDG_CACHE_HOME/" \
    --filter "- .local/bin/" \
    --filter "- .local/lib/" \
    --filter "-/ $XDG_DATA_HOME/Trash/" \
    --filter "-/ $XDG_DATA_HOME/manga/*/*/" \
    --filter "-/ $HOME/videos/" \
    --filter "-/ $XDG_DATA_HOME/gallery-dl/" \
    "$HOME/" \
    "$newBackup"

rm -f "$lastBackup"
# Use a relative link
ln -s "$date" "$lastBackup"
t1="$(date +'%s')"
dt="$(bc <<< "($t1 - $t0) / 60")"
notify-send --expire-time 0 "Backup completed in $dt minutes."

You could also use a file system with built in snapshotting like Btrfs. I keep all my configuration files under source control with git. I additionally keep a list of all explicitly installed packages on my system as well as customizations to system configuration files here. It contains a script which is more or less capable of rebuilding my system from the ground up. It doesn't handle the installation, just the post-install configuration. etckeeper and aconfmgr are two tools which try to automate system level configuration tracking. Neither of them fit my needs exactly, but they might work well for you. Another useful tool is downgrade which can be used to restore a previous version of a broken package.

A few more tips. Consider keeping an LTS version of the kernel installed as kernel updates do sometimes cause problems with certain hardware. Also keep a flash drive with the Arch Linux ISO or a system rescue distro on hand so that you can fix things in situations where your computer won't boot. I've also found systemd-boot to be much simpler and less error prone than GRUB for boot loading, but that's just my two cents. When you think an update broke your system, look through /var/log/pacman.log to find what has changed recently. Start at the end and work backwards. Also make good use of systemctl status and journalctl to diagnose failing services.

Although it's definitely possible to screw things up, there should very rarely if ever be a situation that requires you to wipe your hard drive and reinstall Arch. Assuming you follow the manual interventions mentioned on the mailing list, most broken things will be the result of a change you made somewhere that doesn't take effect until you restart. I've shot myself in the foot plenty of times. But tracking down the source of the problem and figuring out how to fix it will help you learn more about how your system actually works, so I thinks it's worth it in the end.

23 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.