Skip to content

Instantly share code, notes, and snippets.

@valyakuttan
Last active March 25, 2021 16:42
Show Gist options
  • Save valyakuttan/da6a5aca8158abda7447b7f129f002c3 to your computer and use it in GitHub Desktop.
Save valyakuttan/da6a5aca8158abda7447b7f129f002c3 to your computer and use it in GitHub Desktop.
Arch Linux Cheat Sheet

Arch Linux Cheat Sheet

How to restore all packages to a specific date

Replace your /etc/pacman.d/mirrorlist with the following content:
##                                                                              
## Arch Linux repository mirrorlist                                             
## Generated on 2021-03-25                                                      
##
Server=https://archive.archlinux.org/repos/2021/03/25/$repo/os/$arch
Then update the database and force downgrade:
$ sudo pacman -Syyuu
If you get errors complaining about corrupted/invalid packages due to
PGP signature, try to first update separately archlinux-keyring and ca-certificates
$ sudo pacman -S archlinux-keyring
$ sudo pacman -S ca-certificates
Alternatively, you can decide to temporarily disable signature checking altogether
by editing /etc/pacman.conf and uncomment the following line under [options]
SigLevel = Never

Disk Encryption using gocryptfs

Installation
$ sudo pacman -S gocryptfs
Usage

Setup an encrypted directory in current directory

$ mkdir cipher plain
$ gocryptfs -init cipher
$ gocryptfs cipher plain

To unmount the fuse file system at mountdir

$ fusermount -u mountdir

Arch Linux commands to perform administrative tasks

To list block devices

$ lsblk -l

To change the attributes of a file

$ sudo chatter +i foo.bar # will make foo.bar immutable
$ sudo chatter -i foo.bar # will remove the immutable attribute
$ lsattr foo.bar # list the file attributes

To get a list of last installed or upgraded packages

$ grep -iE 'installed|upgraded' /var/log/pacman.log

Unprivileged containers in Arch Linux

$ sudo pacman -S lxc arch-install-scripts
$ sudo sh -c 'echo "kernel.unprivileged_userns_clone=1" > /etc/sysctl.d/80-lxc-userns.conf'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment