3 Ways to Install Pacman Package Manager in Ubuntu

LINUX
FUNDAMENTALS
A Complete Guide for Beginners Enroll Course Now

Pacman is a powerful package manager that is mainly used by Arch Linux and other Arch-based distributions. It is known for its speed and simplicity. It is normally not used in other Linux/Unix distributions. But, you can install this package manager in other distros and use it to manage packages. In this article, I will show you how you can install the pacman package manager in Debian-based distribution, especially in Ubuntu.

Process Flow Chart to Install Pacman Package Manager in Ubuntu:

step by step instructions on how to install Pacman package manager in a Debian-based distribution i.e. Ubuntu using command line interface (CLI)

[Distro Used Throughout the Tutorial: Ubuntu 23.04]

3 Methods to Install Pacman Package Manager in Ubuntu

There are 3 main package managers in Debian-based distributions: dpkg(Debian Package Manager), apt-get(Advanced Package Tool – Get), and apt(Advanced Package Tool). Among all 3 dpkg is a low-level package manager and apt and apt-get are built on top of dpkg to provide additional features. The apt package manager is the newest and the recommended one. However, there are some features that are not available in the apt package manager. As a result, apt-get is still widely used.

Each type of distribution has its own package managers tailored to their own system. If you use a package manager in a distribution for which it is not optimized, it will usually create unnecessary dependency errors and package version conflicts with the default package manager.

Now, you can follow this article to learn about how you can install the pacman package manager in Ubuntu in three different methods.

Warning: It is not recommended to use a package manager created for a particular type of distro in another type of distribution. Similarly, I will not recommend using the pacman package manager in any Linux/Unix system other than Arch Linux-based.
You can read the Comparative Analysis of Methods to distinguish between these three methods and pick the best one for your needs.

1. Directly Install the Official Version of Pacman on Ubuntu

In the world of Linux distributions, package managers are the gatekeepers to many software. Ubuntu, known for its stability and user-friendliness, relies on apt as its primary package manager. Pacman is the trusted package manager of Arch Linux. It offers a gateway to a vast selection of software.

In this method, I will explore how to directly install the official version of Pacman on your Ubuntu system, both through the modern “apt” command and the classic “apt-get” command.

Case 01: Using the “apt” Command to Install Pacman

The first case will explore the straightforward process of installing the Pacman package manager in your Debian-based “Ubuntu” system using the “apt” command.

To install the Pacman manager in the Debian-based “Ubuntu” system, follow the steps mentioned below:

  1. Before diving into the Pacman installation, first, you have to ensure that you have an up-to-date system. To do that first, open your terminal and execute the following command:

    sudo apt update && sudo apt upgrade
    EXPLANATION
    • sudo: Permits administrative permission.
    • apt: Package manager in Debian-based distributions.
    • update: Refreshes the package database on your system.
    • &&: A logical operator used to chain multiple commands together so that they are executed in sequence.
    • upgrade: Upgrades the installed packages to their latest available versions.

    After executing this command, the system will prompt you to enter your sudo user password, as illustrated in the next image.

    update package database in your system and upgrade all your app packages to their latest version

  2. Next, find the pacman package within the Ubuntu repositories using the apt command.

    apt search pacman
    EXPLANATION
    • search: Searches for packages in the configured software repositories.
    • pacman: Name of the package I am looking for.

    search for pacman package in the remote repositories

    found pacman package manager

    This will display a list of available packages related to pacman as shown in the previous images.

  3. Once you’ve identified the appropriate Pacman package, you can proceed with its installation using the following command:

    sudo apt install pacman-package-manager
    EXPLANATION
    • install: Install an app package using apt.
    • pacman-package-manager: Name of the package you want to install.

    If you receive a confirmation prompt, type “Y” and press ENTER. This will initiate the automatic download and installation of the pacman-package-manager, as shown in the following image.

    install official pacman package manager using apt command in ubuntu

    installation complete, check pacman version

  4. After the installation is complete, it’s good practice to verify that Pacman is now available on your system. You can do this by checking its version using the following command:

    pacman -V
    EXPLANATION
    • pacman: Package manager for Arch Linux-based distributions but now I am using it in Ubuntu.
    • V: Print out details about the software version installed on your system.

    This command should display the Pacman version similar to the previous image, confirming that the installation was successful.

Case 02: Using the “apt-get” Command

In this section, I will explore how to install the Pacman package manager on your Ubuntu system using the “apt-get” command. While apt and apt-get share similarities, they have distinct behaviors, and you may prefer one over the other based on your preferences or system compatibility.

You can follow the Steps of Case 1 to update your package database and upgrade all installed packages to their latest versions and then search for the app package you want to install.

To install the Pacman package manager on your Ubuntu system using the “apt-get” command, follow the steps described below:

  1. Once you’ve determined the right Pacman package, proceed with its installation using the subsequent command:

    sudo apt-get install pacman-package-manager
    EXPLANATION
    • apt-get: Package manager in Debian-based distributions.

    If prompted, enter your sudo user password. Then press “Y” and hit ENTER to confirm the installation similar to the next image.

    install pacman package manager using apt-get

    check pacman version to confirm installation

  2. After the installation completes, you can confirm the presence of Pacman on your system by checking its version.

     Use the following command:

    pacman -V

    This command should display information about the installed Pacman version as shown in the image above.

2. Install “pacapt” From GitHub on Ubuntu

Debian and Arch Linux, two popular Linux distributions utilize distinct package managers: Ubuntu (Debian) uses APT (Advanced Package Tool), while Arch Linux utilizes Pacman. Sometimes, you might prefer Pacman’s syntax and functionality over Ubuntu’s apt package manager. Pacapt acts as a compatibility layer, making it possible to use Pacman commands on Ubuntu.

With pacapt installed, you can use Pacman-like commands on your Ubuntu system. This method can be particularly handy if you’re switching from Arch to Ubuntu.

To download and set up pacapt on your Ubuntu system, go in the following directions:

  1. Begin by fetching the pacapt script from its GitHub repository and placing it in the /usr/local/bin/ directory using the wget command. To do this, run the following command:

    sudo wget -O /usr/local/bin/pacapt https://github.com/icy/pacapt/raw/ng/pacapt
    EXPLANATION
    • wget: Command-line utility for downloading files from the internet.
    • O: Specify the location where the downloaded content will be saved.
    • /usr/local/bin/pacapt: Directory where the downloaded file will be saved.
    • https://github.com/icy/pacapt/raw/ng/pacapt: The URL from which wget will download the file.

    Note: If you do not have the “wget” package installed then you will get an error. In that case, install the “wget” package by executing the following command:

    sudo apt install wget

    download pacapt script from GitHub

    After running this, if the system prompts you for your sudo user password, provide it as shown in the previous image.

  2. Next, execute this command to grant executable permissions to the pacapt script, to ensure it can be run as a command:

    sudo chmod 755 /usr/local/bin/pacapt
    EXPLANATION
    • chmod: Change the permissions of a file or directory.
    • 755: User can read, write, and execute. Group members and others can read and execute but can not write.

    change pacapt script's permission and create pacman symbolic link with pacapt

  3. Now, to mimic Pacman’s behaviour, create a symbolic link named “pacman” pointing to the “pacapt” script using the following command:

    sudo ln -sv /usr/local/bin/pacapt /usr/local/bin/pacman || true
    EXPLANATION
    • ln: Create links or symbolic links between files or directories.
    • s: This option indicates the creation of a symbolic link.
    • v: Display detailed information about its actions as it creates the link.
    • /usr/local/bin/pacman: The destination where I want to create the symbolic link.
    • ||: Logical OR operator.
    • true: Used to guarantee that the ln command registers as successful, even if it encounters an error.

    The process will look similar to the above image. This command establishes a symbolic link, allowing you to use the “pacman” command as if it were natively available on your system.

3. Locally Install the Unofficial Version of Pacman on Ubuntu

In some cases, you may need to install the unofficial version of the pacman app manager, which also acts like a wrapper like pacapt in the Debian-based system.

An unofficial Pacman package manager is something that usually not to be recommended, however, If you still want to install them, then you can follow the below process:

Case 01: Using the “apt” Command to Install Pacman

This section will dive into how to locally install the unofficial version of pacman on your Ubuntu system. Here’s the step-by-step process of how you can install the unofficial version using the “apt” command:

  1. Begin by moving to the directory where you want to download the .deb file of the unofficial pacman package manager using the cd command.

    cd Downloads/
    EXPLANATION
    • cd: Change the current directory to the destination directory.
    • Downloads/: Name of the destination directory.
  2. Now use the wget command to download the unofficial Pacman package from its source.

    wget https://gitlab.com/trivoxel/utilities/deb-pacman/uploads/9f716f95c66cd90e65157773d6dea05b/deb-pacman_1.0-0.deb
    EXPLANATION
    • https://gitlab.com/trivoxel/utilities/deb-pacman/uploads/9f716f95c66cd90e65157773d6dea05b/deb-pacman_1.0-0.deb: This is the URL from which wget will download the file.
  3. Before proceeding with the installation, you must ensure that your directory contains the downloaded package. Execute the ls command to list all the files and folders of your current directory as shown in the following image:

    ls
    EXPLANATION
    • ls: List all files and folders of the current directory in the command line.

    You should see the “deb-pacman_1.0-0.deb” package listed among the files.

    download unofficial pacman package from GitLab in a specific directory and check its presence

  4. Now, run the following command to install the unofficial pacman package manager using the apt command:

    sudo apt install ./deb-pacman_1.0-0.deb
    EXPLANATION
    • deb-pacman_1.0-0.deb: Name of the downloaded local Debian file.

    install unofficial pacman package from downloaded debian file using apt command

    After running this command, the system will prompt you to enter your sudo user password, as indicated in the image above. Provide your sudo password.

  5. To confirm a successful installation of Pacman on your Ubuntu system, use the following command:

    pacman -V

    check installed pacman version

    This command will display the version information of the newly installed Pacman package similar to the image above.

Case 02: Using the “apt-get” Command

In this section, I will show how you can use the “apt-get” command to seamlessly install the unofficial version of the pacman package manager in your Ubuntu system.

You can follow the Steps of Case 1 to download and check the presence of the unofficial pacman app package before installation.

To install the unofficial version of the Pacman package manager in your Ubuntu system, check the steps below:

  1. First, you will need to install the unofficial Pacman package manager’s .deb file you downloaded earlier using the following command:

    sudo apt-get install ./deb-pacman_1.0-0.deb

    It will look like the following image:

    install unofficial pacman package from downloaded debian file using apt-get command

    check pacman version

  2. After successfully installing the unofficial Pacman package to verify its presence on your Ubuntu system execute this command as shown in the previous image.

    pacman --version

    Running this command will display the version information of the newly installed Pacman package, confirming that it is now ready for use on your system.

Case 03: Using the “dpkg” Command to Install Pacman on Ubuntu

Now, I will dive into an alternative method for local installation of the unofficial version of pacman in your Ubuntu system. This method involves using the dpkg command, which is another reliable way to manage package installations.

You can follow the Steps of Case 1 to download and check the presence of the unofficial pacman app package before installation.

It’s especially useful when you prefer manual control over package management and want to install packages directly from Debian package files. By following the steps below, you can successfully set up Pacman on your Ubuntu system:

  1. To begin, install the unofficial pacman package manager from the downloaded .deb file by running the following command:

    sudo dpkg -i ./deb-pacman_1.0-0.deb
    EXPLANATION
    • dpkg: Debian-based low-level package manager.
    • i: This option specifies the dpkg command to install the specified local app package.

    localinstall unofficial pacman package using downloaded debian file using dpkg command and check its version

  2. After installing the unofficial Pacman package, it’s essential to verify the installation status on your Ubuntu system. You can do this by checking the Pacman version:

    pacman --version

    Executing this command will display the version information of the newly installed Pacman package, confirming that it is available and functional on your system as shown in the above image.

How to Uninstall Pacman Package Manager in Ubuntu

There might be instances where you’ve experimented with Pacman on your Ubuntu system and want to uninstall it. Or, experiencing issues or conflicts with the standard package management tools like apt and dpkg and want to remove Pacman to ensure the stability and reliability of your system. In this section, I will walk you through the process of uninstalling Pacman Package Manager from your Ubuntu system.

To begin with the uninstall process of Pacman package manager in ubuntu, follow the process described below:

  1. Open your terminal window. You can do this by pressing “CTRL + ALT + T” on your keyboard or by searching for “Terminal” in the applications menu.

  2. Now, to uninstall pacman from your system, depending on the method you used for installing pacman in your Ubuntu system, your command will change. To uninstall the official pacman package manager package execute any of the following 3 commands:

    sudo dpkg -r pacman-package-manager

    OR,

    sudo apt-get remove pacman-package-manager

    OR,

    sudo apt remove pacman-package-manager
    EXPLANATION
    • r: Instruct dpkg command to uninstall specified app package.
    • remove: Instruct apt/apt-get command to uninstall specified app package.

    I will be using the “apt” command in this demonstration as shown in the next image. Skip to step 5 after this.

    remove official pacman package manager from your Ubuntu system

  3. If you want to remove the unofficial Pacman package manager package, you have three command options to choose from:

    sudo dpkg -r deb-pacman

    OR,

    sudo apt-get remove deb-pacman

    OR,

    sudo apt remove deb-pacman

    I will be using the “apt” command for this example. Your terminal should look like the next image afterwards. Skip to step 5 after this.remone unofficial pacman using apt command

  4. And, if you want to remove “pacapt”  from your system, then execute the following commands. First, to find where the script file is run:

    command -v pacapt
    EXPLANATION
    • command: Built-in shell command to find the location of a command in the system.
    • v: Instruct shell to display more description.
    • pacapt: Name of the command i am checking.

    Secondly, move to that directory.

    cd /usr/local/bin/
    EXPLANATION
    • /usr/local/bin/: Location of the pacapt script.

    Now, to check all contents of that folder run:

    ls

    Finally, remove these scripts to remove pacapt from your system.

    rm pacapt pacman
    EXPLANATION
    • rm: Remove files and directories in the Linux system.
    • pacapt pacman: Name of the files I am removing.

    Your terminal should look like this image during these processes.

    remove pacapt script from your Ubuntu system

  5. If you encounter a prompt for a sudo password, enter your sudo password. Then type “Y” and press ENTER to confirm the uninstallation.remove all residual unused dependencies from your system
  6. Finally, run the following command to perform some additional cleanup and ensure that you remove all residual configuration files, as shown in the above image.

    sudo apt autoremove
    EXPLANATION
    • autoremove: Remove packages that are no longer required by any installed package, and were automatically installed as dependencies.

How to Install a Package Using Pacman on Ubuntu

Pacman, the package manager for Arch Linux and its derivatives, earns its reputation for its simplicity and efficiency in handling software installations. Its strengths lie in its ease of use and speedy package retrieval from official repositories. In other Linux distributions, you can emulate its behavior using pacapt.

In this section, I will show you how to install a package using Pacman. I will use the popular audio editing software, Audacity for these examples. I will use pacapt to run all these commands in these demonstrations.

To install a package using Pacman on Ubuntu, walk through the following steps:

  1. Before installing any package, it’s a good practice to ensure your system’s package database is up-to-date. Run the following command to update your system database:

    sudo pacman -Sy
    EXPLANATION
    • pacman: Package manager.
    • Sy: Tell Pacman to synchronize the package database with the servers.

    update system package database using pacman

    If the system asks for your sudo user password, provide it as displayed in the image above.

  2. Now, search for the package you are looking for using the “Ss” option similar to the following image.

    pacman -Ss audacity
    EXPLANATION
    • Ss: Tell Pacman to search its repositories and display a list of packages related to the specified package.
    • audacity: Name of the package, I am looking for.

    search for an app package using pacman

  3. After, identifying the appropriate package, you can proceed with its installation by using the following command:

    sudo pacman -S audacity
    EXPLANATION
    • S: Instructs Pacman to install the specified package.

    install an app package using pacman

    press Y to confirm installation

    Then, Pacman will provide information about the package dependencies and size and ask for confirmation. Type “Y” to confirm and press Enter. After that, pacman will fetch the specified package, resolve any dependencies, and install it automatically as shown in the above image.

Check Installed Packages Using Pacman

After installing a package you need to check its installation status. Knowing what software is installed in your system is essential for various reasons. You might want to verify the version of a particular package, confirm its installation status, or explore its dependencies. In this section, I will explore how to use the “-Q” option to check installed packages:

To check the installed packages using -Q option, see the steps below:

  1. To begin, first open your terminal. Then run the following command:

    pacman -Q
    EXPLANATION
    • Q: List all installed packages on your system.

    list all installed package using pacman

    It will list all installed packages in your system as shown in the above image.

  2. After that, to get detailed information about a specific package, use the “Qi” option followed by the package name.

    pacman -Qi audacity
    EXPLANATION
    • Qi: Retrieve detailed information about the specified package.

    show detailed information about a package using pacman

    After executing this command you will see comprehensive information about the specified package, including its name, version, description, dependencies, and more similar to the above image. You can also use this to verify the installation status of a specified package in your system.

How to Uninstall a Package Using Pacman on Ubuntu

Uninstalling software packages is a routine task in any Linux system. When you no longer need a particular application, it is essential to remove it to free up space and keep your system clean. In this section, I will show you how to uninstall a package using pacman.

To uninstall a package using Pacman on Ubuntu, check the steps below:

  1.   First, to uninstall a package execute the following command in your terminal:

    sudo pacman -R audacity
    EXPLANATION
    • R: Uninstall the specified app package.

    Your terminal will look similar to the following image.

    uninstall a package using pacman

    press Y to confirm uninstallation

  2. Provide your sudo user password, then type “Y”, and press ENTER to confirm uninstallation as shown in the above image. Then, it will automatically uninstall the app package.

    Note: This command will not automatically uninstall dependencies. To remove dependencies, execute this command afterward:

    sudo apt autoremove

Comparative Analysis of Methods to Install Pacman Package Manager

In this article, I have shown 3 different methods of installing the pacman package manager in the Debian-based Linux distribution i.e. Ubuntu. For an easier understanding of which method is more suitable for your usage, here is a comparison of all methods.

Methods Pros Cons
Method 1
  • The official version ensures stability.
  • Integrated with Ubuntu’s update system for seamless upgrades.
  • Lack of features available in Archlinux.
  • Do not align perfectly with Ubuntu’s ecosystem.
  • May lead to dependency conflicts or instability.
Method 2
  • Allow you to use Pacman-like commands.
  • Work with various package managers in various Linux distributions.
  • Some commands may not be fully implemented or do not support at all in some distros.
Method 3
  • May fulfill specific requirements not met by other methods.
  • Very outdated.
  • Can pose security risks.

Among all three methods, pacapt will provide you most Arch Linux-like package management experience without causing issues in your Ubuntu system. The unofficial pacman package is not recommended at all as it is not updated for a long time. The official pacman package manager may lead to dependency issues with Ubuntu’s main package managers, so use it carefully.

Conclusion

In conclusion, in this guide, I have shown you multiple methods to install the Pacman package manager in your Ubuntu system. Whether you chose the official version or other pacman wrappers, you now know about installing it in Ubuntu at your disposal. Additionally, I have explored how to use Pacman for package installation, checking installed packages, and uninstalling them. By following these steps I hope, you will be able to enhance your Linux experience and streamline your software management tasks.

People Also Ask

How to install packages in Ubuntu?

To install packages in Ubuntu, you can use the “apt” package manager. Open a terminal and run the command sudo apt install <package-name>. This command will automatically download and install the specified package and its dependencies.

Which is better apt or pacman?

The choice between “apt” and “pacman” depends on the Linux distribution you’re using. “Apt” is the default package manager for Debian-based systems and is well-supported with extensive repositories. “Pacman” is the package manager for Arch-based distributions, known for its simplicity and rolling release model. The better choice will be the one that is tailored to your specific Linux distribution.

How do I know if pacman is installed?

To check if “pacman” is installed on your Linux system, open your terminal and run the command pacman -Q pacman. If it’s installed, you’ll see the version information. If it’s not installed, you’ll receive an error message indicating that “pacman” is not found. This command verifies the presence of the package manager on Arch Linux and related distributions.

Why is Pac-Man so popular?

Pacman package manager is popular because of its simplicity, speed, and robust dependency handling. It is the default package manager for Arch Linux and related distributions, known for its user-centric approach and bleeding-edge software. Pacman’s easy-to-understand syntax and efficient package management make it a favorite among experienced Linux users who appreciate both its power and straightforwardness.

Related Articles


<< Go Back to Package Installation in Linux | Package Management in Linux | Learn Linux Basics

4.9/5 - (18 votes)
Ridoy Chandra Shil

Hello everyone. I am Ridoy Chandra Shil, currently working as a Linux Content Developer Executive at SOFTEKO. I am a Biomedical Engineering graduate from Bangladesh University of Engineering and Technology. I am a science and tech enthusiast. In my free time, I read articles about new tech and watch documentaries on science-related topics. I am also a big fan of “The Big Bang Theory”. Read Full Bio

Leave a Comment