How to Install Packages on Arch Linux

Channel: Linux
Abstract: $ sudo pacman -S yaourt Once the package has been installed$ sudo pacman -S vlc elinks Get details about installed package using -Qi $ pacman -Qi elin

Arch Linux is one of the popular Desktop Operating systems. Its main pros revolve around large community and thousands of packages that can be installed on Arch Linux, both from official repositories and from AUR. In this tutorial, we will cover how to install packages on Arch Linux. Some of the installation methods we will look at include:

  • Installing packages using official Arch package manager - Pacman
  • Installing packages from AUR

AUR is a community-driven repository for Arch Linux users. It was created with an intention to make it easy to share community packages in an organized manner.  AUR contains package descriptions called PKGBUILDs which allow you to compile a package from source with makepkg.

For you to install a package on Arch Linux from AUR, you need a helper tool which automates the process of building and installing the package. In this tutorial, we'll look at:

  • Using Yaourt
  • Using packer
  • Using aurman
1) Installing Packages on Arch Linux using Pacman

Arch Linux comes with default package manager tool called Pacman which uses tar to package applications. Pacman works seamlessly with Arch Build System. To install a package with pacman, use  -S option. The example below will install vlc and elinks packages on Arch using pacman:

$ sudo pacman -S vlc elinks

Get details about installed package using -Qi

$ pacman -Qi elinks
Name : elinks
Version : 0.13-19
Description : An advanced and well-established feature-rich text mode web
browser.
Architecture : x86_64
URL : http://elinks.or.cz
Licenses : GPL
Groups : None
Provides : None
Depends On : bzip2 expat>=2.0 gpm>=1.20.4 openssl lua51 libidn gc tre
zlib
Optional Deps : None
Required By : None
Optional For : ranger
Conflicts With : None
Replaces : None
Installed Size : 2.58 MiB
Packager : Kyle Keen <[email protected]>
Build Date : Wed 12 Jul 2017 05:56:21 AM EAT
Install Date : Sun 17 Jun 2018 01:56:25 PM EAT
Install Reason : Explicitly installed
Install Script : No
Validated By : Signature

To remove the package, use -R option

$ sudo pacman -R elinks
checking dependencies...
:: ranger optionally requires elinks: for previews of html pages

Packages (1) elinks-0.13-19

Total Removed Size: 2.58 MiB

:: Do you want to remove these packages? [Y/n] y
:: Processing package changes...
(1/1) removing elinks [##########################] 100%
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Updating the desktop file MIME type cache...

$ pacman -Qi elinks 
error: package 'elinks' was not found
2) Installing Packages on Arch Linux using yaourt

yaourt is a pacman wrapper with extended features and AUR support. The package can be installed using pacman, unlike other pacman wrappers which are mostly packages as AUR builds. yaourt depends on diffutils,  pacman>=5.0,  package-query>=1.8 and gettext.

Before you can install yaourt, you need to enable the use of community repos on Arch

$ sudo vim /etc/pacman.conf

Add below content:

[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch

Install yaourt:

$ sudo pacman -Sy yaourt

-y option is used to sync package content list.

To install a package with AUR use:

$ yaourt -S <package-name>

You can then search for packages on AUR:

$ yaourt <package-name>

E.g

$ yaourt vlc

It will give you an easy way to install the package by picking a number on the list. Input package number on the list and press <Enter> key.

3) Installing Packages on Arch Linux using packer

Packer is one of many pacman wrappers that can be used to install packages from AUR. To install packer on Arch Linux you can use another AUR helper like yaourt or build the package yourself. If you have yaourt already installed, install packer from it by running:

$ yaourt -S packer --noconfirm

The  --noconfirm is used to silence questions prompts. It will answer all for you.

The yaourt is available from official Arch repo. It can be installed with pacman:

$ sudo pacman -S yaourt

Once the package has been installed, you can start using it to manage packages on Arch Linux. One advantage of packer over AUR is that it doesn't need sudo privileges. You can do package installation and removal using your normal user account.

As an example, install elinks and vlc as we did with pacman using the commands:

$ packer -S vlc elinks

If you want to upgrade all packages including ones from the AUR:

$ packer -Syu

To remove a package, pass similar options as for pacman.

$ packer -R elinks
4) Installing Packages on Arch Linux using aurman

Aurman can be installed in two ways:

  1. Using another AUR helper - yaourt, pacaur e.t.c
  2. By manually building pkg.tar.xz and installing using pacman.

Install aurman from AUR with yaourt:

$ sudo pacman -S yaourt git
$ yaourt -S aurman

Install aurman by building pkg.tar.xz package

$ cd  /tmp
$ git clone https://aur.archlinux.org/aurman.git
Cloning into 'aurman'...
remote: Counting objects: 132, done.
remote: Compressing objects: 100% (86/86), done.
remote: Total 132 (delta 64), reused 110 (delta 46)
Receiving objects: 100% (132/132), 11.09 KiB | 1.85 MiB/s, done.
Resolving deltas: 100% (64/64), done.
$ cd aurman
$ makepkg -Acs
$ sudo pacman -U aurman-xxx.pkg.tar.xz

Installing a package manager is done by using below syntax:

$ aurman -S <package-name>

Read also:

  • netctl - Setup Wifi and Static IP on Arch Linux
  • How to Install and Use Pacaur on Arch Linux
  • How to Remind Unplug a Charging Laptop on Arch Linux
  • Beginners Arch Linux Installation Guide

In this blog post, we have covered different package management tools you can use on your Arch-based Linux distributions. This will work fine both for Desktop/Server centric Arch operating systems. For more command options, refer to each package official documentation. A great place for reference is Pacman Documentation.

Ref From: linoxide
Channels:

Related articles