LinuxCommandLibrary

pactrans

Translate package names and dependencies

TLDR

Install a package from a repository

$ sudo pactrans --install [package_name]
copy

Remove a package
$ sudo pactrans --remove [package_name]
copy

Upgrade all installed packages
$ sudo pactrans --sysupgrade
copy

Install a package file
$ sudo pactrans --file [path/to/package.pkg.tar.zst]
copy

Replace a locally installed package with a package from a repository
$ sudo pactrans local/[package_to_remove] [repository_name]/[package_to_install]
copy

Print what the transaction would do without performing it
$ pactrans --print-only --install [package_name]
copy

SYNOPSIS

pactrans <command> [options] [transaction_id | package_name]

PARAMETERS

list
    Lists all recorded package transactions, typically ordered by date. This would show a summary like ID, date, time, and a brief description of the operation.

show <transaction_id>
    Displays detailed information for a specific transaction ID. This includes all packages affected (installed, updated, removed) along with their old and new versions.

packages <transaction_id>
    Shows only the list of packages involved in a given transaction ID, without additional details like versions or operation type.

find <package_name>
    Searches through all transactions to find when a specific package was installed, updated, or removed.

rollback <transaction_id>
    Attempts to revert the system to the state before the specified transaction. Note: This is a highly complex and potentially risky operation, often requiring system snapshots or careful manual intervention for a robust solution.

replay <transaction_id>
    Re-applies the changes of a specific transaction. Useful for reapplying updates or installations that might have been accidentally undone.

-d, --date <date_range>
    Filters transaction listings or searches by a specific date or date range (e.g., 'yesterday', '2023-01-01', 'last week').

-p, --packages-only
    When used with list or show, limits output to only affected package names.

-f, --force
    Used with rollback or replay to bypass some warnings or confirmations. Use with extreme caution.

-v, --verbose
    Provides more detailed output for commands like list or show.

-h, --help
    Displays the help message and available commands/options.

DESCRIPTION

Please note: The pactrans command is not a standard Linux utility found in most distributions. This analysis describes a hypothetical command designed to enhance the management and inspection of pacman package manager transactions, particularly for Arch Linux and its derivatives. If it existed, pactrans would provide a more granular view of system changes related to package operations than simply parsing pacman.log. It would allow users to list past package installations, updates, and removals as discrete transactions, view detailed information for each, and potentially offer experimental or limited rollback capabilities. Its primary goal would be to simplify auditing, troubleshooting, and understanding the history of package modifications on a system, offering functionalities that complement pacman's core operations.

CAVEATS

The pactrans command is hypothetical and not a standard, pre-installed utility in most Linux distributions, including Arch Linux. Its functionality, especially transaction rollback, would be extremely complex to implement reliably without a robust filesystem snapshot mechanism (like Btrfs/ZFS snapshots managed by tools like snapper or timeshift). Direct package manager rollbacks can lead to dependency hell or a broken system state if not handled meticulously. Users seeking similar functionality often rely on parsing pacman.log with custom scripts or dedicated snapshot tools.

TRANSACTION DATA SOURCE

A hypothetical pactrans would likely parse the standard /var/log/pacman.log file, potentially augmented by a custom database or extended log files to capture more structured transaction metadata, such as before/after package versions and explicit operation types (install, upgrade, remove).

ROLLBACK MECHANISM

For reliable rollback, pactrans would need to carefully identify all packages changed in a transaction and downgrade or reinstall them to their previous versions. This process is inherently risky due to potential dependency conflicts or the unavailability of older package versions in repositories. A truly safe rollback often requires system-level snapshots rather than just package-level manipulation.

HISTORY

While pactrans itself is hypothetical, the desire for robust pacman transaction management and easy rollback capabilities has been a long-standing feature request or topic of discussion within the Arch Linux community. Users often resort to custom scripts, wrapper utilities, or filesystem snapshot tools to achieve similar effects. If developed, pactrans would likely emerge as a community-driven project aiming to fill this gap, offering a more user-friendly interface to pacman's operational history.

SEE ALSO

pacman(8), paclog(1), pacdiff(1), snapper(8), timeshift(8)

Copied to clipboard