Added pacman and system recovery info
This commit is contained in:
39
Arch.md
39
Arch.md
@@ -8,16 +8,22 @@ 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
|
||||
- Packages are installed with `pacman -S <package>`
|
||||
- `pacman -Syu` will update all the software on your system
|
||||
- It's worth checking the [Arch News](https://archlinux.org/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
|
||||
- [System Snapshots](ArchSetup.md#bootable-system-snapshots) can help reduce this issue by having the option to just rollback
|
||||
|
||||
#### Usage
|
||||
- Packages are installed with `pacman -S <package>`
|
||||
- `pacman -Syu` will update all the software on your system
|
||||
- `pacman -Rs <package>` will uninstall a package and its otherwise unused dependencies
|
||||
- `pacman -Qdtq | pacman -Rns -` will remove orphaned packages (was installed as a dependency but not longer needed as one)
|
||||
- Check [this wiki page](https://wiki.archlinux.org/title/Pacman/Tips_and_tricks) 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.
|
||||
@@ -48,3 +54,32 @@ This does mean that any issues are eventually caught, but as with any case of do
|
||||
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
|
||||
### Chroot
|
||||
In the case where a system is no longer bootable, it is possible to access and hopfully repair the system.
|
||||
|
||||
1. Create an Arch or Endeavour install media (Endeavour media has the bonus of being able to open a web browser at the time time)
|
||||
2. Boot into the USB (you will need to disable secure boot if enabled)
|
||||
3. From the console run `lsblk` to get a list of device and partition names names (sda, nvme0n1, ect with a trailing number for the partition number)
|
||||
4. Determine your system partitions and mount them manually, in the case of Endeavour's btrfs install it would be done like so:
|
||||
1. `mount -o subvol=@ /dev/nvme0n1p2 /mnt` (adjust to your actual disk name if different)
|
||||
2. `mount -o subvol=@home /dev/nvme0n1p2 /mnt`
|
||||
3. `arch-chroot /mnt`
|
||||
4. `mount /efi` or `mount /boot/efi` depending on where your efi partition is
|
||||
5. Begin to fix issues.
|
||||
|
||||
### Possible Issues
|
||||
#### Broken GRUB
|
||||
Sometimes you GRUB install can get messed up or remove, 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
|
||||
|
||||
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`
|
||||
2. 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`
|
||||
|
||||
Reference in New Issue
Block a user