How to use the command 'paru' (with examples)

How to use the command 'paru' (with examples)

Paru is an AUR helper and pacman wrapper, designed to help users search for, install, and update packages from the Arch User Repository (AUR). With paru, users can easily manage their AUR packages using simple and intuitive commands.

Use case 1: Interactively search for and install a package

Code:

paru package_name_or_search_term

Motivation: This use case is useful when you are looking for a specific package or want to browse through available packages in the AUR interactively. Using paru, you can easily search for packages and install them without leaving the command line.

Explanation: The paru command is followed by a package name or a search term. Paru will then search the AUR for packages matching the provided name or term. Once it finds the matching packages, it will prompt you to select the packages you want to install.

Example output:

:: Searching AUR for package_name_or_search_term...
aur/package_name  version-1  [installed: version-0] (Installed)

Use case 2: Synchronize and update all packages

Code:

paru

Motivation: This use case is convenient when you want to synchronize the package databases and update all packages on your system, including those installed from the official repositories and the AUR. Using paru, you can easily keep your system up to date with the latest package versions.

Explanation: Running just paru without any arguments will synchronize the package databases, check for updates in the official repositories and AUR, and prompt you to upgrade the packages that have newer versions available.

Example output:

:: Synchronizing package databases...
 core                  133.8 KiB  1401 KiB/s 00:00 [######################] 100%
 extra                1551.2 KiB  6.65 MiB/s 00:00 [######################] 100%
 community               5.5 MiB  8.47 MiB/s 00:01 [######################] 100%
 multilib              141.4 KiB  29.3 MiB/s 00:00 [######################] 100%
:: Starting full system upgrade...
:: Replace libsm with extra/libx11? [Y/n]
:: Replace libxpm with extra/libx11? [Y/n]
...
:: Replace package_name with aur/package_name? [Y/n]
...

:: Replace package_name with aur/package_name? [Y/n]

Use case 3: Upgrade AUR packages

Code:

paru -Sua

Motivation: This use case is helpful when you want to upgrade all AUR packages on your system. Using paru, you can easily check for updates specifically in the AUR and upgrade the AUR packages to their latest versions.

Explanation: The -Sua option tells paru to upgrade all packages installed from the AUR. Running this command will synchronize the AUR package databases and check if any AUR packages have newer versions available. It will then prompt you to upgrade the packages that have newer versions.

Example output:

:: Synchronizing package databases...
 conflict: package_name conflicts with aur/package_name
:: Starting AUR upgrade...
...
:: Replace package_name with aur/package_name? [Y/n]
...

:: Replace package_name with aur/package_name? [Y/n]

Use case 4: Get information about a package

Code:

paru -Si package

Motivation: This use case is useful when you want to retrieve information about a specific package from the AUR. Using paru, you can easily gather details such as the package description, version, license, maintained by, and much more.

Explanation: The -Si option followed by the package name tells paru to retrieve and display information about the specified package from the AUR.

Example output:

Repository      : aur
Name            : package
Version         : version-1
URL             : https://example.com/package
...
Maintainer      : John Doe <johndoe@example.com>
License         : GPL3
Description     : This is an example package.

Use case 5: Download PKGBUILD and other package source files

Code:

paru --getpkgbuild package

Motivation: This use case is handy when you want to download the PKGBUILD file and other source files of a package from the AUR or ABS. With paru, you can easily obtain the necessary files to inspect, modify, or build the package manually.

Explanation: The --getpkgbuild option followed by the package name tells paru to download the PKGBUILD file and other package source files. This command is useful if you want to look into the details of a package’s build process or access the source files for any other purpose.

Example output:

:: Downloading PKGBUILD and other source files for package...
==> Retrieving sources...
==> Making package: package version (timestamp)
...

Use case 6: Display the PKGBUILD file of a package

Code:

paru --getpkgbuild --print package

Motivation: This use case is beneficial when you want to view the contents of the PKGBUILD file for a package without downloading it. By using paru, you can conveniently display the PKGBUILD script on your terminal and inspect its contents.

Explanation: The --getpkgbuild --print options, followed by the package name, instruct paru to display the contents of the PKGBUILD file for the specified package without downloading it.

Example output:

:: Printing PKGBUILD for package...
pkgbase=package
pkgname=('package')
pkgver=version-1
...

Conclusion:

Paru is a versatile command-line tool that simplifies managing AUR packages on Arch Linux. By providing various options and intuitive commands, paru allows users to easily search, install, synchronize, and upgrade packages from the AUR. With the ability to download package source files and retrieve detailed package information, paru provides a comprehensive solution for AUR package management.

Tags :

Related Posts

How to use the command dmenu (with examples)

How to use the command dmenu (with examples)

The dmenu command is a dynamic menu that creates a menu from a text input with each item on a new line.

Read More
How to use the command "stty" (with examples)

How to use the command "stty" (with examples)

The “stty” command is used to set options for a terminal device interface.

Read More
How to use the command pbmtoxbm (with examples)

How to use the command pbmtoxbm (with examples)

This article will explain how to use the command pbmtoxbm. pbmtoxbm is a command-line tool that allows you to convert Portable Bitmap (PBM) images to X11 or X10 bitmap images.

Read More