Pacman usage: Difference between revisions

From wikinotes
(Created page with "= Package Management = <blockquote> installing packages <source lang="bash"> pacman -Ss <pkg> # search pacman -Qo /bin/netstat # search package containing this...")
 
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Key Management =
<blockquote>
<source lang="bash">
pacman-key --init
pacman-key --populate archlinux
pacman-key --refresh-keys
pacman -S archlinux-keyring  # arch's official keys
</source>
</blockquote><!-- Key Management -->
= Package Management =
= Package Management =
<blockquote>
== Basics ==
<blockquote>
<blockquote>
installing packages
installing packages
Line 20: Line 32:
maintenance
maintenance
<source lang="bash">
<source lang="bash">
pacman -Si <pkg>             # info
pacman -Si <pkg>                 # info
pacman -Q                   # list of all installed packages
pacman -Q                       # list of all installed packages
pacman -Rns $(pacman -Qtdq) # remove unneeded packages
pacman -Qi <pkg> | grep Required # list packages depending on this package
pacman -Sc                   # remove old packages from pkg-cache  (MAKE SURE CLEANMETHOD=KEEPCURRENT IN /ETC/PACMAN.CONF)
pacman -Qtd --color=never | awk '{ print $1 }' | xargs sudo pacman -Rsd # remove orphan packages
pacman -Sc                       # remove old packages from pkg-cache  (MAKE SURE CleanMethod=KeepInstalled IN /ETC/PACMAN.CONF (default))
</source>
</blockquote><!-- Basics -->
 
== Downloading old Packages ==
<blockquote>
=== Archlinux ===
<blockquote>
==== Manual Downloads ====
<blockquote>
Find the package you'd like to downgrade to here <code>https://archive.archlinux.org/packages/</code>.
 
Ex:
<syntaxhighlight lang="bash">
firefox https://archive.archlinux.org/packages  ## find url to package
 
pacman -U \
    https://archive.archlinux.org/packages/l/linux/linux-4.15.3-2-x86_64.pkg.tar.xz \
    https://archive.archlinux.org/packages/l/linux-headers-4.15.3-2-x86_64.pkg.tar.xz
</syntaxhighlight>
 
{{ WARNING |
Occasionally, you might need to install something to satisfy a current AUR package.
But installing the core package will break the existing AUR package dependencies.
 
You have 2x options:
 
<source lang="bash">
pacaur -S zfs-linux spl-linux -U https://...  https://..
</source>
</source>
}}
</blockquote><!-- Manual Downloads -->
=== Freeze Repo/Mirrorlist to Date ===
<blockquote>
You can now configure your repo to download packages as of a specific date!<br>
configure '''either'''
{{ expand
| <code>/etc/pacman.conf</code>
|
<syntaxhighlight lang="bash">
# /etc/pacman.conf
[core]
SigLevel = PackageRequired
Server=https://archive.archlinux.org/repos/2014/03/30/$repo/os/$arch
[extra]
SigLevel = PackageRequired
Server=https://archive.archlinux.org/repos/2014/03/30/$repo/os/$arch
[community]
SigLevel = PackageRequired
Server=https://archive.archlinux.org/repos/2014/03/30/$repo/os/$arch
</syntaxhighlight>
}}
{{ expand
| <code>/etc/pacman.d/mirrorlist</code>
|
<syntaxhighlight lang="bash">
# /etc/pacman.d/mirrorlist
Server=https://archive.archlinux.org/repos/2014/03/30/$repo/os/$arch
</syntaxhighlight>
}}
then replace all installed packages
<syntaxhighlight lang="bash">
pacman -Syyuu
</syntaxhighlight>
</blockquote><!-- Freeze Repo/Mirrorlist to Date -->
</blockquote><!-- Archlinux -->
=== Archlinux-Arm ===
<blockquote>
<source lang="bash">
# find cpu arch
uname -a
# download package for your arch
http://tardis.tiny-vps.com/aarm/packages/f/firefox/firefox-79.0.1-aarch64.tar.xz
# install
pacman -U firefox-79.0.1-aarch64.tar.xz
</source>
</blockquote><!-- Archlinux-Arm -->
</blockquote><!-- Downloading old packages -->
</blockquote><!-- Package Management -->
</blockquote><!-- Package Management -->


= Key Management =
= Configuration Management =
<blockquote>
<blockquote>
 
<syntaxhighlight lang="bash">
</blockquote><!-- Key Management -->
pacman-conf  # print current pacman config (incl. all source pacman.d entries)
</syntaxhighlight>
</blockquote><!-- Configuration Management -->

Latest revision as of 14:41, 5 November 2023

Key Management

pacman-key --init
pacman-key --populate archlinux
pacman-key --refresh-keys
pacman -S archlinux-keyring  # arch's official keys

Package Management

Basics

installing packages

pacman -Ss <pkg>            # search
pacman -Qo /bin/netstat     # search package containing this file

pacman -S  <pkg>            # install
pacman -Rs <pkg>            # uninstall with dependencies
pacman -Rsc <pkg>           # uninstall with dependencies, and packages that require this package
pacman -Rsd --nodeps <pkg>  # uninstall, allowing broken deps (useful for removing video driver)

updates

pacman -Syy          # refresh package index
pacman -Syu          # update all

maintenance

pacman -Si <pkg>                 # info
pacman -Q                        # list of all installed packages
pacman -Qi <pkg> | grep Required # list packages depending on this package
pacman -Qtd --color=never | awk '{ print $1 }' | xargs sudo pacman -Rsd  # remove orphan packages
pacman -Sc                       # remove old packages from pkg-cache  (MAKE SURE CleanMethod=KeepInstalled IN /ETC/PACMAN.CONF (default))

Downloading old Packages

Archlinux

Manual Downloads

Find the package you'd like to downgrade to here https://archive.archlinux.org/packages/.

Ex:

firefox https://archive.archlinux.org/packages   ## find url to package

pacman -U \
    https://archive.archlinux.org/packages/l/linux/linux-4.15.3-2-x86_64.pkg.tar.xz \
    https://archive.archlinux.org/packages/l/linux-headers-4.15.3-2-x86_64.pkg.tar.xz


WARNING:

Occasionally, you might need to install something to satisfy a current AUR package. But installing the core package will break the existing AUR package dependencies.

You have 2x options:

pacaur -S zfs-linux spl-linux -U https://...  https://..

Freeze Repo/Mirrorlist to Date

You can now configure your repo to download packages as of a specific date!
configure either

/etc/pacman.conf


# /etc/pacman.conf

[core]
SigLevel = PackageRequired
Server=https://archive.archlinux.org/repos/2014/03/30/$repo/os/$arch

[extra]
SigLevel = PackageRequired
Server=https://archive.archlinux.org/repos/2014/03/30/$repo/os/$arch

[community]
SigLevel = PackageRequired
Server=https://archive.archlinux.org/repos/2014/03/30/$repo/os/$arch


/etc/pacman.d/mirrorlist

# /etc/pacman.d/mirrorlist

Server=https://archive.archlinux.org/repos/2014/03/30/$repo/os/$arch

then replace all installed packages

pacman -Syyuu

Archlinux-Arm

# find cpu arch
uname -a

# download package for your arch
http://tardis.tiny-vps.com/aarm/packages/f/firefox/firefox-79.0.1-aarch64.tar.xz

# install
pacman -U firefox-79.0.1-aarch64.tar.xz

Configuration Management

pacman-conf  # print current pacman config (incl. all source pacman.d entries)