VOOZH about

URL: https://www.tecmint.com/arch-linux-package-management/

⇱ How to Use Pacman and AUR Helpers on Arch Linux


Skip to content

Arch Linux is a powerful and flexible Linux distribution, loved by many for its simplicity and control. However, new users often find package management in Arch a bit challenging.

In this guide, we’ll focus solely on pacman, Arch’s default package manager, and AUR (Arch User Repository) helpers, tools that make managing AUR packages easier.

Let’s dive into these essential tools and learn how to make the most of them.

TecMint Weekly Newsletter
Get the Learn Linux 7 Days Crash Course free when you join 34,000+ Linux professionals reading every Thursday.
Check your email for a magic link to get started.
Something went wrong. Please try again.

What is Pacman?

Pacman is the default package manager for Arch Linux, which is designed to handle package installation, updates, and removal while resolving dependencies automatically. Pacman uses .pkg.tar.zst packages and works seamlessly with the Arch package repositories.

Key Pacman Commands

Pacman is the backbone of package management in Arch Linux and here are its most essential commands, explained simply:

1. Update Your System

The following command updates your system by synchronizing your local package database with the online repositories and installing the latest versions of all installed packages.

sudo pacman -Syu 

2. Install a Package

To install a package, use the following command to download and install a specific package from the Arch repository. Replace package_name with the name of the software you want.

sudo pacman -S package_name 

3. Remove a Package

To remove a package, use the following command to remove an installed package but keep the dependencies (files or libraries) it shares with other packages.

sudo pacman -R package_name 

4. Remove a Package with Unused Dependencies

The following command uninstalls a package along with any orphaned dependencies—files or libraries no longer used by any installed package.

sudo pacman -Rns package_name 

5. Search for a Package

To search for a package, use the following command to search the repository for a package using a keyword, which will list packages whose names or descriptions match the keyword.

pacman -Ss keyword 

6. List Installed Packages

To list all the packages installed on your system, making it easy to keep track of what’s already installed.

pacman -Q 

7. Check for Package Details

The following command gives detailed information about an installed package, including version, size, and dependencies.

pacman -Qi package_name 

8. Clear Package Cache

The following command removes outdated package files to free up space while keeping the latest versions for easy reinstallation.

sudo pacman -Sc 

What is the AUR?

The Arch User Repository (AUR) is a community-driven repository containing user-created package descriptions (PKGBUILDs). These packages are not officially supported but are widely used to access software not available in the official Arch repositories.

Managing AUR packages manually can be tedious, which is where AUR helpers come in handy.

1. Yay (Yet Another Yaourt)

Yay is one of the most popular AUR helpers, combining features of both pacman and AUR package management.

To install Yay, use:

sudo pacman -S --needed base-devel git 
git clone https://aur.archlinux.org/yay.git 
cd yay 
makepkg -si 

Update everything (including AUR packages):

yay -Syu 

Search for packages.

yay -Ss package_name 

Install an AUR package.

yay -S aur_package_name 

Remove an AUR package.

yay -R aur_package_name 

2. Paru

Paru is another excellent AUR helper known for its speed and simplicity, to install it use:

git clone https://aur.archlinux.org/paru.git 
cd paru 
makepkg -si 

Similar to Yay, use commands like.

paru -Syu 

Install an AUR package.

paru -S aur_package_name 

AUR helpers streamline the process of searching, installing, and updating AUR packages, saving you from manually building and installing them. While pacman is the go-to tool for official repositories, AUR helpers are indispensable for accessing community-driven packages.

Conclusion

Pacman and AUR helpers are essential tools for Arch Linux users. With pacman, you manage packages from official repositories efficiently, and with AUR helpers like Yay and Paru, you unlock the power of the AUR.

If this article helped, share it with someone on your team.
TecMint Weekly Newsletter
Get the Learn Linux 7 Days Crash Course free when you join 34,000+ Linux professionals reading every Thursday.
Check your email for a magic link to get started.
Something went wrong. Please try again.
TecMint has been free for 14 years. Help keep it that way.
Google AI Overviews and tools like ChatGPT have cut into search traffic for independent tech sites like TecMint. Running this site costs over $2,000 every month for hosting, infrastructure, and paying authors to keep the content accurate and tested.

If this article helped you solve a problem, consider buying a coffee. It helps keep TecMint free, supports the authors, and keeps the project going.
☕ Buy Me a Coffee
Ravi Saive
I'm Ravi Saive, an award-winning entrepreneur and founder of several successful 5-figure online businesses, including TecMint.com, GeeksMint.com, UbuntuMint.com, and the premium learning hub Pro.Tecmint.com.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Got Something to Say? Join the Discussion... Cancel reply

Free Course
Get a free Linux course before you go.
Subscribe to TecMint Weekly and get the Learn Linux 7 Days Crash Course free. Read by 34,000+ Linux professionals every Thursday.
Check your email for a magic link to get started.