Pacman: Difference between revisions

From Leo's Notes
This page was last edited on 1 October 2019, at 20:42.
m formatting
Usage in table form
 
Line 1: Line 1:
Pacman is the package manager for Arch Linux.
Pacman is the package manager for Arch Linux.


== Introduction ==
== Usage ==
Configuration files are stored in {{code|/etc/pacman}}
Configuration files are stored in {{code|/etc/pacman}}


=== Updating Databases ===
{| class="wikitable"
 
! Task
Similar to a {{code|yum clean all ; yum update}} you can update the repository information by running:
! Command
{{highlight|lang=terminal|code=
|-
| Update repository metadata
| {{highlight|lang=terminal|code=
# pacman -Syy
# pacman -Syy
}}
}}
 
|-
=== Searching ===
| Install a package by name
Search for a package
| {{highlight|lang=terminal|code=
{{highlight|lang=terminal|code=
# pacman -Ss packageName
}}
 
=== Installing ===
{{highlight|lang=terminal|code=
# pacman -S packageName groupName
# pacman -S packageName groupName
}}
}}
 
|-
=== Updating System ===
| Remove a package by name
{{highlight|lang=terminal|code=
| {{highlight|lang=terminal|code=
# pacman -Syu
}}
=== Removing a Package ===
{{highlight|lang=terminal|code=
# pacman -R packageName
# pacman -R packageName
}}
}}
Line 34: Line 26:
# pacman -Rsc packageName
# pacman -Rsc packageName
}}
}}
 
|-
=== Searching for whatprovides ===
| System-wide upgrade
Install the pkgfile utilitiy
| {{highlight|lang=terminal|code=
# pacman -Syu
}}
|-
| Upgrade a package
| {{highlight|lang=terminal|code=
# pacman -Syyu packageName
}}
|-
| Search for a package
| {{highlight|lang=terminal|code=
# pacman -Ss packageName
}}
|-
| List installed packages
| {{highlight|lang=terminal|code=
# dpkg -l
}}
|-
| Determine which package provided a file
| {{highlight|lang=terminal|code=
# pacman -Qo <path to file>
}}
|-
| Determine what package provides a file
| Install the pkgfile utility
{{highlight|lang=terminal|code=
{{highlight|lang=terminal|code=
# pacman -S pkgfile
# pacman -S pkgfile
Line 49: Line 66:
core/pciutils
core/pciutils
}}
}}
|}


=== Searching Package Ownership ===
When given a path (eg. /usr/bin/startx), you can find which package provided the file by using:
{{highlight|lang=terminal|code=
# pacman -Qo /usr/bin/startx
}}


This is similar to RPM's {{code|rpm -qf /usr/bin/startx}}.


{{Navbox Linux}}[[Category:Linux]]
{{Navbox Linux}}[[Category:Linux]]
[[Category:PackageManagement]]
[[Category:PackageManagement]]

Latest revision as of 20:42, 1 October 2019

Pacman is the package manager for Arch Linux.

Usage

Configuration files are stored in /etc/pacman

Task Command
Update repository metadata
# pacman -Syy
Install a package by name
# pacman -S packageName groupName
Remove a package by name
# pacman -R packageName

With dependencies

# pacman -Rsc packageName
System-wide upgrade
# pacman -Syu
Upgrade a package
# pacman -Syyu packageName
Search for a package
# pacman -Ss packageName
List installed packages
# dpkg -l
Determine which package provided a file
# pacman -Qo <path to file>
Determine what package provides a file Install the pkgfile utility
# pacman -S pkgfile

Update the repo:

# pkgfile --update

Then to search:

# pkgfile -s lspci
core/pciutils