« Pacman » : différence entre les versions

De Banane Atomic
Aller à la navigationAller à la recherche
 
 
(14 versions intermédiaires par le même utilisateur non affichées)
Ligne 1 : Ligne 1 :
[[Category:ArchLinux]]
[[Category:Logiciels]]
= Installer / Mettre à jour =
= Installer / Mettre à jour =
<kode lang=bash>
<kode lang=bash>
Ligne 10 : Ligne 12 :
sudo pacman -S nom_du_group --needed
sudo pacman -S nom_du_group --needed
</kode>
</kode>
<filebox fn=/etc/pacman.conf lang=ini>
# ignore packages while update
IgnorePkg = [PackageName]
</filebox>


= Désinstaller =
= Désinstaller =
Ligne 57 : Ligne 64 :
# Recherche parmi les paquets natifs (non-AUR) installés explicitement
# Recherche parmi les paquets natifs (non-AUR) installés explicitement
pacman -Qen | grep elements de la recherche
pacman -Qen | grep elements de la recherche
# explicitly-installed packages
pacman -Qe
# dependency packages
pacman -Qd


# Rechercher le paquet correspondant à un fichier
# Rechercher le paquet correspondant à un fichier
pacman -Fo /chemin/fichier.ext
pacman -F /chemin/fichier.ext
# Mise à jour de la bdd des fichiers
# Mise à jour de la bdd des fichiers
sudo pacman -Fy
sudo pacman -Fy
Ligne 69 : Ligne 81 :
pacman -Qi nom_exact_du_paquet
pacman -Qi nom_exact_du_paquet


# marquer un paquet comme installé manuellement
# change the install reason of the package to explicitly installed
pacman -D --asexplicit nom_exact_du_paquet
pacman -D --asexplicit nom_exact_du_paquet
# -D permet de modifier la BdD
# -D permet de modifier la BdD
# --asdeps change the install reason of the package to dependency


# lister les paquets installés par taille
# lister les paquets installés par taille
Ligne 85 : Ligne 98 :


# lister les paquets qui ont une dépendance vers le paquet passé en paramètre
# lister les paquets qui ont une dépendance vers le paquet passé en paramètre
expac -Q '%N' <mon_paquet>
pactree -r <pkg_name>
pactree <mon_paquet> -r
expac -Q '%N' <pkg_name>
</kode>
</kode>
* [https://wiki.archlinux.org/index.php/Pacman#Installation_reason Installation reason]


= [https://bbs.archlinux.org/viewtopic.php?pid=1694743#p1694743 Hook] =
= [https://bbs.archlinux.org/viewtopic.php?pid=1694743#p1694743 Hook] =
{{warn | {{boxx|paccache}} est disponible dans le paquet {{boxx|pacman-contrib}}}}
<filebox fn='/etc/pacman.d/hooks/clean_cache.hook' lang='ini'>
<filebox fn='/etc/pacman.d/hooks/clean_cache.hook' lang='ini'>
[Trigger]
[Trigger]
Ligne 124 : Ligne 140 :
</filebox>
</filebox>
[https://archive.archlinux.org/packages/ Archive des packages]
[https://archive.archlinux.org/packages/ Archive des packages]
= Log =
{{boxx|/var/log/pacman.log}}
== PacmanLogViewer ==
GUI pour visualiser l'historique de l'utilisation de pacman.
<kode lang=bash>
plv
# install
pacman -S pacmanlogviewer
</kode>
== [https://github.com/pbrisbin/wat wat] ==
wat reads the log file and only shows things you upgraded.
<kode lang='bash'>
# list the upgraded packages in the last full system upgrade
wat
# list the upgraded packages since the full system upgrade 3
wat 3
# list the upgraded packages between the full system upgrade 3 and 2
wat 3 2
# install wat
yay -S wat-git
</kode>


= Configuration des dépôts =
= Configuration des dépôts =
<filebox fn=/etc/pacman.conf>
<filebox fn=/etc/pacman.conf lang=ini>
# Ajout du serveur Archlinuxfr
# Ajout du serveur Archlinuxfr
[archlinuxfr]
[archlinuxfr]
Ligne 134 : Ligne 176 :


[https://www.archlinux.org/pacman/pacman.conf.5.html#_package_and_database_signature_checking SigLevel]
[https://www.archlinux.org/pacman/pacman.conf.5.html#_package_and_database_signature_checking SigLevel]
= couldn't connect to host =
Le serveur utilisé par pacman ne répond plus.<br>
Editer le fichier {{boxx|/etc/pacman.d/mirrorlist}} est décommenter d'autres serveurs.


= [https://wiki.archlinux.org/index.php?title=Pacman&redirect=no#Color_output Couleurs] =
= [https://wiki.archlinux.org/index.php?title=Pacman&redirect=no#Color_output Couleurs] =
Ligne 144 : Ligne 182 :
Color
Color
</filebox>
</filebox>
{{info | <tt>pacman-color</tt> n'est plus disponible.}}


= Outils: PacmanLogViewer =
= [https://wiki.archlinux.org/index.php/Mirrors Mirrors] =
GUI pour visualiser l'historique de l'utilisation de pacman.
{{boxx|/etc/pacman.d/mirrorlist}} contient la liste des sites contenant la liste des paquets.
Parse le fichier {{boxx|/var/log/pacman.log}}
<kode lang='bash'>
<kode lang=bash>
# refresh all package lists, useful when switching from a broken mirror to a working mirror
# installation
pacman -Syyu
pacman -S pacmanlogviewer


# lancement de la GUI
# refresh all package lists and force downgrade any potentially too-new packages to correspond to the versions offered by the new mirror
plv
pacman -Syyuu
</kode>
</kode>


= Installer un paquet *.deb =
= Installer un paquet *.deb =
<kode lang=bash>
<kode lang=bash>
yaourt dpkg
dpkg -i paquet.deb
dpkg -i paquet.deb
</kode>
</kode>
[[Category:ArchLinux]]
[[Category:Logiciels]]

Dernière version du 3 avril 2021 à 16:06

Installer / Mettre à jour

Bash.svg
# installer un paquet et ses dépendances
pacman -S nom_exact_du_paquet

# mettre à jour l'ensemble du système
pacman -Syu

# installer un groupe sans réinstaller les paquets du groupe déjà installé
sudo pacman -S nom_du_group --needed
/etc/pacman.conf
# ignore packages while update
IgnorePkg = [PackageName]

Désinstaller

Bash.svg
# supprimer un paquet et ses dépendances non-utilisées par d'autres paquets
# et non-installées directement par l'utilisateur
pacman -Rs nom_exact_du_paquet

# supprime en plus les fichiers de configuration
# sinon ces fichiers sont renommés en *.pacsave et réutilisé en cas de réinstallation
pacman -Rns nom_exact_du_paquet

# supprimer un paquet et ses dépendances non-utilisées par d'autres paquets
pacman -Rss nom_exact_du_paquet

# supprimer un paquet, ses dépendances et tous les paquets qui en dépendent
pacman -Rcs nom_exact_du_paquet

# deletes all the cached versions of each package except for the most recent 3
paccache -r
# deletes all the cached versions of each package except for the most recent 2
paccache -rk2

# remove all the cached versions of uninstalled packages
paccache -ruk0

# videz le cache des paquets inutiles. Attention plus de rollback possible des paquets installés après ça.
pacman -Sc

# liste les paquets orphelins qui peuvent être supprimés
pacman -Qdt
# supprimer tous les paquets orphelins
pacman -Rns $(pacman -Qtdq)

Rechercher

Bash.svg
# Recherche parmi les paquets non-installés
pacman -Ss elements de la recherche

# Recherche parmi les paquets installés
pacman -Qs elements de la recherche

# Recherche parmi les paquets étrangers (AUR) installés
pacman -Qm | grep elements de la recherche

# Recherche parmi les paquets natifs (non-AUR) installés explicitement
pacman -Qen | grep elements de la recherche

# explicitly-installed packages
pacman -Qe
# dependency packages
pacman -Qd

# Rechercher le paquet correspondant à un fichier
pacman -F /chemin/fichier.ext
# Mise à jour de la bdd des fichiers
sudo pacman -Fy

Astuces

Bash.svg
# informations d'un paquet
pacman -Qi nom_exact_du_paquet

# change the install reason of the package to explicitly installed
pacman -D --asexplicit nom_exact_du_paquet
# -D permet de modifier la BdD
# --asdeps change the install reason of the package to dependency

# lister les paquets installés par taille
pacman -Qi | awk '/^Nom/ {pkg=$3} /Taille/ {print $4$5,pkg}' | sort -n
pacman -Qi | awk '/^Name/ {pkg=$3} /Installed Size/ {print $4$5,pkg}' | sort -h

# lister les paquets explicitement installés, triés par historique d'installation
pacman -Qei | awk '/^Nom/ {pkg=$3} /^Installé/ {print $5,$6,$7,"- "pkg}' | sort -k 3,3 -k 2M -k 1
pacman -Qei | awk '/^Name/ {pkg=$3} /^Install Date/ {print $5,$6,$7,$8,$9,"- "pkg}' | sort -k 3,3 -k 2,2M -k 1,1 -k 5,5

# lister les paquets explicitement installés et qui ne sont pas dans base ni base-devel
pacman -Qei | awk '/^Name/ { name=$3 } /^Groups/ { if ( $3 != "base" && $3 != "base-devel" ) { print name } }'

# lister les paquets qui ont une dépendance vers le paquet passé en paramètre
pactree -r <pkg_name>
expac -Q '%N' <pkg_name>

Hook

paccache est disponible dans le paquet pacman-contrib
/etc/pacman.d/hooks/clean_cache.hook
[Trigger]
Operation = Upgrade
Type = Package
Target = *

[Action]
Description = Cleaning the pacman cache
When = PostTransaction
Exec = /usr/bin/paccache -r
/etc/pacman.d/hooks/remove_uninstalled_pkg_from_cache.hook
[Trigger]
Operation = Remove
Type = Package
Target = *

[Action]
Description = Remove all the cached versions of uninstalled packages
When = PostTransaction
Exec = /usr/bin/paccache -ruk0

Downgrade

Bash.svg
# installez une version antérieure
pacman -U /var/cache/pacman/pkg/mon_paquet.pkg.tar.xz

Empêcher la mise à jour d'un paquet lors de la mise à jour globale du système

/etc/pacman.conf
IgnorePkg = pcre gimp

Archive des packages

Log

/var/log/pacman.log

PacmanLogViewer

GUI pour visualiser l'historique de l'utilisation de pacman.

Bash.svg
plv

# install
pacman -S pacmanlogviewer

wat

wat reads the log file and only shows things you upgraded.

Bash.svg
# list the upgraded packages in the last full system upgrade
wat
# list the upgraded packages since the full system upgrade 3
wat 3
# list the upgraded packages between the full system upgrade 3 and 2
wat 3 2

# install wat
yay -S wat-git

Configuration des dépôts

/etc/pacman.conf
# Ajout du serveur Archlinuxfr
[archlinuxfr]
SigLevel = Optional TrustedOnly
Server = http://repo.archlinux.fr/$arch

SigLevel

Couleurs

/etc/pacman.conf
# Misc options
Color

Mirrors

/etc/pacman.d/mirrorlist contient la liste des sites contenant la liste des paquets.

Bash.svg
# refresh all package lists, useful when switching from a broken mirror to a working mirror
pacman -Syyu

# refresh all package lists and force downgrade any potentially too-new packages to correspond to the versions offered by the new mirror
pacman -Syyuu

Installer un paquet *.deb

Bash.svg
dpkg -i paquet.deb