Manjaro Aperçu de Pacman

Aperçu de Pacman

From Manjaro
Revision as of 18:03, 14 November 2021 by Mioufou (talk | contribs)
Other languages:
Deutsch • ‎English • ‎français • ‎русский • ‎中文 • ‎中文(中国大陆)‎

Aperçu

Le gestionnaire de paquets de Manjaro, Pamac, est fourni avec la plupart des éditions de Manjaro. Toutes les éditions de Manjaro incluent pacman, le gestionnaire de paquets de la version amont d'Arch Linux. Pacman comprend certaines fonctionnalités avancées que l'on ne trouve pas dans Pamac.

Points clés à connaître :

  • Pacman est installé par défaut dans Manjaro Linux.
  • Pacman est principalement développé et maintenu par les développeurs d'Arch Linux
  • Pacman ne peut être utilisé qu'en ligne de commande. Si vous préférez un gestionnaire de paquets graphique, veuillez consulter Pamac ou Octopi.
  • Pacman ne peut utiliser que le dépôt officiel de Manjaro repository. Il existe des articles distincts pour accéder au Arch User Repository(AUR), pour utiliser flatpaks ou pour utiliser snaps


Mises à jour

Pour mettre à jour la base de données de paquets et tout les paquets du système

user $ sudo pacman -Syu COPY TO CLIPBOARD



Pour forcer un rafraîchissement complet de la base de données de paquets et mettre à jour tout les paquets du système. Vous devez le faire lorsque vous changez de branche ou changez de mirroir.

user $ sudo pacman -Syyu COPY TO CLIPBOARD


Pour forcer un rafraîchissement complet de la base de données de paquets, mettre à jour les paquets du système et autoriser les paquets à être rétrograder. Le rétrogradage devrait être seulement nécessaire lors d'un changement de branche. Par exemple passer de Testing à Stable

user $ sudo pacman -Syyuu COPY TO CLIPBOARD



Recherche de paquets

Pour chercher les paquets disponibles dans les dépôts de Manjaro, vous pouvez utiliser pacman -Ss mot-clé. Cela va chercher le mot-clé dans le nom du paquet et dans la description. Par exemple, pour chercher les paquets contenant le mot-clé smplayer, vous pouvez utiliser :

user $ pacman -Ss smplayer COPY TO CLIPBOARD


Vous pouvez chercher dans vos paquets installés de la même façon en utilisant -Qs à la place de -Ss. Pour chercher smplayer dans vos paquets installés :

user $ pacman -Qs smplayer COPY TO CLIPBOARD



Lorsque vous avez trouvé un paquet vous pouvez utiliser pacman -Qi pour obtenir plus d'informations sur un paquet installé ou pacman -Si pour un paquet dans un dépôt. En suivant l'exemple ci-dessus, vous pouvez utiliser :

user $ pacman -Si smplayer COPY TO CLIPBOARD



Finalement, pour obtenir la liste de tout les paquets installés sur votre système, entrez la commande suivante :

user $ pacman -Ql COPY TO CLIPBOARD



Installation de paquets

Warning
N'installez jamais un paquet sans d'abord mettre à jour le système. Sur un système en version continue, cela peut conduire à un système non amorçable.


To install a software package, the basic syntax is pacman -S packagename. However, installing a package without updating the system will lead to a partial upgrade situation so all the examples here will use pacman -Syu packagename which will install the package and ensure the system is up to date. For example, to install smplayer the command is:

user $ sudo pacman -Syu smplayer COPY TO CLIPBOARD


You will then be presented a list of software to install. You may notice this list has more packages than you requested. This is because many packages also have dependencies which are packages that must be installed in order for the software you selected to function properly.


Pacman can also directly install packages from the local system or a location on the internet. The format of that command is pacman -U packagelocation. For example, to install a copy of your package cache you could do something like:

user $ sudo pacman -U /var/cache/pacman/pkg/smplayer-19.5.0-1-x86_64.pkg.tar.xz COPY TO CLIPBOARD


Alternatively, you could get it directly from one of Manjaro's mirrors:

user $ sudo pacman -U https://mirror.alpix.eu/manjaro/stable/community/x86_64/smplayer-19.5.0-1-x86_64.pkg.tar.xz COPY TO CLIPBOARD



Warning
Lorsque vous utilisez pacman -U, il vous appartient de vous assurer que le paquet que vous installez est entièrement compatible avec votre système.


Suppression de paquets

Warning
vérifiez toujours la liste des paquets avant de confirmer lors de la suppression des paquets. Si vous ne faites pas attention, vous pouvez facilement supprimer tout votre bureau en raison de dépendances.


To remove a software package, the basic syntax is sudo pacman -R packagename. We could remove the smplayer package we installed above with:

user $ sudo pacman -R smplayer COPY TO CLIPBOARD



This will remove the package, but will leave all the dependencies behind. If you also want to remove the unneeded dependencies you could use pacman -Rsu packagename as seen in this example:

user $ sudo pacman -Rsu smplayer COPY TO CLIPBOARD



Sometimes when you try to remove a package you will not be able to because there are other packages which depend on it. You can use pacman -Rc packagename to remove a package and everything that depends on it. Be careful to heed the above warning when using this option.

user $ sudo pacman -Rc smplayer COPY TO CLIPBOARD



The most nuclear option is pacman -Rcs packagename. This will remove everything that depends on packagename and continue to do so on its dependencies. This should really only be used in exceptional circumstances such as when removing an entire desktop environment and trying not to leave anything behind.


Pacman usually also creates backup configuration files when deleting packages. To remove those, you can add n to any of the examples above. For example:

user $ sudo pacman -Rn smplayer COPY TO CLIPBOARD


user $ sudo pacman -Rsun smplayer COPY TO CLIPBOARD


user $ sudo pacman -Rcn smplayer COPY TO CLIPBOARD


Affichage et suppression des orphelins

To list all orphans, installed packages that are not used by anything else and should no longer be needed:

user $ pacman -Qdt COPY TO CLIPBOARD



To remove all the orphans:

user $ sudo pacman -Rs $(pacman -Qdtq) COPY TO CLIPBOARD



Téléchargement de paquets sans installation

In some cases it may be useful to download a package without installing. For example, to install on a different system that is not connected to the internet. This can be done with pacman -Sw packagename. For example:

user $ sudo pacman -Sw smplayer COPY TO CLIPBOARD



The package and any rerquired dependencies will be downloaded to your pacman cache at /var/cache/pacman/pkg


Déterminer quel paquet possède un fichier

It is often useful to understand which package installed a file on your system. This is easy to do with pacman using pacman -Qo /path/to/filename. For example:

user $ pacman -Qo /usr/bin/smplayer COPY TO CLIPBOARD



Nettoyage du cache

When pacman installs packages, it keeps a copy of all the old packages you have downloaded. This cache can be very useful if you have to install older packages in an emergency. However, left unchecked, this cache will grow very large over time. Systems running Pamac will already have access to its automated pacman cache cleaning functions. It is also possible to clean them manually using pacman.

To clear the cache of packages that are no longer installed, enter the following command:

user $ sudo pacman -Sc COPY TO CLIPBOARD



Otherwise, to clear the cache completely, enter the following command (and use with care):

user $ sudo pacman -Scc COPY TO CLIPBOARD



A safer way to remove old package cache files is to remove all packages except for the latest three package versions using paccache:

user $ paccache -rvk3 COPY TO CLIPBOARD



Le fichier de configuration, pacman.conf

Les paramètres de Pacman sont situées dans le fichier /etc/pacman.conf. Le propriétaire de ce fichier est root, voir this guide si vous souhaitez plus d'information sur les possibilités d'édition de ce type de fichier. On trouvera une documentation complète de ces options sur le lien Arch Linux référence ci-dessous. Cette documentation met en évidence plusieurs options particulièrement intéressantes pour les utilisateurs de Manjaro.


Note
les paramètres pacman.conf sont sensibles à la casse


Activation de la sortie couleur

Par défaut, la sortie de pacman est monochrome, mais l'activation de la sortie couleur peut faciliter la lecture si votre terminal prend en charge les couleurs. Cela peut être activé en décommentant ou en ajoutant la ligne suivante au fichier

Color

Affichage de Pacman qui mange

Si vous vous ennuyez de simplement regarder des lignes de hachage lors du téléchargement d'applications dans le terminal, pourquoi ne pas changer la barre de progression en Pacman mangeant des pilules énergétiques à la place? Pour activer ceçi, ajoutez simplement la ligne:

ILoveCandy

Dépannage

Une page distincte pour le dépannage de pacman est disponible içi.


Voir aussi

Cookies help us deliver our services. By using our services, you agree to our use of cookies.