Table of Contents
In this article, we will see how to install pacman package manager on Ubuntu 22.04 LTS. pacman is a free and open source utility used for managing packages in Linux based systems or rather I should say in Arch Linux based systems. It is used for adding, removing and upgrading packages in the system. pacman maintains a text based package database for all the installed packages. It allows you to query the database to get information about the installed packages.
It can handle dependencies automatically and can download and install packages from remote server quite easily. Since official pacman package manager is only available for Arch Linux based systems, so it is not possible to install the official one on Ubuntu/Debian based systems. Instead we need to install an unofficial pacman package manager from GitLab using the steps explained in below section.
How to Install pacman package manager on Ubuntu 22.04 LTS
Also Read: How to Install zlib package on Ubuntu 22.04 LTS (Jammy Jellyfish)
Step 1: Prerequisites
a) You should have a running Ubuntu 22.04 LTS
Server.
b) You should have sudo
or root
access to run privileged commands.
c) You should have apt
or apt-get
utility available in your System.
d) You should have wget
and dpkg
utility available in your System.
Step 2: Update Your Server
It is important to first check all the available updates and install them from default Ubuntu repo by using sudo apt update && sudo apt upgrade
command to avoid any broken package dependencies and other related issues during installation of new packages in the system.
cyberithub@ubuntu:~$ sudo apt update && sudo apt upgrade
[sudo] password for cyberithub:
Hit:1 http://in.archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://in.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:3 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Hit:4 https://artifacts.elastic.co/packages/8.x/apt stable InRelease
Hit:5 https://dl.google.com/linux/chrome/deb stable InRelease
Get:6 http://in.archive.ubuntu.com/ubuntu jammy-backports InRelease [109 kB]
Get:7 http://security.ubuntu.com/ubuntu jammy-security/main amd64 DEP-11 Metadata [42.8 kB]
Get:8 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 DEP-11 Metadata [39.8 kB]
Get:9 http://in.archive.ubuntu.com/ubuntu jammy-updates/main i386 Packages [471 kB]
Get:10 http://in.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [894 kB]
Get:11 http://in.archive.ubuntu.com/ubuntu jammy-updates/main amd64 DEP-11 Metadata [100 kB]
Get:12 http://in.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 DEP-11 Metadata [288 kB]
Get:13 http://in.archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 DEP-11 Metadata [940 B]
Get:14 http://in.archive.ubuntu.com/ubuntu jammy-backports/main amd64 DEP-11 Metadata [4,920 B]
Get:15 http://in.archive.ubuntu.com/ubuntu jammy-backports/universe amd64 DEP-11 Metadata [15.5 kB]
Fetched 2,195 kB in 22s (102 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
................................................................
Step 3: Download pacman
You need to visit GitLab website and download the latest available version of deb-pacman
package using wget
utility as shown below. It will download the debian package in current working directory.
cyberithub@ubuntu:~$ wget https://gitlab.com/trivoxel/utilities/deb-pacman/uploads/9f716f95c66cd90e65157773d6dea05b/deb-pacman_1.0-0.deb --2023-08-20 15:37:45-- https://gitlab.com/trivoxel/utilities/deb-pacman/uploads/9f716f95c66cd90e65157773d6dea05b/deb-pacman_1.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: 1892 (1.8K) [application/octet-stream] Saving to: ‘deb-pacman_1.0-0.deb’ deb-pacman_1.0-0.deb 100%[============================================================================>] 1.85K --.-KB/s in 0s 2023-08-20 15:37:46 (18.6 MB/s) - ‘deb-pacman_1.0-0.deb’ saved [1892/1892]
Step 4: Install pacman
After downloading the package, you can install it by using sudo dpkg -i deb-pacman_1.0-0.deb
command as shown below.
cyberithub@ubuntu:~$ sudo dpkg -i deb-pacman_1.0-0.deb
Selecting previously unselected package deb-pacman.
(Reading database ... 232760 files and directories currently installed.)
Preparing to unpack deb-pacman_1.0-0.deb ...
Unpacking deb-pacman (1.0-0) ...
Setting up deb-pacman (1.0-0) ...
Step 5: Check version
After successful installation, you can check the current installed version by using pacman --version
command as shown below.
cyberithub@ubuntu:~$ pacman --version .--. TriVoxel's "Deb Pacman" v1.0 / _.-'.-. .-. .-. This software is not made or endorsed \ '-. '-' '-' '-' by Archlinux or the Pacman dev team '--' This program may be freely redistributed under the terms of the non-restrictive MIT license. https://gitlab.com/TriVoxel/deb-pacman for info Apt version: apt 2.4.10 (amd64)
Step 6: Install a package using pacman
Now that package manager installed in the system, it's time to install a sample package using pacman. Here we are installing a package called bison
using pacman -S bison
command as shown below. You can check all the options available with pacman
utility using pacman --help
command.
cyberithub@ubuntu:~$ pacman -S bison ==> sudo apt-get install bison Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: libsigsegv2 m4 Suggested packages: bison-doc m4-doc The following NEW packages will be installed: bison libsigsegv2 m4 0 upgraded, 3 newly installed, 0 to remove and 2 not upgraded. Need to get 962 kB of archives. After this operation, 2,924 kB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 http://in.archive.ubuntu.com/ubuntu jammy/main amd64 libsigsegv2 amd64 2.13-1ubuntu3 [14.6 kB] Get:2 http://in.archive.ubuntu.com/ubuntu jammy/main amd64 m4 amd64 1.4.18-5ubuntu2 [199 kB] Get:3 http://in.archive.ubuntu.com/ubuntu jammy/main amd64 bison amd64 2:3.8.2+dfsg-1build1 [748 kB] Fetched 962 kB in 2s (561 kB/s) Selecting previously unselected package libsigsegv2:amd64. (Reading database ... 232761 files and directories currently installed.) Preparing to unpack .../libsigsegv2_2.13-1ubuntu3_amd64.deb ... Unpacking libsigsegv2:amd64 (2.13-1ubuntu3) ... Selecting previously unselected package m4. Preparing to unpack .../m4_1.4.18-5ubuntu2_amd64.deb ... Unpacking m4 (1.4.18-5ubuntu2) ... Selecting previously unselected package bison. Preparing to unpack .../bison_2%3a3.8.2+dfsg-1build1_amd64.deb ... Unpacking bison (2:3.8.2+dfsg-1build1) ... Setting up libsigsegv2:amd64 (2.13-1ubuntu3) ... Setting up m4 (1.4.18-5ubuntu2) ... Setting up bison (2:3.8.2+dfsg-1build1) ... update-alternatives: using /usr/bin/bison.yacc to provide /usr/bin/yacc (yacc) in auto mode Processing triggers for libc-bin (2.35-0ubuntu3.1) ... Processing triggers for man-db (2.10.2-1) ... Processing triggers for install-info (6.8-4build1) ...
Step 7: Uninstall a package Using pacman
Similarly, if you have to uninstall a package installed through pacman then you need to use pacman -R <package_name>
syntax. Here we are uninstalling bison
package using pacman -R bison
command as shown below.
cyberithub@ubuntu:~$ pacman -R bison ==> sudo apt-get remove bison Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages were automatically installed and are no longer required: libsigsegv2 m4 Use 'sudo apt autoremove' to remove them. The following packages will be REMOVED: bison 0 upgraded, 0 newly installed, 1 to remove and 2 not upgraded. After this operation, 2,519 kB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 232943 files and directories currently installed.) Removing bison (2:3.8.2+dfsg-1build1) ... Processing triggers for man-db (2.10.2-1) ...
Step 8: Uninstall pacman
Once you are done using pacman package manager, you can choose to uninstall it from your system by using sudo apt remove deb-pacman
command as shown below.
cyberithub@ubuntu:~$ sudo apt remove deb-pacman Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages will be REMOVED: deb-pacman 0 upgraded, 0 newly installed, 1 to remove and 2 not upgraded. After this operation, 4,096 B disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 232760 files and directories currently installed.) Removing deb-pacman (1.0-0) ...
If you are looking to remove all the dependencies along with the package then you need to use sudo apt remove deb-pacman --auto-remove
command as shown below.
cyberithub@ubuntu:~$ sudo apt remove deb-pacman --auto-remove Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages will be REMOVED: deb-pacman 0 upgraded, 0 newly installed, 1 to remove and 2 not upgraded. After this operation, 4,096 B disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 232760 files and directories currently installed.) Removing deb-pacman (1.0-0) ...
If you are looking to remove all the configuration and other pacman related files along with the package then you need to use sudo apt purge deb-pacman --auto-remove
command as shown below.
cyberithub@ubuntu:~$ sudo apt purge deb-pacman --auto-remove Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages will be REMOVED: deb-pacman* libsigsegv2* m4* 0 upgraded, 0 newly installed, 3 to remove and 2 not upgraded. After this operation, 409 kB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 232827 files and directories currently installed.) Removing deb-pacman (1.0-0) ... Removing m4 (1.4.18-5ubuntu2) ... Removing libsigsegv2:amd64 (2.13-1ubuntu3) ... Processing triggers for man-db (2.10.2-1) ... Processing triggers for install-info (6.8-4build1) ... Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
I installed pacman but when i try to check the version I get this:
XXXXX@XXXXX:~$ pacman --version
X Error of failed request: BadName (named color or font does not exist)
Major opcode of failed request: 45 (X_OpenFont)
Serial number of failed request: 21
Current serial number in output stream: 25
I can't find any solutions online 🙁