Linux command
pactrans 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Install
sudo pactrans --install [package]
Remove
sudo pactrans --remove [package]
Upgrade
sudo pactrans --sysupgrade
Example
sudo pactrans --file [path/to/package.pkg.tar.zst]
Install and remove
sudo pactrans --install [new_package] --remove [old_package]
pactrans --print-only --install [package]
Install from a specific repository
sudo pactrans [repo]/[package]
说明
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.
参数
- --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.
FAQ
What is the pactrans command used for?
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.
How do I run a basic pactrans example?
Run `sudo pactrans --install [package]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --install do in pactrans?
Interpret following targets as packages to install from repositories.