Difference between revisions of "Pacman Overview/en"

Updating to match new version of source page
(Updating to match new version of source page)
 
(Updating to match new version of source page)
Line 11: Line 11:
* Pacman is mainly developed/maintained by Arch Linux developers
* Pacman is mainly developed/maintained by Arch Linux developers
* Pacman can only be used from the command line, if you would prefer a graphical package manager please see [[Special:MyLanguage/Pamac|Pamac]] or [[Special:MyLanguage/Octopi|Octopi]]
* Pacman can only be used from the command line, if you would prefer a graphical package manager please see [[Special:MyLanguage/Pamac|Pamac]] or [[Special:MyLanguage/Octopi|Octopi]]
* Pacman can only use the official Manjaro [[Special:MyLanguage/Repositories_and_Servers|repository]]. There are seperate articles available for accessing the [[Special:MyLanguage/Arch_User_Repository|Arch User Repository(AUR)]], using [[Special:MyLanguage/Flatpak|flatpaks]] and using [[Special:MyLanguage/Snaps|snaps]]
* Pacman can only use the official Manjaro [[Special:MyLanguage/Repositories_and_Servers|repository]]. There are separate articles available for accessing the [[Special:MyLanguage/Arch_User_Repository|Arch User Repository(AUR)]], using [[Special:MyLanguage/Flatpak|flatpaks]] and using [[Special:MyLanguage/Snaps|snaps]]




Line 17: Line 17:


To update the package database and update all packages on the system
To update the package database and update all packages on the system
sudo pacman -Syu
{{UserCmd|command=sudo pacman -Syu}}




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]].
sudo pacman -Syyu
{{UserCmd|command=sudo pacman -Syyu}}


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.
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.
sudo pacman -Syyuu
{{UserCmd|command=sudo pacman -Syyuu}}
 




Line 30: Line 31:


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:
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:
pacman -Ss smplayer
{{UserCmd|command=pacman -Ss smplayer}}


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




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
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
pacman -Si smplayer
{{UserCmd|command=pacman -Si smplayer}}




Finally, for a list of all installed packages on your system, enter the following command:
Finally, for a list of all installed packages on your system, enter the following command:
pacman -Ql
{{UserCmd|command=pacman -Ql}}




Line 50: Line 51:




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:
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:
sudo pacman -Syu smplayer
{{UserCmd|command=sudo pacman -Syu smplayer}}


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.  
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.  
Line 57: Line 58:


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:
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:
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}}


Alternatively, you could get it directly from one of Manjaro's mirrors:
Alternatively, you could get it directly from one of Manjaro's mirrors:
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 72: Line 73:


To remove a software package, the basic syntax is {{ic|sudo pacman -R packagename}}.  We could remove the smplayer package we installed above with:
To remove a software package, the basic syntax is {{ic|sudo pacman -R packagename}}.  We could remove the smplayer package we installed above with:
sudo pacman -R smplayer
{{UserCmd|command=sudo pacman -R smplayer}}




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:
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:
sudo pacman -Rsu smplayer
{{UserCmd|command=sudo pacman -Rsu smplayer}}




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.
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.
sudo pacman -Rc smplayer
{{UserCmd|command=sudo pacman -Rc smplayer}}




Line 87: Line 88:


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:
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:
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}}


=Viewing and Removing Orphans=
=Viewing and Removing Orphans=


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}}




To remove all the orphans:
To remove all the orphans:
sudo pacman -Rs $(pacman -Qdtq)
{{UserCmd|command=sudo pacman -Rs $(pacman -Qdtq)}}




Line 104: Line 105:


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:
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:
sudo pacman -Sw smplayer
{{UserCmd|command=sudo pacman -Sw smplayer}}




Line 113: Line 114:


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:
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:
pacman -Qo /usr/bin/smplayer
{{UserCmd|command=pacman -Qo /usr/bin/smplayer}}




Line 121: Line 122:


To clear the cache of packages that are no longer installed, enter the following command:
To clear the cache of packages that are no longer installed, enter the following command:
sudo pacman -Sc
{{UserCmd|command=sudo pacman -Sc}}




Otherwise, to clear the cache completely, enter the following command (and use with care):
Otherwise, to clear the cache completely, enter the following command (and use with care):
sudo pacman -Scc
{{UserCmd|command=sudo pacman -Scc}}




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




Line 164: Line 165:




[[Category:Contents Page]]
[[Category:Contents Page{{#translation:}}]]
8,131

edits