1. Overview

Many Debian users struggle to install their favorite software after migrating to Arch Linux or any other Arch-based distro because they’re comfortable with .deb packages, which can’t be directly installed on these systems.

In this tutorial, we’ll discuss different methods for installing our desired .deb package in any Arch-based distribution.

2. Find Existing Arch Packages

Installing a .deb package directly in Arch Linux isn’t advisable because it can cause many potential dependency issues. Therefore, we should first search for the equivalent package that’s compatible with our Arch-based system.

2.1. Search the Official Repository

First of all, we should check the Arch official repository for the software. If it’s unavailable, we can also consider other viable alternatives available in the official repository.

Arch Linux’s official repository contains plenty of useful packages that can be installed easily without encountering any dependency issues.

2.2. Use AUR for Installing the Package

In case, we can’t find our desired package in the official repository, we should consider checking its availability in the Arch User Repository (AUR). The AUR is a community-driven repository that contains PKGBUILD scripts. These scripts automate the process of downloading and installing a package using its source code along with its dependencies.

Let’s search for a package — for instance, Dropbox — that’s not available in the official Arch repository but can be found in the AUR. For this purpose, let’s access the AUR website and utilize the search bar to locate the Dropbox package. If we find the desired package, we can view its details and copy its Git Clone URL for later use.

Afterward, let’s open the terminal and install Git and essential development tools on our system:

$ sudo pacman -S --needed git base-devel
warning: git-2.43.0-1 is up to date -- skipping
resolving dependencies...
looking for conflicting packages...

Next, we run the git clone command to clone the dropbox PKBUILD script using the previously copied URL:

$ git clone https://aur.archlinux.org/dropbox.git
Cloning into 'dropbox'...
remote: Enumerating objects: 821, done.
remote: Counting objects: 100% (821/821), done.
remote: Compressing objects: 100% (292/292), done.
remote: Total 821 (delta 559), reused 785 (delta 529), pack-reused 0
Receiving objects: 100% (821/821), 173.80 KiB | 486.00 KiB/s, done.
Resolving deltas: 100% (559/559), done.

After downloading the PKGBUILD, we navigate to its directory using the cd command. Finally, we use the makepkg -si command to create, compile, and install the package automatically:

$ makepkg -si 
==> Making package: dropbox 186.4.6207-1 (Sat 23 Dec 2023 10:40:24 PM EST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Installing missing dependencies...
resolving dependencies...
looking for conflicting packages...

We’ve now successfully installed the required package from AUR.

3. Install .deb Package Using debtap

If the desired package isn’t available in the official repository or AUR, we can install its .deb package using debtap. debtap is a script available on AUR that converts .deb packages into Arch Linux packages.

However, this method isn’t recommended, as it may break due to potential dependency problems or package updates.

To install the .deb package, let’s first install debtap from AUR. We can install it either manually as we did with the Dropbox package or by utilizing an AUR helper command, such as yay:

$ yay -S debtap
AUR Explicit (1): debtap-3.5.1-1
Sync Dependency (1): pkgfile-21-2
:: PKGBUILD up to date, skipping download: debtap

After installing debtap, we must update its local database:

$ sudo debtap -u
==> Synchronizing pkgfile database...
:: Updating 3 repos...

The above command helps debtap accurately convert and install .deb packages on our system.

Next, we have to download the required .deb package and navigate to its directory. For instance, if the .deb package for google-earth-pro-stable is located in the Downloads directory, we’ll use cd to navigate there and the ls command to confirm its existence:

$ cd Downloads
$ ls

Then, we can use the debtap command to convert the .deb package into an Arch Linux package with the pkg.*.zst extension. During the conversion, a prompt may appear asking for a package license number. In such cases, we can proceed by pressing the Enter key:

$ debtap google-earth-pro-stable_current_amd64.deb
==> Extracting package data...
==> Fixing possible directories structure differencies...
ls: cannot access 'usr/share/applications/*.desktop': No such file or directory
==> Generating .PKGINFO file...

:: Enter Packager name (can be left blank):

:: Enter package license (can be left blank, you can enter multiple licenses comma separated):

*** Creation of .PKGINFO file in progress. It may take a few minutes, please wait...

Next, let’s run the ls command to verify the successful creation of the Arch Linux package:

$ ls

Finally, it’s time to install the Arch Linux package by running the pacman -U command:

$ sudo pacman -U google-earth-pro-*.pkg.tar.zst 
[sudo] password for linux:
loading packages...
resolving dependencies...
looking for conflicting packages...

The above command will install the Google Earth Pro package on our system.

4. Install .deb Package Using dpkg

We’re all somewhat familiar with dpkg, a popular package manager for Debian-based systems. We can use it in Arch-based systems to install .deb packages. However, this method may corrupt our system, so we shouldn’t use it unless we have our backup ready and no other method is working.

dpkg is available in the official repository of Arch Linux, not specifically for this purpose, but rather to allow its utilization in any remotely connected Debian-based system.

First, we’ll install dpkg:

$ sudo pacman -S dpkg
[sudo] password for linux:
resolving dependencies...
looking for conflicting packages...

Next, we download the desired .deb package and navigate to the directory containing the package. Then, we use the dpkg -i command to install it:

$ sudo dpkg -i google-earth-pro-stable_current_amd64.deb
Selecting previously unselected package code.
(Reading database ... 0 files and directories currently installed.)
Preparing to unpack google-earth-pro-stable_current_amd64.deb ...
Unpacking code ( ...

Here, we’ve installed the .deb package successfully with dpkg.

5. Conclusion

In this article, we learned that for Arch-based systems, it’s important to first search the official repository and AUR for the required package before considering installing it from a .deb package. However, if the package isn’t available through these sources, we can use tools like debtap or dpkg to install the .deb package in our Arch-based system.

Comments are closed on this article!