LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pactrans

Install, remove, and upgrade packages using ALPM transactions

TLDR

Install a package from repository
$ sudo pactrans --install [package]
copy
Remove a package
$ sudo pactrans --remove [package]
copy
Upgrade all installed packages
$ sudo pactrans --sysupgrade
copy
Install a package file
$ sudo pactrans --file [path/to/package.pkg.tar.zst]
copy
Install and remove packages in a single transaction
$ sudo pactrans --install [new_package] --remove [old_package]
copy
Print what would happen without executing
$ pactrans --print-only --install [package]
copy
Install from a specific repository
$ sudo pactrans [repo]/[package]
copy

SYNOPSIS

pactrans [options] [target...]

DESCRIPTION

pactrans handles package installation, removal, and system upgrades using the ALPM (Arch Linux Package Management) library. It provides a unified interface for common package operations with support for mixed transactions.The tool can install and remove packages in a single transaction. Package specifications can include repository prefixes (e.g., extra/vim) for precise control over package sources. If only a package name is provided, repositories are searched in the order they are declared.The pacinstall and pacremove commands are aliases that differ only in their default interpretation of targets but are otherwise identical to pactrans.If stdin is not connected to a terminal, package specifications are read from stdin.

PARAMETERS

--install

Interpret following targets as packages to install from repositories.
--remove
Interpret following targets as packages to remove.
--sysupgrade
Upgrade all installed packages to the latest available versions.
--file
Interpret following targets as local package files to install.
--spec
Interpret following targets as pkgspecs: install if a file or repo package, remove if a local database entry.
--print-only
Display what the transaction would do and exit without making changes.
--no-confirm
Do not prompt for confirmation.
--no-deps
Ignore dependency checks.
--dbonly
Make changes to the database without extracting or removing files.
--config file
Use an alternate pacman configuration file.
--dbpath path
Use an alternate database path.
--sysroot path
Set an alternate system root.

CAVEATS

Requires root privileges for system modifications. Uses pacman's configuration and database. Part of the pacutils package. Transaction conflicts must be resolved manually.

HISTORY

pactrans is part of pacutils, created by Andrew Gregory. It provides a programmatic interface to ALPM transactions, useful for scripts and automation that need fine-grained control over package operations.

SEE ALSO

Copied to clipboard
Kai