Linux command
aptitude 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Synchronize
sudo aptitude update
Install
sudo aptitude install [package]
Search
aptitude search [package]
Example
aptitude search '?installed([package])'
Remove
sudo aptitude remove [package]
Upgrade
sudo aptitude upgrade
Full upgrade
sudo aptitude full-upgrade
Simulate
sudo aptitude install -s [package]
Show why
aptitude why [package]
Hold
sudo aptitude hold '?installed([package])'
说明
aptitude is a powerful package management utility for Debian and Ubuntu systems. It provides both a command-line interface and an interactive ncurses-based interface with advanced dependency resolution and search capabilities.
参数
- update
- Synchronize package index files from sources
- install package
- Install or upgrade specified packages
- remove package
- Remove packages and dependent packages
- purge package
- Remove packages, configurations, and dependent packages
- upgrade
- Upgrade installed packages to newest versions
- full-upgrade
- Upgrade packages, removing obsolete ones as needed
- search pattern
- Search for packages matching pattern
- show package
- Display detailed package information
- hold package
- Prevent package from being upgraded
- unhold package
- Allow package to be upgraded
- safe-upgrade
- Upgrade packages conservatively
- clean
- Remove downloaded package files
- autoclean
- Remove old downloaded package files
- why package
- Explain why a package is installed or required
- why-not package
- Explain why a package cannot be installed
- download package
- Download .deb file without installing
- reinstall package
- Reinstall an already-installed package
- versions package
- List available versions of a package
- forbid-version package
- Prevent upgrade to a specific package version
- markauto package
- Mark package as automatically installed
- unmarkauto package
- Mark package as manually installed
- -s, --simulate
- Preview changes without applying them
- -y, --assume-yes
- Skip confirmation prompts
- -D, --show-deps
- Show explanations for automatic installations and removals
FAQ
What is the aptitude command used for?
aptitude is a powerful package management utility for Debian and Ubuntu systems. It provides both a command-line interface and an interactive ncurses-based interface with advanced dependency resolution and search capabilities.
How do I run a basic aptitude example?
Run `sudo aptitude update` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does update do in aptitude?
Synchronize package index files from sources