itsfosslinux

How to Install pacman package manager on Ubuntu or Debian

In this article, we will see how to install pacman package manager on Ubuntu or Debian. Pacman is a free and open source package manager mainly used in Arch Linux and its derivatives. It's a powerful tool that combines a simple binary package format with an easy-to-use build system. The name "Pacman" stands for “package manager utility” (PMU). It primarily manages binary packages in a .pkg.tar format, which are compiled for easy and fast installation on Arch-based systems. Apart from Arch Linux, it can also be used on Debian or Ubuntu based systems. Here we will see the steps to install pacman package manager on Ubuntu or Debian based systems.

 

Important Features

  • Binary Package Management: Pacman primarily manages binary packages in a .pkg.tar format, which are compiled for easy and fast installation on Arch-based systems.
  • Simple and Efficient: Pacman is known for its simplicity and efficiency. It offers straightforward commands to install, update, upgrade, and remove packages.
  • Package Groups: It allows the installation of entire groups of packages, which can be convenient for setting up a specific type of environment, like a development environment.
  • Dependency Resolution: Pacman automatically handles dependencies for packages, ensuring that all required libraries and packages are installed along with the package you want.
  • Integrated Build System with ABS: The Arch Build System (ABS) is integrated with Pacman. This allows users to build packages from source, offering flexibility and customization for package installation.
  • Local Repository Database: It maintains a local database of packages and their information, which it syncs with the remote repositories specified in its configuration file.
  • Rolling Releases: In line with Arch Linux's rolling release model, Pacman provides continuous updates to the latest software versions.
  • Powerful Querying Capabilities: Pacman offers robust querying capabilities for both installed packages and available packages in repositories.
  • Hooks System: Pacman supports a hooks system, allowing automated tasks to be performed before or after package transactions (like installation or upgrade).
  • Lightweight: Being lightweight and fast, it doesn't impose significant overhead on the system.

 

How to Install pacman package manager on Ubuntu or Debian

How to Install pacman package manager on Ubuntu or Debian

Also Read: How to Install RVM (Ruby Version Manager) on Ubuntu

Step 1: Prerequisites

a) You should have a running Ubuntu or Debian Server.

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

c) You should have apt or apt-get package manager available in your system.

d) You should have wget, tar and dpkg utility available in your System.

 

 

Step 2: Update Your Server

As always recommended, check for latest available updates from default ubuntu repo and install them by using sudo apt update && sudo apt upgrade command as shown below,

itsfosslinux@ubuntu:~$ sudo apt update && sudo apt upgrade
[sudo] password for itsfosslinux:
Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:2 https://dl.google.com/linux/chrome/deb stable InRelease [1,825 B]
Ign:3 https://pkg.jenkins.io/debian-stable binary/ InRelease
Hit:4 https://d3nt0h4h6pmmc4.cloudfront.net/ubuntu focal InRelease
Hit:5 https://pkg.jenkins.io/debian-stable binary/ Release
Hit:6 http://ppa.launchpad.net/flatpak/stable/ubuntu focal InRelease
Hit:7 https://dl.winehq.org/wine-builds/ubuntu focal InRelease
Hit:8 http://ppa.launchpad.net/gencfsm/ppa/ubuntu focal InRelease
Hit:9 http://ppa.launchpad.net/juju/stable/ubuntu focal InRelease
Hit:10 http://ppa.launchpad.net/libreoffice/ppa/ubuntu focal InRelease
Hit:11 https://ngrok-agent.s3.amazonaws.com buster InRelease
Hit:12 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 InRelease
Hit:13 http://ppa.launchpad.net/mojo-maintainers/ppa/ubuntu focal InRelease
Hit:14 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal InRelease
................................................................

 

 

Step 3: Install pacman 

In the next step, you can install pacman package manager by using any of the below methods depending on your needs and requirements.

a) Using Binary file

To install pacman package manager from tarball, first download the latest release from GitLab website using wget utility as shown below.

itsfosslinux@ubuntu:~$ wget https://gitlab.com/trivoxel/utilities/deb-pacman/-/archive/v1.0/deb-pacman-v1.0.tar
--2024-01-12 14:49:14-- https://gitlab.com/trivoxel/utilities/deb-pacman/-/archive/v1.0/deb-pacman-v1.0.tar
Resolving gitlab.com (gitlab.com)... 2606:4700:90:0:f22e:fbec:5bed:a9b9, 172.65.251.78
Connecting to gitlab.com (gitlab.com)|2606:4700:90:0:f22e:fbec:5bed:a9b9|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/octet-stream]
Saving to: ‘deb-pacman-v1.0.tar’

deb-pacman-v1.0.tar [ <=> ] 20.00K --.-KB/s in 0.004s

2024-01-12 14:49:16 (4.80 MB/s) - ‘deb-pacman-v1.0.tar’ saved [20480]

Then extract the source code files from tarball using tar -xf deb-pacman-v1.0.tar command as shown below.

itsfosslinux@ubuntu:~$ tar -xf deb-pacman-v1.0.tar

Switch to directory using cd deb-pacman-v1.0 command.

itsfosslinux@ubuntu:~$ cd deb-pacman-v1.0

Provide execute permission to pacman using chmod +x pacman command as shown below.

itsfosslinux@ubuntu:~/deb-pacman-v1.0$ chmod +x pacman 

You can then copy the binary utility to system defined path such as to /usr/local/bin path to use it from anywhere in the system.

itsfosslinux@ubuntu:~/deb-pacman-v1.0$ sudo cp pacman /usr/local/bin/

b) Using Debian package

Another method that you can use to install pacman package manager is through the debian package. You can download the latest available debian package from GitLab website using wget utility as shown below.

itsfosslinux@ubuntu:~$ wget https://gitlab.com/trivoxel/utilities/deb-pacman/uploads/9f716f95c66cd90e65157773d6dea05b/deb-pacman_1.0-0.deb
--2024-01-12 15:22:29-- https://gitlab.com/trivoxel/utilities/deb-pacman/uploads/9f716f95c66cd90e65157773d6dea05b/deb-pacman_1.0-0.deb
Resolving gitlab.com (gitlab.com)... 2606:4700:90:0:f22e:fbec:5bed:a9b9, 172.65.251.78
Connecting to gitlab.com (gitlab.com)|2606:4700:90:0:f22e:fbec:5bed:a9b9|: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

2024-01-12 15:22:29 (43.9 MB/s) - ‘deb-pacman_1.0-0.deb’ saved [1892/1892]

Then install the package by using sudo dpkg -i deb-pacman_1.0-0.deb command as shown below.

itsfosslinux@ubuntu:~$ sudo dpkg -i deb-pacman_1.0-0.deb
Selecting previously unselected package deb-pacman.
(Reading database ... 295829 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 4: Check version

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

itsfosslinux@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.0.10 (amd64)

 

 

Step 5: Verify Installation

If you installed pacman through debian package then you can check the package installation status by using dpkg -s deb-pacman command as shown below.

itsfosslinux@ubuntu:~$ dpkg -s deb-pacman
Package: deb-pacman
Status: install ok installed
Priority: optional
Section: admin
Installed-Size: 4
Maintainer: Caden Mitchell <[email protected]>
Architecture: all
Version: 1.0-0
Depends: bash, apt
Description: Archlinux Pacman frontend for Apt
Brings the interaction of Archlinux Pacman to Debian users
who prefer the way Pacman works over apt!
Homepage: https://gitlab.com/TriVoxel/deb-pacman

 

 

Step 6: Install a Package

Now that pacman is installed, let's use to install a package in the system to test its usage. For our demo purpose, we are installing a package called terminator using pacman -S terminator command as shown below.

itsfosslinux@ubuntu:~$ pacman -S terminator
==> sudo apt-get install terminator
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
gir1.2-keybinder-3.0 libkeybinder-3.0-0 python3-psutil
Suggested packages:
python-psutil-doc
The following NEW packages will be installed:
gir1.2-keybinder-3.0 libkeybinder-3.0-0 python3-psutil terminator
0 upgraded, 4 newly installed, 0 to remove and 2 not upgraded.
Need to get 466 kB of archives.
After this operation, 3,103 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://in.archive.ubuntu.com/ubuntu focal/universe amd64 libkeybinder-3.0-0 amd64 0.3.2-1ubuntu1 [7,996 B]
Get:2 http://in.archive.ubuntu.com/ubuntu focal/universe amd64 gir1.2-keybinder-3.0 amd64 0.3.2-1ubuntu1 [3,164 B]
Get:3 http://in.archive.ubuntu.com/ubuntu focal/main amd64 python3-psutil amd64 5.5.1-1ubuntu4 [141 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu focal/universe amd64 terminator all 1.91-4ubuntu1 [313 kB]
Fetched 466 kB in 2s (216 kB/s)
Selecting previously unselected package libkeybinder-3.0-0:amd64.
(Reading database ... 295830 files and directories currently installed.)
Preparing to unpack .../libkeybinder-3.0-0_0.3.2-1ubuntu1_amd64.deb ...
Unpacking libkeybinder-3.0-0:amd64 (0.3.2-1ubuntu1) ...
Selecting previously unselected package gir1.2-keybinder-3.0.
Preparing to unpack .../gir1.2-keybinder-3.0_0.3.2-1ubuntu1_amd64.deb ...
Unpacking gir1.2-keybinder-3.0 (0.3.2-1ubuntu1) ...
Selecting previously unselected package python3-psutil.
..................................................................

 

 

Step 7: Uninstall a Package

Similarly, if you want to remove a package say terminator package in our case then you have to use pacman -R terminator command as shown below.

itsfosslinux@ubuntu:~$ pacman -R terminator
==> sudo apt-get remove terminator
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
gir1.2-keybinder-3.0 libkeybinder-3.0-0 python3-psutil
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
terminator
0 upgraded, 0 newly installed, 1 to remove and 2 not upgraded.
After this operation, 2,149 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 296095 files and directories currently installed.)
Removing terminator (1.91-4ubuntu1) ...
update-alternatives: using /usr/bin/gnome-terminal.wrapper to provide /usr/bin/x-terminal-emulator (x-terminal-emulator) in auto mode
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...

 

 

Step 8: Uninstall Pacman

If you don't need pacman package manager anymore then you can simply remove it from your system by using any of the below methods depending on how you installed it.

a) Remove Binary Utility

If you installed pacman from tarball the for removal all you need to do is to remove the binary utility from the path where you copied it during installation steps. For example, we placed the utility on /usr/local/bin path so to remove we are using sudo rm -rf /usr/local/bin/pacman command as shown below.

itsfosslinux@ubuntu:~$ sudo rm -rf /usr/local/bin/pacman

b) Remove Debian Package

If you installed pacman through debian package then for removal you need to run sudo apt remove deb-pacman command as shown below. To remove all the dependencies along with the package, use --auto-remove option with below command.

itsfosslinux@ubuntu:~$ sudo apt remove deb-pacman
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
gir1.2-keybinder-3.0 libkeybinder-3.0-0 python3-psutil
Use 'sudo apt autoremove' to remove them.
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 ... 295874 files and directories currently installed.)
Removing deb-pacman (1.0-0) ...

Leave a comment