apt-get command

1, apt-get command

apt-get command is Debian Linux release APT package management tools, all distributions Debian based package management uses this system.

(1) command syntax

apt-get (option) (parameters)

(2) common options

-c: Specifies the configuration file.

(3) parameters

Management instructions: APT package management operations.

Package: Specifies the package to be operated.

(4) Examples

Using the apt-get command first step is to introduce the necessary software libraries, Debian's software library is a collection of all the Debian packages, the number of public Internet sites they exist, these addresses will only join, apt-get command to search we want to software, file /etc/apt/sources.list configuration file is stored in the address list, its format is as follows:

deb [web or ftp address] [name release] [main / contrib / NON- as Free ]

Ubuntu is a common system based on Debian release, the following is commonly used apt-get command:

When modifying the /etc/apt/sources.list or / etc / apt / preferences After that, run the following command to ensure the package list is up to date:

$ sudo apt-get update

Update all installed packages:

$ sudo apt-get upgrade

The system will be upgraded to the new version:

$ sudo apt-get dist-upgrade

Install a new package:

$ sudo apt-get install <packagename>

To delete an installed package, do not remove the dependency package, save the configuration file:

$ sudo apt-get remove <packagename>

To delete an installed software package, does not retain the configuration file:

$ sudo apt-get --purge remove <packagename>
or
$ sudo apt-get purge remove <packagename>

Delete To satisfy dependencies installed, but now do not need package (reservations configuration file):

$ sudo apt-get autoremove <packagename>

APT is dpkg bottom package, and dpkg when installing the package, will * .deb in / var / cache / apt / archives, remove / var / cache / apt / archives has expired deb:

$ sudo apt-get autoclean

All deb / var / cache / apt / archives under deleted:

$ sudo apt-get clean

When you want to completely uninstall the software, you can run the following specific commands:

# Delete software and its configuration file 
$ sudo APT-GET --purge the Remove <PackageName> 
# delete useless dependencies 
$ sudo APT-GET autoremove <PackageName> 
# dpkg list at this time there are "rc" state package , you can execute the following command to do the final clean-up 
$ dpkg the -l | grep ^ rc | awk  ' {Print $ 2} ' | sudo  xargs dpkg - P 
# delete the temporary installation of software packages 
$ sudo APT-GET Clean <PackageName>

 

reference:

https://www.jianshu.com/p/4a409053575a

https://man.linuxde.net/apt-get

https://blog.csdn.net/get_set/article/details/51276609

Guess you like

Origin www.cnblogs.com/Cqlismy/p/11432047.html