Cyberithub

How to Install pacman package manager on Ubuntu 20.04 LTS (Focal Fossa)

Advertisements

In this article, I will take you through the steps to install pacman package manager on Ubuntu 20.04 LTS. As you probably know, pacman is a default package manager on Arch Linux based systems just like apt or apt-get on Debian/Ubuntu based systems and yum or dnf on RHEL/CentOS based systems. It is officially supported in Arch Linux based systems only but in case if you would like to use this package manager on other Linux distributions like Ubuntu 20.04 LTS System(in our case) then you can download and install the package manager from unofficial sources and use it at your own risk.

How to Install pacman package manager on Ubuntu 20.04 LTS (Focal Fossa)

How to Install pacman package manager on Ubuntu 20.04 LTS (Focal Fossa)

Also Read: How to count number of lines in a File from Linux Terminal

Step 1: Prerequisites

a) You should have a running Ubuntu 20.04 LTS Server.

b) You should have sudo or root access to run privileged commands.

c) You should have apt and wget utility available in your System.

 

Step 2: Update Your Server

In the first step, you need to update your package cache with all the latest available versions from Ubuntu repo using sudo apt update command as shown below. If any of the packages needs to be upgraded then you can upgrade it by using sudo apt upgrade command as shown below.

cyberithub@ubuntu:~$ sudo apt update
[sudo] password for cyberithub:
Hit:1 https://download.docker.com/linux/ubuntu focal InRelease
Hit:2 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:3 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal InRelease
Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:5 http://in.archive.ubuntu.com/ubuntu focal InRelease
Get:6 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:7 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [1,712 kB]
Get:8 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:9 http://in.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages [719 kB]
Get:10 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2,082 kB]
Get:11 http://security.ubuntu.com/ubuntu focal-security/main i386 Packages [490 kB]
Get:12 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [288 kB]
Get:13 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [722 kB]
Get:14 http://security.ubuntu.com/ubuntu focal-security/universe i386 Packages [561 kB]
Get:15 http://in.archive.ubuntu.com/ubuntu focal-updates/main Translation-en [371 kB]
Get:16 http://in.archive.ubuntu.com/ubuntu focal-updates/universe i386 Packages [692 kB]
Get:17 http://in.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [953 kB]
Fetched 8,925 kB in 5s (1,709 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done

 

Step 3: Download pacman 

Next you need to download the Debian package from GitLab using any of the file transfer utility called wget or curl.

cyberithub@ubuntu:~$ wget https://gitlab.com/trivoxel-utils/deb-pacman/uploads/460d83f8711c1ab5e16065e57e7eeabc/deb-pacman-2.0-0.deb
--2022-09-16 00:01:42-- https://gitlab.com/trivoxel-utils/deb-pacman/uploads/460d83f8711c1ab5e16065e57e7eeabc/deb-pacman-2.0-0.deb
Resolving gitlab.com (gitlab.com)... 172.65.251.78, 2606:4700:90:0:f22e:fbec:5bed:a9b9
Connecting to gitlab.com (gitlab.com)|172.65.251.78|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4288 (4.2K) [application/octet-stream]
Saving to: ‘deb-pacman-2.0-0.deb’

deb-pacman-2.0-0.deb 100%[============================================================================>] 4.19K --.-KB/s in 0.001s

2022-09-16 00:01:43 (4.45 MB/s) - ‘deb-pacman-2.0-0.deb’ saved [4288/4288]

 

Step 4: Install pacman

Once downloaded, you can install the package by using sudo dpkg -i deb-pacman-2.0-0.deb command as shown below.

cyberithub@ubuntu:~$ sudo dpkg -i deb-pacman-2.0-0.deb
Selecting previously unselected package deb-pacman.
(Reading database ... 230528 files and directories currently installed.)
Preparing to unpack deb-pacman-2.0-0.deb ...
Unpacking deb-pacman (2.0-0) ...
Setting up deb-pacman (2.0-0) ...

 

Step 5: Check Version

To verify the installation, you can check the current installed version of pacman by using pacman --version command as shown below.

cyberithub@ubuntu:~$ pacman --version

 .--.               Deb-Pacman vBeta
/ _.-' .-. .-. .-.  Copyright (C) 2020 Caden Mitchell. Project not
\ '-.  '-' '-' '-'  officially endorsed by Arch Linux. Deb-Pacman
 '--'               comes with no warranty. Use at your own risk.
                    This program may be freely redistributed under
                    the terms of the very permissive MIT license.

 

Step 6: Install a package Using pacman

Now that pacman package manager is installed in your system, it is time to test the package manager by installing a simple package like curl as shown below. To install curl package through pacman, you need to use sudo pacman -S curl command. Similarly, you can install any other packages by using sudo pacman -S <package_name> syntax.

cyberithub@ubuntu:~$ sudo pacman -S curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
curl
0 upgraded, 1 newly installed, 0 to remove and 18 not upgraded.
Need to get 161 kB of archives.
After this operation, 412 kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 curl amd64 7.68.0-1ubuntu2.13 [161 kB]
Fetched 161 kB in 1s (165 kB/s)
Selecting previously unselected package curl.
(Reading database ... 230523 files and directories currently installed.)
Preparing to unpack .../curl_7.68.0-1ubuntu2.13_amd64.deb ...
Unpacking curl (7.68.0-1ubuntu2.13) ...
Setting up curl (7.68.0-1ubuntu2.13) ...
Processing triggers for man-db (2.9.1-1) ...

 

Step 7: Remove a Package

If you would like to remove a package say curl(in our case) then you need to use sudo pacman -R curl command as shown below. Similarly, you can remove any other packages by using sudo pacman -R <package_name> syntax.

cyberithub@ubuntu:~$ sudo pacman -R curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
curl
0 upgraded, 0 newly installed, 1 to remove and 18 not upgraded.
After this operation, 412 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 230530 files and directories currently installed.)
Removing curl (7.68.0-1ubuntu2.13) ...
Processing triggers for man-db (2.9.1-1) ...

 

Step 8: Check all the available options

You can also check all the options available with pacman command using pacman --help command as shown below.

cyberithub@ubuntu:~$ pacman --help
usage: pacman <operation> [...]
operations:
pacman {-h --help}
pacman {-V --version}
pacman {-D --database} <options> <package(s)> (TODO)
pacman {-F --files} [options] [package(s)] (TODO)
pacman {-Q --query} [options] [package(s)] (TODO)
pacman {-R --remove} [options] <package(s)>
pacman {-S --sync} [options] [package(s)]
pacman {-T --deptest} [options] [package(s)] (TODO)
pacman {-U --upgrade} [options] <file(s)>

use 'pacman {-h --help}' with an operation for available options

Leave a Comment