Difference between revisions of "Pacman Overview"

Applied templates to commands
m (Typo correction: replaces "seperate" with "separate".)
(Applied templates to commands)
Line 28: Line 28:
To force a full refresh of the package database and update all packages on the system. You must do this when [[Special:MyLanguage/Switching_Branches|switching branches]] or [[Special:MyLanguage/Pacman-mirrors|switching mirrors]].
To force a full refresh of the package database and update all packages on the system. You must do this when [[Special:MyLanguage/Switching_Branches|switching branches]] or [[Special:MyLanguage/Pacman-mirrors|switching mirrors]].
</translate>
</translate>
sudo pacman -Syyu
{{UserCmd|command=sudo pacman -Syyu}}


<translate>
<translate>
<!--T:8-->
<!--T:8-->
To force a full refresh of the package database, update all packages on the system and allow packages to be downgraded.  Downgrading should be only be needed when switching to an older branch.  For example, switching from Testing to Stable.</translate>
To force a full refresh of the package database, update all packages on the system and allow packages to be downgraded.  Downgrading should be only be needed when switching to an older branch.  For example, switching from Testing to Stable.</translate>
sudo pacman -Syyuu
{{UserCmd|command=sudo pacman -Syyuu}}




Line 41: Line 41:
<!--T:10-->
<!--T:10-->
To search the Manjaro repositories for available packages you can use the command {{ic|pacman -Ss keyword}}. It will search both the package name and the description for the keyword.  For example, to search for packages containing the keyword smplayer you could use:</translate>
To search the Manjaro repositories for available packages you can use the command {{ic|pacman -Ss keyword}}. It will search both the package name and the description for the keyword.  For example, to search for packages containing the keyword smplayer you could use:</translate>
pacman -Ss smplayer
{{UserCmd|command=pacman -Ss smplayer}}


<translate><!--T:11--> You can search your installed packages in the same manner using {{ic|-Qs}} instead of {{ic|-Ss}}.  To search your installed packages for smplayer:</translate>
<translate><!--T:11--> You can search your installed packages in the same manner using {{ic|-Qs}} instead of {{ic|-Ss}}.  To search your installed packages for smplayer:</translate>
pacman -Qs smplayer
{{UserCmd|command=pacman -Qs smplayer}}




<translate><!--T:12--> Once you have found a package you can use {{ic|pacman -Qi}} to get more information about an installed packages or {{ic|pacman -Si}} for packages in the repos.  Following the example above you could use</translate>
<translate><!--T:12--> Once you have found a package you can use {{ic|pacman -Qi}} to get more information about an installed packages or {{ic|pacman -Si}} for packages in the repos.  Following the example above you could use</translate>
pacman -Si smplayer
{{UserCmd|command=pacman -Si smplayer}}




<translate><!--T:13--> Finally, for a list of all installed packages on your system, enter the following command:</translate>
<translate><!--T:13--> Finally, for a list of all installed packages on your system, enter the following command:</translate>
pacman -Ql
{{UserCmd|command=pacman -Ql}}




Line 64: Line 64:


<!--T:16-->
<!--T:16-->
To install a software package, the basic syntax is {{ic|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 {{ic|pacman -Syu packagename which will install the package and ensure the system is up to date}}.  For example, to install smplayer the command is:</translate>
To install a software package, the basic syntax is {{ic|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 {{ic|pacman -Syu packagename}} which will install the package and ensure the system is up to date.  For example, to install smplayer the command is:</translate>
sudo pacman -Syu smplayer
{{UserCmd|command=sudo pacman -Syu smplayer}}


<translate>
<translate>
Line 74: Line 74:
<!--T:18-->
<!--T:18-->
Pacman can also directly install packages from the local system or a location on the internet.  The format of that command is {{ic|pacman -U packagelocation}}.  For example, to install a copy of your package cache you could do something like:</translate>
Pacman can also directly install packages from the local system or a location on the internet.  The format of that command is {{ic|pacman -U packagelocation}}.  For example, to install a copy of your package cache you could do something like:</translate>
sudo pacman -U /var/cache/pacman/pkg/smplayer-19.5.0-1-x86_64.pkg.tar.xz
{{UserCmd|command=sudo pacman -U /var/cache/pacman/pkg/smplayer-19.5.0-1-x86_64.pkg.tar.xz}}


<translate><!--T:19--> Alternatively, you could get it directly from one of Manjaro's mirrors:</translate>
<translate><!--T:19--> Alternatively, you could get it directly from one of Manjaro's mirrors:</translate>
sudo pacman -U https://mirror.alpix.eu/manjaro/stable/community/x86_64/smplayer-19.5.0-1-x86_64.pkg.tar.xz
{{UserCmd|command=sudo pacman -U <nowiki>https://mirror.alpix.eu/manjaro/stable/community/x86_64/smplayer-19.5.0-1-x86_64.pkg.tar.xz</nowiki>}}




Line 93: Line 93:
<!--T:23-->
<!--T:23-->
To remove a software package, the basic syntax is {{ic|sudo pacman -R packagename}}.  We could remove the smplayer package we installed above with:</translate>
To remove a software package, the basic syntax is {{ic|sudo pacman -R packagename}}.  We could remove the smplayer package we installed above with:</translate>
sudo pacman -R smplayer
{{UserCmd|command=sudo pacman -R smplayer}}




<translate><!--T:24--> This will remove the package, but will leave all the dependencies behind.  If you also want to remove the unneeded dependencies you could use {{ic|pacman -Rsu packagename}} as seen in this example:</translate>
<translate><!--T:24--> This will remove the package, but will leave all the dependencies behind.  If you also want to remove the unneeded dependencies you could use {{ic|pacman -Rsu packagename}} as seen in this example:</translate>
sudo pacman -Rsu smplayer
{{UserCmd|command=sudo pacman -Rsu smplayer}}




<translate><!--T:25--> 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 {{ic|pacman -Rc packagename}} to remove a package and everything that depends on it.  Be careful to heed the above warning when using this option.</translate>
<translate><!--T:25--> 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 {{ic|pacman -Rc packagename}} to remove a package and everything that depends on it.  Be careful to heed the above warning when using this option.</translate>
sudo pacman -Rc smplayer
{{UserCmd|command=sudo pacman -Rc smplayer}}




Line 110: Line 110:
<!--T:27-->
<!--T:27-->
Pacman usually also creates backup configuration files when deleting packages. To remove those, you can add {{ic|n}} to any of the examples above.  For example:</translate>
Pacman usually also creates backup configuration files when deleting packages. To remove those, you can add {{ic|n}} to any of the examples above.  For example:</translate>
sudo pacman -Rn smplayer
{{UserCmd|command=sudo pacman -Rn smplayer}}
sudo pacman -Rsun smplayer
{{UserCmd|command=sudo pacman -Rsun smplayer}}
sudo pacman -Rcn smplayer
{{UserCmd|command=sudo pacman -Rcn smplayer}}


<translate>
<translate>
Line 119: Line 119:
<!--T:29-->
<!--T:29-->
To list all ''orphans'', installed packages that are not used by anything else and should no longer be needed:
To list all ''orphans'', installed packages that are not used by anything else and should no longer be needed:
pacman -Qdt
{{UserCmd|command=pacman -Qdt}}




<!--T:30-->
<!--T:30-->
To remove all the orphans:</translate>
To remove all the orphans:</translate>
sudo pacman -Rs $(pacman -Qdtq)
{{UserCmd|command=sudo pacman -Rs $(pacman -Qdtq)}}




Line 132: Line 132:
<!--T:32-->
<!--T:32-->
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 {{ic|pacman -Sw packagename}}.  For example:</translate>
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 {{ic|pacman -Sw packagename}}.  For example:</translate>
sudo pacman -Sw smplayer
{{UserCmd|command=sudo pacman -Sw smplayer}}




Line 144: Line 144:
<!--T:35-->
<!--T:35-->
It is often useful to understand which package installed a file on your system.  This is easy to do with pacman using {{ic|pacman -Qo /path/to/filename}}.  For example:</translate>
It is often useful to understand which package installed a file on your system.  This is easy to do with pacman using {{ic|pacman -Qo /path/to/filename}}.  For example:</translate>
pacman -Qo /usr/bin/smplayer
{{UserCmd|command=pacman -Qo /usr/bin/smplayer}}




Line 155: Line 155:
<!--T:38-->
<!--T:38-->
To clear the cache of packages that are no longer installed, enter the following command:</translate>
To clear the cache of packages that are no longer installed, enter the following command:</translate>
sudo pacman -Sc
{{UserCmd|command=sudo pacman -Sc}}




<translate><!--T:39--> Otherwise, to clear the cache completely, enter the following command (and use with care):</translate>
<translate><!--T:39--> Otherwise, to clear the cache completely, enter the following command (and use with care):</translate>
sudo pacman -Scc
{{UserCmd|command=sudo pacman -Scc}}




<translate><!--T:40--> A safer way to remove old package cache files is to remove all packages except for the latest three package versions using {{ic|paccache}}:</translate>
<translate><!--T:40--> A safer way to remove old package cache files is to remove all packages except for the latest three package versions using {{ic|paccache}}:</translate>
paccache -rvk3
{{UserCmd|command=paccache -rvk3}}




Moderators, translator
262

edits