Dpkg::Arch(3perl) libdpkg-perl Dpkg::Arch(3perl)

# [NAME](#NAME)

Dpkg::Arch - handle architectures

# [DESCRIPTION](#DESCRIPTION)

The Dpkg::Arch module provides functions to handle Debian architectures, wildcards, and mapping from and to GNU triplets.

No symbols are exported by default. The :all tag can be used to import all symbols. The :getters, :parsers, :mappers and :operators tags can be used to import specific symbol subsets.

# [FUNCTIONS](#FUNCTIONS)

$arch = **get\_raw\_build\_arch()**

Get the raw build Debian architecture, without taking into account variables from the environment.

$arch = **get\_build\_arch()**

Get the build Debian architecture, using DEB\_BUILD\_ARCH from the environment if available.

$arch = **get\_raw\_host\_arch()**

Get the raw host Debian architecture, without taking into account variables from the environment.

$arch = **get\_host\_arch()**

Get the host Debian architecture, using DEB\_HOST\_ARCH from the environment if available.

@arch\_list = **get\_valid\_arches()**

Get an array with all currently known Debian architectures.

$multiarch = gnutriplet\_to\_multiarch($gnutriplet)

Map a GNU triplet into a Debian multiarch triplet.

$multiarch = debarch\_to\_multiarch($arch)

Map a Debian architecture into a Debian multiarch triplet.

$gnutriplet = debarch\_to\_gnutriplet($arch)

Map a Debian architecture into a GNU triplet.

$arch = gnutriplet\_to\_debarch($gnutriplet)

Map a GNU triplet into a Debian architecture.

$bool = debarch\_eq($arch\_a, $arch\_b)

Evaluate the equality of a Debian architecture, by comparing with another Debian architecture. No wildcard matching is performed.

$bool = debarch\_is($arch, $arch\_wildcard)

Evaluate the identity of a Debian architecture, by matching with an architecture wildcard.

$bool = debarch\_is\_wildcard($arch)

Evaluate whether a Debian architecture is an architecture wildcard.

$bool = debarch\_is\_invalid($arch, %opts)

Validate an architecture name.

Options:

[**positive**](#positive)

If set to a true value, only positive architectures will be accepted, otherwise negated architectures are allowed.

$bool = debarch\_is\_illegal($arch, %opts)

This is a deprecated alias for debarch\_is\_invalid.

$bool = debarch\_is\_concerned($arch, @arches)

Evaluate whether a Debian architecture applies to the list of architecture restrictions, as usually found in dependencies inside square brackets.

@array = debarch\_list\_parse($arch\_list, %opts)

Parse an architecture list.

Options:

[**positive**](#positive~2)

If set to a true value, only positive architectures will be accepted, otherwise negated architectures are allowed.

# [CHANGES](#CHANGES)

## [Version 1.04 (dpkg 1.23.0)](#Version_1.04_%28dpkg_1.23.0%29)

New functions: **debarch\_is\_invalid()**.

Deprecated functions: **debarch\_is\_illegal()**.

## [Version 1.03 (dpkg 1.19.1)](#Version_1.03_%28dpkg_1.19.1%29)

New argument: Accept a "positive" option in **debarch\_is\_illegal()** and **debarch\_list\_parse()**.

## [Version 1.02 (dpkg 1.18.19)](#Version_1.02_%28dpkg_1.18.19%29)

New import tags: ":all", ":getters", ":parsers", ":mappers", ":operators".

## [Version 1.01 (dpkg 1.18.5)](#Version_1.01_%28dpkg_1.18.5%29)

New functions: **debarch\_is\_illegal()**, **debarch\_list\_parse()**.

## [Version 1.00 (dpkg 1.18.2)](#Version_1.00_%28dpkg_1.18.2%29)

Mark the module as public.

# [SEE ALSO](#SEE_ALSO)

[**dpkg-architecture**(1)](/man/os/dpkg/dpkg-architecture.1).

2026-09-09 1.23.11-dirty

---

Document: Dpkg::Arch(3perl) from dpkg 1.23.11-r2 (Chainguard OS)
Source: https://git.dpkg.org/git/dpkg/dpkg.git
