Linux command
apt-get 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Update
sudo apt-get update
Install
sudo apt-get install [package]
Remove
sudo apt-get remove [package]
Remove
sudo apt-get purge [package]
Upgrade
sudo apt-get upgrade
Clean
sudo apt-get autoclean
Remove
sudo apt-get autoremove
Upgrade
sudo apt-get dist-upgrade
说明
apt-get is the command-line package management utility for Debian and Ubuntu. It handles installation, upgrade, and removal of software packages. For interactive use, apt is recommended as a more user-friendly alternative.
参数
- update
- Resynchronize package index files from sources
- upgrade
- Install newest versions of all currently installed packages
- dist-upgrade
- Upgrade and handle changing dependencies
- install package
- Install or upgrade specified packages
- remove package
- Remove packages
- purge package
- Remove packages and configuration files
- autoremove
- Remove automatically installed packages no longer needed
- autoclean
- Clear local repository of retrieved package files that can no longer be downloaded
- clean
- Clear local repository of all retrieved package files
- download package
- Download the binary package into the current directory
- source package
- Fetch source packages
- -y, --yes
- Automatic yes to prompts
- -d, --download-only
- Download packages but don't install
- --no-install-recommends
- Don't install recommended packages
- -f, --fix-broken
- Attempt to fix broken dependencies
FAQ
What is the apt-get command used for?
apt-get is the command-line package management utility for Debian and Ubuntu. It handles installation, upgrade, and removal of software packages. For interactive use, apt is recommended as a more user-friendly alternative.
How do I run a basic apt-get example?
Run `sudo apt-get update` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does update do in apt-get?
Resynchronize package index files from sources