Difference between revisions of "Archlinux pacman"

From gr0x0rd
Jump to navigation Jump to search
Line 1: Line 1:
 
There is an extensive set of documentation for pacman. This covers a few brief but important things.
 
There is an extensive set of documentation for pacman. This covers a few brief but important things.
  
 +
==Updating the system==
 +
$ sudo pacman -Syu
 
==Installing a package==
 
==Installing a package==
 
  $ sudo pacman -S <package>
 
  $ sudo pacman -S <package>
 
==Removing a package==
 
==Removing a package==
 
  $ sudo pacman -R <package>
 
  $ sudo pacman -R <package>
==Updating the system==
 
$ sudo pacman -Syu
 
 
==Installing a specific package version==
 
==Installing a specific package version==
 
If you have previously installed it
 
If you have previously installed it
 
  $ sudo pacman -U file:///var/cache/pacman/pkg/package-old_version.pkg.tar.type
 
  $ sudo pacman -U file:///var/cache/pacman/pkg/package-old_version.pkg.tar.type
 
To source it from the archives
 
To source it from the archives
  $ sudo pacman -U [https://archive.archlinux.org/packages/ | https://archive.archlinux.org/packages/<prefix>/<package>/<version>]
+
  $ sudo pacman -U [https://archive.archlinux.org/packages/ 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:
 +
<pre>
 +
##                                                                             
 +
## Arch Linux repository mirrorlist                                           
 +
## Generated on <today's date>                                                     
 +
##
 +
Server=https://archive.archlinux.org/repos/YYYY/MM/DD/$repo/os/$arch
 +
</pre>
 +
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

Revision as of 22:32, 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

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