Back to all articles
Linux•2026-10-10•13 min read

How to Install a .deb on Arch Linux with a PKGBUILD and the AUR

Inspect a Debian package, wrap the payload in a PKGBUILD, install it with pacman, and publish the recipe to the AUR under its submission rules.

Arch LinuxPKGBUILDAURpacmanPackaging

Arch Linux does not install .deb packages. pacman cannot read a Debian archive, and installing dpkg to unpack one program fights the rest of the system.

The supported way is the way every Arch package is built. Write a PKGBUILD that downloads the .deb, unpacks the files upstream already built, and hands that tree to pacman. For your own machine, makepkg -si is enough. If other people need the program, publish the recipe to the AUR. The AUR stores the recipe, not the binary.

A .deb is an archive with a control file and a filesystem image. A PKGBUILD tells makepkg which archive to download and where those files land.

AUR packages are unofficial and not vetted. Users build them at their own risk, so the recipe you publish has to be readable and honest about what it installs.

The examples use a fictional package, example-app 1.4.2, shipped as example-app_1.4.2-1_amd64.deb. Replace the name, version, and URL.


1. See what is inside the .deb

A Debian binary package is an ar archive with three members:

  • debian-binary, a format marker
  • control.tar.*, the metadata: name, version, dependencies, maintainer scripts
  • data.tar.*, the files that would be copied onto the system

The tarballs use different compression depending on the builder: zstd (.zst) is common on Ubuntu, xz on Debian, and gz or an uncompressed tar appear in older or third-party packages. bsdtar, which ships with Arch, reads all of them.

Work in a scratch directory, not in the repo you will publish.

Code Snippet
mkdir -p /tmp/deb-inspect && cd /tmp/deb-inspect
curl -fLO "https://example.com/releases/example-app_1.4.2-1_amd64.deb"
 
bsdtar -tf example-app_1.4.2-1_amd64.deb
bsdtar -xf example-app_1.4.2-1_amd64.deb
bsdtar -xf control.tar.*
cat control
bsdtar -tf data.tar.* | head

control is plain text. The fields that matter: Package, Version, Architecture, Depends, Recommends, Description. Read the license from the copyright file inside the data archive:

Code Snippet
bsdtar -xOf data.tar.* --include='*copyright*' | less

Architecture: amd64 maps to x86_64. Architecture: all maps to any. The AUR requires x86_64 support, so a package that ships only arm64 is not allowed there.

Two Debian things do not carry over:

  • Maintainer scripts (postinst, prerm, and the rest) are shell scripts written for Debian tooling. Do not run them. Read them, and reproduce only what is still needed (a symlink, a license file) inside package(). If real post-install logic remains, use a .install file.
  • Debian package names are not Arch package names. libgtk-3-0t64 cannot go into depends.

The t64 suffix comes from the 64-bit time_t transition in Debian and Ubuntu. Arch did not rename those libraries. Drop the suffix and the soname digit, then find the shared object.


2. Map the dependencies

A sample Depends line:

Code Snippet
Depends: libc6 (>= 2.34), libgtk-3-0t64 (>= 3.24), libnotify4, libnss3, libasound2t64

Version constraints belong to Debian. On Arch you depend on the package name and pacman supplies the current library.

Find which Arch package owns a library:

Code Snippet
sudo pacman -Fy
pacman -F libgtk-3.so.0

Common translations:

Debian packageArch package
libc6glibc, already required by everything, leave it out
libstdc++6, libgcc-s1gcc-libs
zlib1gzlib
libglib2.0-0, libglib2.0-0t64glib2
libgtk-3-0, libgtk-3-0t64gtk3
libnotify4libnotify
libnss3nss
libnspr4nspr
libasound2, libasound2t64alsa-lib
libx11-6libx11
libxss1libxss
libxtst6libxtst
libdrm2libdrm
libcups2libcups
ca-certificatesca-certificates

Recommends and Suggests entries are optional on Debian. On Arch they become optdepends, written as 'package: reason'.

Libraries the .deb bundles under /opt or its own usr/lib are already in the archive and do not belong in depends. After the first build, namcap reports what is missing. A successful launch of the program outranks any guess.


3. Write the PKGBUILD

Install the tooling once:

Code Snippet
sudo pacman -S --needed base-devel namcap pacman-contrib

namcap lints recipes and built packages. pacman-contrib provides updpkgsums.

Name the directory after the package. Software that installs prebuilt deliverables takes the -bin suffix. The rule applies when upstream source is available. For proprietary software, also follow the Nonfree applications package guidelines on the ArchWiki.

Code Snippet
mkdir example-app-bin && cd example-app-bin

PKGBUILD:

Code Snippet
# Maintainer: Your Name <you at example dot com>
 
pkgname=example-app-bin
_pkgname=example-app
pkgver=1.4.2
_debrel=1
pkgrel=1
pkgdesc="Example desktop app, repackaged from the upstream .deb"
arch=('x86_64')
url="https://example.com"
license=('LicenseRef-proprietary')
depends=(
  'gtk3'
  'libnotify'
  'nss'
  'alsa-lib'
)
provides=("${_pkgname}=${pkgver}")
conflicts=("${_pkgname}")
options=('!strip' '!debug')
_deb="${_pkgname}_${pkgver}-${_debrel}_amd64.deb"
noextract=("${_deb}")
source_x86_64=("${_deb}::https://example.com/releases/${_deb}")
sha256sums_x86_64=('SKIP') # temporary, replaced by updpkgsums
 
package() {
  cd "$srcdir"
 
  # Unpack the .deb, then the filesystem image into the package root.
  bsdtar -xf "${_deb}"
  bsdtar -xf data.tar.* -C "$pkgdir"
 
  # Debian maintainer scripts are not run. Install the license where Arch expects it.
  if [[ -f "$pkgdir/usr/share/doc/${_pkgname}/copyright" ]]; then
    install -Dm644 "$pkgdir/usr/share/doc/${_pkgname}/copyright" \
      "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  fi
 
  # Remove Debian-only metadata. Leave real documentation alone.
  rm -f "$pkgdir/usr/share/doc/${_pkgname}/changelog.Debian.gz"
 
  find "$pkgdir" -type d -exec chmod 755 {} +
}

Field notes:

  • The first line follows the AUR format: # Maintainer: Name <address at domain dot tld>. Obfuscate the address against spam. If you take over a package, add earlier maintainers as # Contributor: lines.
  • pkgver is the upstream version. _debrel is the Debian revision after the hyphen in the filename. pkgrel counts recipe-only releases of the same upstream version.
  • noextract stops makepkg from guessing how to unpack the .deb. package() unpacks it explicitly, so the result does not depend on makepkg detection.
  • The text before :: in source_x86_64 is the filename makepkg saves.
  • sha256sums_x86_64 must match the downloaded file. Do not publish a binary package with SKIP.
  • license is the license of the upstream software, as an SPDX identifier (MIT, Apache-2.0, GPL-3.0-or-later). Use LicenseRef-proprietary when the copyright file is a vendor license, and install that file under usr/share/licenses.
  • options=('!strip' '!debug') stops makepkg from rewriting binaries you did not compile. Stripping a prebuilt executable can break it.
  • provides and conflicts let other packages depend on example-app and block parallel installs. conflicts is evaluated only when installing the package. Do not use replaces unless the package is a rename of another one (for example Ethereal to Wireshark). After pacman -Sy, any package carrying a matching replaces makes pacman swap out the installed one on its own, which is too invasive for an alternate build.

Generate the checksum:

Code Snippet
updpkgsums

Electron and Chromium-based programs ship a chrome-sandbox helper. On a standard Arch kernel with unprivileged user namespaces enabled, the app falls back to the namespace sandbox and does not need it. If it fails with a sandbox error (for example under linux-hardened), add this inside package(), after verifying the path exists:

Code Snippet
chmod 4755 "$pkgdir/opt/${_pkgname}/chrome-sandbox"

Desktop entries and icons are refreshed by pacman hooks. Do not call update-desktop-database or gtk-update-icon-cache in the recipe.


4. Build and install locally

Run makepkg as a normal user, never as root.

Code Snippet
makepkg -si

-s installs missing depends through pacman. -i installs the resulting package. Then lint:

Code Snippet
namcap PKGBUILD
namcap example-app-bin-1.4.2-1-x86_64.pkg.tar.zst

namcap flags libraries that are linked but missing from depends, and dependencies nothing uses. Launch the program afterwards. A missing entry shows up as error while loading shared libraries. Add the Arch package that owns that .so, rebuild, reinstall.

When you are the only user, makepkg -si is the complete installation. The rest of this article covers sharing the package.


5. Check the AUR submission rules

Packages that break the rules can be deleted without warning. Verify these before creating the repository:

  • Not in the official repositories. Search the official package database. If any version exists there, do not submit. If it is outdated, flag it out-of-date. If it is broken or lacks a feature, file a bug report. The only exception is a package with extra features or patches, which needs a different pkgname and a conflicts entry.
  • Not already in the AUR. Search the AUR. If it is maintained, send suggested changes as a comment. If it is unmaintained or the maintainer does not respond, adopt it. Do not create a duplicate.
  • Useful to more than a few people. Extremely specialized packages do not belong there.
  • x86_64 supported. Packages that do not support it are not allowed.
  • Correct suffix. -bin for prebuilt deliverables, -git and similar for VCS builds, no suffix for source builds of a fixed version.
  • No build artifacts. The AUR must not contain the makepkg tarball or a filelist. Do not commit the .deb, src/, pkg/, or *.pkg.tar.zst either.
  • Unsure? Ask for public review on the aur-general mailing list, the AUR forum, or the IRC channel before uploading.

6. Publish to the AUR

The AUR is a git host for PKGBUILD repositories. The repository name is the pkgbase, which equals pkgname for a single package: example-app-bin.

Account and SSH key

Register at aur.archlinux.org. Create a dedicated key pair rather than reusing an existing one, so you can revoke it without touching anything else:

Code Snippet
ssh-keygen -t ed25519 -f ~/.ssh/aur

Paste the public key into My Account. Several keys can be added, separated by newlines.

~/.ssh/config:

Code Snippet
Host aur.archlinux.org
  IdentityFile ~/.ssh/aur
  User aur

The AUR host does not provide an interactive shell. Verify the key by cloning or pushing.

Create the repository

Code Snippet
cd /tmp
git -c init.defaultBranch=master clone ssh://aur@aur.archlinux.org/example-app-bin.git

The AUR accepts pushes only to master. The init.defaultBranch option makes the new repository use that name. If you already have a local repository on another branch, rename the branch before pushing.

For a new package name, git prints a warning that you cloned an empty repository. That is expected. If the name belonged to a deleted package, the repository is not empty. Its old history is still there, and you must build on top of it.

Copy in the tested PKGBUILD. Add the remaining files.

.gitignore excludes everything by default so build output cannot be committed by accident:

Code Snippet
*
!.gitignore
!PKGBUILD
!.SRCINFO
!LICENSE

If the package needs a .install file or local patches, add them to the whitelist or force-add them with git add -f.

LICENSE licenses the recipe, not the .deb. Arch recommends 0BSD for package sources. It is not mandatory, but a package without a license, or under a different one, cannot be promoted to the official repositories. A REUSE.toml file is an accepted alternative way to declare licensing.

Code Snippet
Copyright (c) 2026 Your Name
 
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
 
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

This is separate from the license array in the PKGBUILD, which describes the packaged software.

Generate .SRCINFO. The AUR reads versions, descriptions, and dependencies from it. If metadata changes and .SRCINFO does not, the website keeps showing old values.

Code Snippet
makepkg --printsrcinfo > .SRCINFO

Commits are authored with your global git identity, and rewriting pushed commits on the AUR is very hard. To use different credentials for this package only:

Code Snippet
git config user.name "Your Name"
git config user.email "you@example.com"

Commit and push:

Code Snippet
git add PKGBUILD .SRCINFO LICENSE .gitignore
git commit -m "Initial import of example-app-bin 1.4.2-1"
git push

If .SRCINFO is missing from your latest commit, the AUR rejects the push. Add it and run git commit --amend, then push again.

The package page appears at https://aur.archlinux.org/packages/example-app-bin. Others install it by building the repository:

Code Snippet
git clone https://aur.archlinux.org/example-app-bin.git
cd example-app-bin
makepkg -si

AUR helpers such as yay and paru automate that same clone-and-build sequence.


7. Ship an update

For a new upstream release, change pkgver (and _debrel if the Debian revision changed) and reset pkgrel to 1. When you change the recipe in a way that alters the built package and the upstream version stays the same, increment pkgrel. Do not bump either value for trivial edits such as a typo fix, because that forces every user to rebuild for nothing.

Code Snippet
updpkgsums
makepkg -si
namcap example-app-bin-1.5.0-1-x86_64.pkg.tar.zst
makepkg --printsrcinfo > .SRCINFO
git add PKGBUILD .SRCINFO
git commit -m "Update to 1.5.0-1"
git push

Build before pushing. A stale checksum breaks the package for everyone.

Automation can detect new releases, but it cannot replace reading the changelog. Upstream may change licenses, add or drop dependencies, or alter packaging even in minor versions. Automated updates are at your own risk, and accounts whose scripts misbehave can be removed without notice.


8. Maintain the package

  • Read comments and apply useful suggestions.
  • Do not post a comment with the version number after each update. The page already shows it, and the comment section should stay readable.
  • Check upstream for new releases and improve the recipe over time. A published package is a commitment.
  • To stop maintaining it, use Disown Package in the AUR web interface and optionally post to the aur-general mailing list. A package with no maintainers becomes orphaned.

Requests go through Submit Request under Package Actions. They notify the maintainer and the aur-requests mailing list, and Package Maintainers accept or reject them.

  • Deletion: removes a pkgbase from the AUR. A short reason with supporting details is required, such as the package being provided elsewhere or renamed. The explanation must be in the request, because the comments are not visible once a Package Maintainer acts. A deleted package's git repository stays cloneable.
  • Merge: deletes a pkgbase and moves its votes and comments to another one, which must be named in the request. Use it when upstream renames a project. It has nothing to do with git merge.
  • Orphan: asks for a package to be disowned, usually after it has been flagged out-of-date for two weeks. It is granted after a two-week wait if the maintainer does not respond. Packages flagged for 180 days or more are orphaned automatically.

The .deb stays on the upstream server, pacman installs an ordinary package, and any Arch user can rebuild it from the PKGBUILD you pushed.