Apt common command records of Linux operating system


apt command

apt (Advanced Packaging Tool) is a shell front-end package manager in Debian and Ubuntu.

The apt command provides commands to find, install, upgrade, and delete a certain, a group, or even all software packages. The commands are concise and easy to remember.

The apt command requires super administrator privileges (root).

reference

apt syntax

  apt [options] [command] [package ...]
  • options: Optional, options include -h (help), -y (select all "yes" when prompted during the installation process), -q (do not display the installation process), etc.
  • command: the operation to be performed.
  • package: The name of the installed package.

apt common commands

List all updateable software inventory commands

sudo apt update

Insert image description here

Upgrade software package

sudo apt upgrade

List updateable software packages and version information

apt list --upgradeable

Insert image description here

Upgrade the software package. Delete the software package that needs to be updated before upgrading.

sudo apt full-upgrade

Install the specified software command:

sudo apt install <package_name>
apt install nodejs

Insert image description here

Install multiple packages:

sudo apt install <package_1> <package_2> <package_3>

Update specified software command

sudo apt update <package_name>

Display package specific information, such as version number, installation size, dependencies, etc.

sudo apt show <package_name>

View installed software

dpkg --list

Delete package command

  • sudo apt-get remove –-purge 要卸载的软件的名字#Uninstall the software and delete the configuration file
  • sudo apt-get remove 要卸载的软件的名字#Uninstall the software
sudo apt remove <package_name>

Clean up dependencies and library files that are no longer used

sudo apt autoremove

Remove packages and configuration files

sudo apt purge <package_name>

Find package command:

sudo apt search <keyword>

Insert image description here

List all installed packages

apt list --installed

List version information of all installed packages

apt list --all-versions

如有启发,可点赞收藏哟~

Guess you like

Origin blog.csdn.net/weiCong_Ling/article/details/134621786