6.1 KiB
tags
| tags | |
|---|---|
|
Package Management
pacman
Info
- The package manager for Arch distributions
- Graphical Software Management tools are not compatible and the command line must be used
- It's worth checking the Arch News before running an update, or if you have any issues with an update. The Arch maintainers will always put known update issues there and how to resolve them.
- Due to the fast moving pace of Arch you should aim to update your system at least once per week
- It shouldn't be a problem if you take longer, but it helps minimize risk.
- It's usually smart to not do system updates right before you need the computer for an important task.
- System Snapshots can help reduce this issue by having the option to just rollback
Usage
- Packages are installed with
pacman -S <package> pacman -Syuwill update all the software on your systempacman -Rs <package>will uninstall a package and its otherwise unused dependenciespacman -Qdtq | pacman -Rns -will remove orphaned packages (was installed as a dependency but not longer needed as one)- Check this wiki page for more tips
pacnew
Sometimes while updating you system you may get a warning about a ".pacnew" file being created. This is because when a package updates it's default configuration file but you have changed the current config file to something other than the default pacman cannot automatically replace it with the new one.
So will keep your current config as it is and create a /path/to/config/file.pacnew file wth the new config.
Since sometimes updates bring new features that need to be configured, you should address this right away:
- Run
vimdiff /path/to/config/file /path/to/config/file.pacnewTo view the differances between the files- This requires the
vimpackage installed
- This requires the
- Edit the current config as needed to add what is missing, either directly in vimdiff or with your text editor of choice.
- Once you are happy you should delete the .pacnew file.
yay
- yay is a wrapper for pacman and uses pacman for normal package management
- yay additionally will automate the proccess of installing and updating packages from the AUR
- It functions the same but
yayis a shortcut foryay -Syu(to update the system) - Software from
aurshould not automatically be trusted (see below)- yay will ask if you want to "view diffs" when installing or updating, this is a quick way to check the pkgbuild and the differences to the new pkgbuild when updating
Arch User Repository
The AUR is a collection of packages uploaded and maintained by the Arch community, and not the offical Arch maintainers. It is a great resource as an easy way to install software not provided in the main Arch repos, but it is worth noting that anyone can upload anything, and there have been known cases of people uploading malware.
The nice thing is that the entire package format (known as the pkgbuild) is accessbale and human readable. This does mean that any issues are eventually caught, but as with any case of downloading software off the internet, sticking to well known packages with lots of eyes on them is usually a good idea. It is also a good idea to inspect the pkgbuild yourself, especially pay attention to the URLs within the file and ensure they are pointing to the correct place.
Packages in the AUR are not offically supported or considered by the Arch Maintainers when pushing updates, so if anything on your system will break from an update, it's more likely to be an AUR package.
System Recovery
Snapshot Usage
For setup see Snapshot Setup.
When you preform a system update a snapshots should automatically be created. You can also manually create snapshots from the timeshift program. In either case they can be booted into from GRUB, or activated in timeshift (see below).
If you boot into a snapshot or otherwise want to use a snapshot, first open timeshift and restore the snapshot you want to use (or are booted into) and then reboot.
This will properly restore the system to that snapshot.
Chroot
In the case where a system is no longer bootable, it is possible to access and hopfully repair the system.
- Create an Arch or Endeavour install media (Endeavour media has the bonus of being able to open a web browser at the time time)
- Boot into the USB (you will need to disable secure boot if enabled)
- From the console run
lsblkto get a list of device and partition names names (sda, nvme0n1, ect with a trailing number for the partition number) - Determine your system partitions and mount them manually, in the case of Endeavour's btrfs install it would be done like so:
mount -o subvol=@ /dev/nvme0n1p2 /mnt(adjust to your actual disk name if different)mount -o subvol=@home /dev/nvme0n1p2 /mnt/homearch-chroot /mntmount /efiormount /boot/efidepending on where your efi partition is
- Begin to fix issues.
Possible Issues
Broken GRUB
Sometimes you GRUB install can get messed up or removed, most commonly from Windows overwriting it.
Note: replace esp with the location of your efi partition (commonly /efi or /boot/efi)
First check if grubx64.efi still exists under esp/EFI/..., if it does, either delete it, or skip step 1
- Reinstall GRUB with
grub-install --target=x86_64-efi --efi-directory=esp --bootloader-id=GRUB- If you are using secure boot with shim you will need to install GRUB with the needed modules per https://wiki.archlinux.org/title/GRUB#Shim-lock
- Then remember to resign GRUB with
sbsign --key /path/to/MOK.key --cert /path/to/MOK.crt --output esp/EFI/BOOT/grubx64.efi esp/EFI/BOOT/grubx64.efi
- Regenerate the GRUB config with
grub-mkconfig -o /boot/grub/grub.cfg
Broken Kernel/initramfs
If GRUB loads but the kernel or initramfs don't and snapshots are not available you can reinstall the kernel (and regernate the initramfs) with pacman -S linux