this post was submitted on 28 Aug 2023
56 points (95.2% liked)

Arch Linux

7783 readers
23 users here now

The beloved lightweight distro

founded 4 years ago
MODERATORS
 

Hello. Please critique how I'm updating / maintaining my new Arch installation so I can fix anything I'm doing wrong. This is mostly what I could gather from the Arch wiki tailored to my system. I think I know what I'm doing - but as I've often learned, it's easy to misunderstand or overlook some things.

Step 1: perform an incremental full system backup so I have something to restore if the update borks anything. I've chosen to use the rsync command as laid out on the wiki:

sudo rsync -aAXHv --delete --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /media/linuxhdd/archrsyncbackup

I have a large hdd mounted as a secondary drive under /media/linuxhdd. It is configured to automatically mount from fstab using uuid. Both my root drive and that hdd are formatted ext4. I'm not using the -S option because I don't think I'll be using virtual machines (I have other hard drives I can make bootable). --delete is used so I maintain one current set of files for restore purposes. This keeps the copying and transfer time to a minimum. (I maintain disk images offline with a different tool - this is simply one local copy for easy restoration purposes)

Step 2: Check the Arch wiki - follow instructions for any manual steps

Step 3: once every 1-2 months, update the mirror list using reflector

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

This should sort the fastest 25 mirrors into mirrorlist. Remember to use the -Syyu option in step 6 if this step was done

Step 4: Clean the journal

sudo journalctl --vacuum-time=4weeks

This should keep 4 weeks of files.

Step 5: Clean the cache

sudo paccache -r

This should keep no more than 3 versions laying around. Once and a while, I can clean out all uninstalled packages with -ruk0 options instead.

Step 6: Upgrade Arch packages with pacman

sudo pacman -Syu

I need to watch for pacnew and pacsave files and deal with them (although I haven't seen any yet)

Step 7: Review the pacman log

nano /var/log/pacman.log

This should tell me about any warnings, errors, instructions, or other things I need to deal with.

Step 8: Remove Orphans

pacman -Qtdq | sudo pacman -Rns -

This could be recursive and needs to be run more than once. Instead, I'll just run it once every time I update. This should keep things cleaned out.

Step 9: Update AUR packages

Check the build scripts to make sure the package hasn't been taken over and that it won't run anything funny.

yay -Sua

This should update just the AUR packages

Step 10: Remove AUR orphans

yay -Yc

The wiki says this "removes unnecessary dependencies" which I believe means AUR-only orphan packages.

Step 11: Reboot

reboot

Step 12: Update flatpaks from the GUI (Gnome-->Software-->Updates)

Any mistakes? Suggestions?

Thanks!

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 3 points 1 year ago (1 children)

Yup you are 100% correct. I didn’t understand what btrfs brought to the table until i started playing around with backups. What I really need is a snapshot since my backups really are handled differently. I may reformat simply for this reason. (Or I’ll switch things up the next time I break something)

[–] [email protected] 4 points 1 year ago* (last edited 1 year ago)

i successfully switched an arch install from ext4 to btrfs.

in my case, i had 2 ssd, so i moved from one to the other, but it should work if you use one of the rsync backups.

what i did was:

  • boot from a live usb arch
  • create a btrfs partition on the new drive with all the subvolumes you need
  • mount the btrfs partition and all the subvolumes
  • rsync my system from the old drive to the new mount (https://wiki.archlinux.org/title/migrate_installation_to_new_hardware#File_copying)
  • than continue to follow the arch wiki guide, fstab will be wrong, the bootloader needs to be reinstalled. while you are chrooted into it, you will need to reinstall linux to rebuild initramfs.