NoCache

Table of Contents

Two Ways to Install Packages from AUR on Arch Linux/Manjaro

Cyrus Kao
Last modified on .

Just like Debian/Ubuntu's package manager apt, Arch Linux/Manjaro has its own package manager called pacman to help you install packages. But the story doesn't end there. On Arch-based Linux you can even install community-maintained packages from AUR (Arch User Repository), which is a lot like PPA (Personal Package Archive) of Ubuntu.

And in this guide we'll take Google Chrome (google-chrome) for example, showing you two ways to install packages from AUR. Including using the default package manager pacman and an easier approach with the AUR helper yay.

Prerequisites

No matter which way you choose to install the packages, first make sure the essential build tools and git are installed on your system (with --needed will skip packages already installed):

$ pacman -S --needed git base-devel

Install Packages with pacman

pacman is the default package manager for Arch-based Linux, not necessarily the preferred way for end-user but knowing how things work is never a bad thing.

Get Build Files

Find Git Clone URL from the AUR package details (in this case google-chrome):

Package details
AUR package details

Fetch the repository with git clone:

$ git clone https://aur.archlinux.org/google-chrome.git

cd into the directory that we just fetched:

$ cd google-chrome

ls to make sure the PKGBUILD file exists in the directory:

$ ls
eula_text.html  google-chrome.install  google-chrome-stable.sh  PKGBUILD  update_version.sh
Output

Build and Install Packages with makepkg

Once you are in the directory containing the PKGBUILD file of your package, build and install the package (-s will automatically install missing dependencies, -i to start the installation with pacman after being successfully built):

$ makepkg -si
==> Making package: google-chrome 97.0.4692.71-1 (Sun 09 Jan 2022 03:49:16 PM CST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading google-chrome-stable_97.0.4692.71-1_amd64.deb...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 85.6M  100 85.6M    0     0  9873k      0  0:00:08  0:00:08 --:--:-- 10.5M
  -> Found eula_text.html
  -> Found google-chrome-stable.sh
==> Validating source files with sha512sums...
    google-chrome-stable_97.0.4692.71-1_amd64.deb ... Passed
    eula_text.html ... Passed
    google-chrome-stable.sh ... Passed
==> Extracting sources...
  -> Extracting google-chrome-stable_97.0.4692.71-1_amd64.deb with bsdtar
==> Entering fakeroot environment...
==> Starting package()...
  -> Extracting the data.tar.xz...
  -> Moving stuff in place...
  -> Fixing Chrome desktop entry...
  -> Removing Debian Cron job, duplicate product logos and menu directory...
==> Tidying install...
  -> Removing empty directories...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "google-chrome"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Adding install file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: google-chrome 97.0.4692.71-1 (Sun 09 Jan 2022 03:49:36 PM CST)
==> Installing package google-chrome with pacman -U...
Output
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) google-chrome-97.0.4692.71-1

Total Installed Size:  271.50 MiB

:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring                             [################################] 100%
(1/1) checking package integrity                           [################################] 100%
(1/1) loading package files                                [################################] 100%
(1/1) checking for file conflicts                          [################################] 100%
(1/1) checking available disk space                        [################################] 100%
:: Processing package changes...
(1/1) installing google-chrome                             [################################] 100%
==> NOTE: Custom flags should be put directly in: ~/.config/chrome-flags.conf
==> NOTE: The launcher is called: 'google-chrome-stable'
Optional dependencies for google-chrome
    pipewire: WebRTC desktop sharing under Wayland [installed]
    kdialog: for file dialogs in KDE
    gnome-keyring: for storing passwords in GNOME keyring [installed]
    kwallet: for storing passwords in KWallet
:: Running post-transaction hooks...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Updating icon theme caches...
(3/3) Updating the desktop file MIME type cache...
Output

Now your package is built and installed.

Update Packages

In the directory of the package's build files, try to pull the latest files:

$ git pull
Already up to date.
Output

No update is needed in this case, otherwise repeat the process of Build and Install Packages with makepkg.

Install Packages with yay

yay (Yet another Yogurt) is an AUR helper written in Go, also one of the most popular pacman wrappers around.

Be aware of some outdated guides online using unmaintained wrappers like pacaur or yogurt.

Install yay

Install yay from AUR:

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

Install Packages

Installing packages with yay is rather simple, since it does all the dirty work for you:

$ yay -S google-chrome
:: There are 3 providers available for google-chrome:
:: Repository AUR
    1) google-chrome 2) google-chrome-beta 3) google-chrome-dev

Enter a number (default=1): ==>
:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur:1]  google-chrome-97.0.4692.71-1

:: (1/1) Downloaded PKGBUILD: google-chrome
  1 google-chrome                            (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==>
:: (1/1) Parsing SRCINFO: google-chrome
Output
==> Making package: google-chrome 97.0.4692.71-1 (Sun 09 Jan 2022 04:25:41 PM CST)
==> Retrieving sources...
  -> Downloading google-chrome-stable_97.0.4692.71-1_amd64.deb...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 85.6M  100 85.6M    0     0  9214k      0  0:00:09  0:00:09 --:--:-- 10.5M
  -> Found eula_text.html
  -> Found google-chrome-stable.sh
==> Validating source files with sha512sums...
    google-chrome-stable_97.0.4692.71-1_amd64.deb ... Passed
    eula_text.html ... Passed
    google-chrome-stable.sh ... Passed
==> Making package: google-chrome 97.0.4692.71-1 (Sun 09 Jan 2022 04:25:52 PM CST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found google-chrome-stable_97.0.4692.71-1_amd64.deb
  -> Found eula_text.html
  -> Found google-chrome-stable.sh
==> Validating source files with sha512sums...
    google-chrome-stable_97.0.4692.71-1_amd64.deb ... Passed
    eula_text.html ... Passed
    google-chrome-stable.sh ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting google-chrome-stable_97.0.4692.71-1_amd64.deb with bsdtar
==> Sources are ready.
==> Making package: google-chrome 97.0.4692.71-1 (Sun 09 Jan 2022 04:25:53 PM CST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Entering fakeroot environment...
==> Starting package()...
  -> Extracting the data.tar.xz...
  -> Moving stuff in place...
  -> Fixing Chrome desktop entry...
  -> Removing Debian Cron job, duplicate product logos and menu directory...
==> Tidying install...
  -> Removing empty directories...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "google-chrome"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Adding install file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: google-chrome 97.0.4692.71-1 (Sun 09 Jan 2022 04:26:04 PM CST)
==> Cleaning up...
Output
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) google-chrome-97.0.4692.71-1

Total Installed Size:  271.50 MiB

:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring                             [################################] 100%
(1/1) checking package integrity                           [################################] 100%
(1/1) loading package files                                [################################] 100%
(1/1) checking for file conflicts                          [################################] 100%
(1/1) checking available disk space                        [################################] 100%
:: Processing package changes...
(1/1) installing google-chrome                             [################################] 100%
==> NOTE: Custom flags should be put directly in: ~/.config/chrome-flags.conf
==> NOTE: The launcher is called: 'google-chrome-stable'
Optional dependencies for google-chrome
    pipewire: WebRTC desktop sharing under Wayland [installed]
    kdialog: for file dialogs in KDE
    gnome-keyring: for storing passwords in GNOME keyring [installed]
    kwallet: for storing passwords in KWallet
:: Running post-transaction hooks...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Updating icon theme caches...
(3/3) Updating the desktop file MIME type cache...
Output

yay will ask you which version of the package is desired when there are multiple packages with the same name (e.g. google-chrome, google-chrome-beta, google-chrome-dev).

Update Packages

Update all installed packages (yay is an alias for yay -Syu):

$ yay
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
:: Starting full system upgrade...
 there is nothing to do
:: Searching databases for updates...
:: Searching AUR for updates...
 there is nothing to do
Output

See Also

Comments

Sign in to leave a comment.