- Pacman Commands Cheat Sheet for Arch Linux
- Updating and Upgrading Arch Linux
- Install Package(s) in Arch Linux
- Remove Package(s) in Arch Linux
- Query Package(s) in Arch Linux
- Arch Linux Pacman Cheat Sheet
- How to Install Deb Package in Arch Linux
- Content
- Installing via the AUR
- 1. Use an AUR Helper
- 2. Manual Installing AUR Packages
- Install via Debtap
- Installing Manually
- Frequently Asked Questions
- 1. Why Is Debtap Taking So Long?
- 2. Can I Use a Graphical Installer After Running Debtap?
- 3. How does Debtap Compare with the AUR?
- Wrapping Up
Pacman Commands Cheat Sheet for Arch Linux
One uniqueness or key identifier of different Linux distributions is in the package manager they use to update, install, configure, and uninstall various targeted software packages. In Arch Linux, the package manager is called Pacman.
This tutorial seeks to walk you through some commonly used and unique Pacman commands that will make your Arch Linux interaction and experience easier and much more memorable.
It is highly advisable to be a root user or have Sudoer user privileges on your Arch Linux system to fully benefit from what the Pacman command has to offer.
Updating and Upgrading Arch Linux
If you only want to update the software database of your Arch Linux system, go with the following command:
To update and upgrade your Arch Linux system, go with the following command:
Install Package(s) in Arch Linux
If you have a specific package called an apache web server in mind that you wish to install, it is advisable to first search for the availability of the package. This step is useful because some Linux OS distributions identify common packages differently.
To install an identified package, adhere to the following command:
Supposing you have a local package or one that you have downloaded from a website and wish to install it, you need to adhere to the following command.
$ sudo pacman -U /path/to/your/installable/package
For all repo-based packages re-installation (during emergencies), implement the following command.
$ sudo pacman -Qnq | pacman -S -
Remove Package(s) in Arch Linux
To remove or uninstall a specific Arch Linux installed package, adhere to the following command.
$ sudo pacman -R name_of_package
To remove or uninstall an Arch Linux package together with its dependencies not tied to other active packages, reference the following command syntax:
$ sudo pacman -Rs name_of_package
To uninstall a specific Arch Linux package, remove its global configuration, and avoid its orphaned dependencies, use the following command syntax.
$ sudo pacman -Rns name_of_package
Query Package(s) in Arch Linux
You might wish to retrieve some information about an installed package. The command syntax to use is as follows:
$ pacman -Qi name_of_package
For the apache package we installed earlier, we can get the following info about it:
We can also query about an installable package and its associated dependencies via the command syntax:
$ sudo pacman -Sii name_of_package
To list installed packages, execute the command:
Arch Linux Pacman Cheat Sheet
Following are the list of commonly used commands for the Pacman package manager in Arch Linux.
Command | Description |
sudo pacman -Syy | Update package list |
sudo pacman -Syu | Update and upgrade all |
sudo pacman -S pkgname | Install specific package |
sudo pacman -Ss keyword | Find available packages |
sudo pacman -Qs keyword | Find available local packages |
sudo pacman -Ql pkgname | List all files from a package |
Sudo pacman -Rsc pkgname | Uninstall a package |
sudo pacman -Qii pkgname | List information on package |
With the Pacman command cheat sheet, you should be comfortable enough to take your Arch Linux OS experience to the next level.
How to Install Deb Package in Arch Linux
If you’ve used Linux for any amount of time, you’ve noticed that one of the most common methods to install third-party applications is via a .Deb package. Often times this is the only way to get this software, as the developers can’t be bothered to go through the process of packaging in the dozens of different formats the Linux platform offers.
Many non-Debian-based Linux distributions have their own ways of getting around this issue. However, out of all Linux distributions, Arch Linux has the most interesting ways of getting a Debian package working. In this article we outline three ways to accomplish this and discuss which one is best.
Note: the steps below will work for any Arch-based distro.
Content
Installing via the AUR
The AUR is the first place to check when looking for software that isn’t officially supported in Arch Linux. Always check here first. It’s a service that allows anyone to upload a PKGBUILD script, designed to automatically take software from various places, download some or all of the needed dependencies to run them and compile a native Arch Linux package.
When using the AUR, there are two ways to go about it:
1. Use an AUR Helper
If you want to get stuff done quickly without having to jump through hoops, use an AUR helper like yay or yaourt. This won’t allow you to install a .deb file, but you may be able to find the package in arch format, created by arch users.
For more information about AUR hepers and how to install them, refer to our list of five awesome AUR helpers. Once you have one, just search the AUR, install and go.
Chances are if you’re using Manjaro, Endeavour, Garuda or any of the other Arch-based distros, you’ll have an AUR helper installed. Have a look at your distro’s documentation to check out what is included. Both Garuda and Endeavour use yay.
If you’d rather have a graphical environment, you can always install the pamac-aur package with your AUR helper – if it’s not installed already. Note that you’ll have to enable AUR support after installation under “Preferences -> Third Party.”
2. Manual Installing AUR Packages
Another way of getting unofficial packages is by going to the AUR website , using the search bar, and downloading the “snapshot.” This is a less automated process, but it’s worth it if you want more granular control over how packages are made or installed. Instead of instantly installing the package, it’ll spit out a native package you can modify for your own purposes.
This means that if you have a custom personal repository set up, you can easily place these newly-built packages right in the repo for easy installation.
Note: if you just plan to use Arch’s base repositories and the AUR, installing packages with an AUR helper is a much better option than manual builds.
Most (if not all) programs that only come in DEB format will be found in the AUR. Here’s how to compile one as an Arch package from scratch.
sudo pacman -S --needed git base-devel
- Pay attention to the “Git Clone URL” on the AUR page of the package you want to download and install and copy it. Use that URL in the terminal opened in the home directory like so:
This will download the package’s git repository with a PKGBUILD configuration file for Arch’s powerful makepkg tool.
to navigate to the package’s build directory you just downloaded.
to create the package and install it automatically.
If you’re curious, the -s ( —syncdeps ) flag automatically grabs all the dependencies related to the available package in the official Arch Linux repositories, while the -i ( —install ) flag tells your system to not just compile the package but also integrate it into your system (e.g., create menu items, perform necessary integration into kernel arguments if there are any, etc.).
Install via Debtap
If, for some reason, a Deb you need isn’t in the AUR, install Debtap. It’s a program that dismantles a Debian package and makes it into an Arch package that your package manager can “understand.”
Warning: Use this method at your own discretion. The .deb package you install may break if the upstream package maintainers for the packages it depends on get updates that remove features or functionality. It doesn’t happen all the time, but you should be aware that this method may not always work fantastically.
- Start by installing Debtap via the AUR by following the instructions in the previous section.
- Once installed, run sudo debtap -u once to update debtap’s own repositories. Otherwise, the application will not work.
- Download the .deb file you wish to convert, cd into the directory you downloaded it into, and use the following command:
debtap packagetoconvert.deb
- At any point that Debtap asks you to input data, you can simply ignore this and press Enter on your keyboard.
- When finished, Debtap will have created a “pkg.*.zst” file that your package manager can interpret and install using offline installation procedures.
- cd into the directory you just converted the .deb package into and type:
sudo pacman -U [package-name]
Installing Manually
Warning: This method is highly unsafe and should only be used when there is no other option and you already have an advanced understanding of how certain packages work and certain behaviors that Arch expects. For example, some applications (like Plymouth, Virtualbox, etc.) may require hooks into the kernel that can only be done by editing configuration files and re-building the kernel with those hooks. Even more, using this method does not also install the dependencies of your package.
Though not the most elegant solution, when there’s no way to convert a .deb file with Debtap or compile with an AUR pkgbuild, the best method is to extract the Debian package itself and put the files where they should go.
Though this may involve a lot more tedium than previous methods, it’s more platform-independent, meaning you can use this method in many other distributions like Void Linux, Fedora, and openSUSE. I have not tested this in Gentoo and Slackware, so your mileage may vary with them due to how both distros like to handle installing packages.
Debian packages are archives with binaries inside, so no compiling is necessary. To install the files in any Deb package to Arch, first extract it to a folder. Keep in mind that you’ll also need to extract the archive known as “data” inside that folder as well.
For example, to install Google Chrome, you’d first cd into the extracted Deb folder with the extracted contents of “data.tar.xz” inside it.
cd ~/Downloads/google-chrome-stable_current_amd64
Then, run the ls command to reveal all of the folders that reside in the data archive inside the Deb package. Keep in mind the names of these folders. cd into each directory and move the contents of these directories to where they belong on the system.
cd ~/Downloads/google-chrome-stable_current_amd64/etc sudo mv * /etc/ cd ~/Downloads/google-chrome-stable_current_amd64/opt sudo mv * /opt/
Frequently Asked Questions
1. Why Is Debtap Taking So Long?
Debtap grabs the metadata available in the .deb file to construct the most faithful Arch package possible to minimize issues and provide relevant information on which dependencies pacman should install in addition to the package itself. This involves a significant amount of tedium beyond simply decompressing a tarball.
In addition to this, the script Debtap converts files with uses only one CPU core, making single-core performance the determining factor that affects how long your system will take to complete the operation. Expect large packages to take up to a few minutes.
2. Can I Use a Graphical Installer After Running Debtap?
Yes! If you have any version of pamac installed, you can run the tar-zst file Debtap generates through your file manager. By choosing pamac as the program to run the file, you can just double-click it just like you would any .deb package in Debian to install it and all of its dependencies automatically.
3. How does Debtap Compare with the AUR?
You should see Debtap as a last-ditch “dirty” method for installing something you really need and somehow can’t find in the AUR. If you can find something in the AUR, it will always be a better option to install that package than using a .deb file.
Wrapping Up
One of the best things about Arch Linux is how many ways users can install packages – from the AUR, to custom repositories, to decompiling other distributions’ packages so they’ll run. Though this information isn’t new, it’s certainly a good resource for those new to Arch and looking for ways to install their favorite programs.
Miguel has been a business growth and technology expert for more than a decade and has written software for even longer. From his little castle in Romania, he presents cold and analytical perspectives to things that affect the tech world.
Our latest tutorials delivered straight to your inbox