Difference between revisions of "Archlinux pacman"
Jump to navigation
Jump to search
| Line 3: | Line 3: | ||
==Updating the system== | ==Updating the system== | ||
$ sudo pacman -Syu | $ sudo pacman -Syu | ||
| + | Performing this weekly ensures a secure and stable system. | ||
| + | |||
==Installing a package== | ==Installing a package== | ||
$ sudo pacman -S <package> | $ sudo pacman -S <package> | ||
Revision as of 22:33, 6 May 2022
There is an extensive set of documentation for pacman. This covers a few brief but important things.
Updating the system
$ sudo pacman -Syu
Performing this weekly ensures a secure and stable system.
Installing a package
$ sudo pacman -S <package>
Removing a package
$ sudo pacman -R <package>
Installing a specific package version
If you have previously installed it
$ sudo pacman -U file:///var/cache/pacman/pkg/package-old_version.pkg.tar.type
To source it from the archives
$ sudo pacman -U https://archive.archlinux.org/packages/<prefix>/<package>/<version>
Rollback to a specific date
Back up the current mirror list
$ sudo mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.<date>
Create a new one that mirrors the desired date
$ sudo nano /etc/pacman.d/mirrorlist
Paste the desired date into the file where YYYY/MM/DD is desired rollback year/month/day:
## ## Arch Linux repository mirrorlist ## Generated on <today's date> ## Server=https://archive.archlinux.org/repos/YYYY/MM/DD/$repo/os/$arch
Save the file and then
$ sudo pacman -Syyuu
If successful, don't forget to revert the old file.
Clear the cache
If you are running out of disk space, you can clear all the archived packages from /var/lib/pacman .
$ sudo pacman -Sc
To remove all packages
$ pacman -Scc