APT Practice

APT Practice

https://www.debian.org/doc/manuals/debian-reference/ch02.en.html

https://www.debian.org/mirror/list.en.html

https://wiki.debian.org/SourcesList

$ cat /etc/apt/sources.list

sources.list(5) man page

$ man sources.list

apt

Show manual

$ man apt

Show help message

$ apt -h
apt 1.0.9.8.4 for amd64 compiled on Dec 11 2016 09:48:19
Usage: apt [options] command

CLI for apt.
Basic commands: 
 list - list packages based on package names
 search - search in package descriptions
 show - show package details

 update - update list of available packages

 install - install packages
 remove  - remove packages

 upgrade - upgrade the system by installing/upgrading packages
 full-upgrade - upgrade the system by removing/installing/upgrading packages

 edit-sources - edit the source information file

Update packages list

$ apt update

# Package repositories
$ cat /etc/apt/sources.list

Install packages

$ apt install apache2

Remove packages

$ apt remove apache2

List packages based on package names

$ apt list

Show installed packages

$ apt list --installed

Show versions and archive areas of available packages

$ apt list -a apache2

Show package information

$ apt show -a apache2

Search packages and descriptions

$ apt search apache2

https://www.debian.org/doc/manuals/refcard/refcard

https://wiki.debian.org/Apt

aptitude

Show help message

$ aptitude -h

Show manual

$ man aptitude

Update the packages list

$ aptitude update

Perform a safe upgrade

$ aptitude safe-upgrade

Install/upgrade packages

$ aptitude install foo

Remove packages

$ aptitude remove bar

Remove packages and their configuration files

$ aptitude purge foo

Search for a package by name and/or expression

$ aptitude search foo

Display detailed information about a package

$ aptitude show foo

https://wiki.debian.org/Aptitude

http://aptitude.alioth.debian.org/doc/en/

apt-get

https://wiki.debian.org/apt-get

Show help message

$ apt-get -h
apt 1.0.9.8.4 for amd64 compiled on Dec 11 2016 09:48:19
Usage: apt-get [options] command
       apt-get [options] install|remove pkg1 [pkg2 ...]
       apt-get [options] source pkg1 [pkg2 ...]

apt-get is a simple command line interface for downloading and
installing packages. The most frequently used commands are update
and install.

Commands:
   update - Retrieve new lists of packages
   upgrade - Perform an upgrade
   install - Install new packages (pkg is libc6 not libc6.deb)
   remove - Remove packages
   autoremove - Remove automatically all unused packages
   purge - Remove packages and config files
   source - Download source archives
   build-dep - Configure build-dependencies for source packages
   dist-upgrade - Distribution upgrade, see apt-get(8)
   dselect-upgrade - Follow dselect selections
   clean - Erase downloaded archive files
   autoclean - Erase old downloaded archive files
   check - Verify that there are no broken dependencies
   changelog - Download and display the changelog for the given package
   download - Download the binary package into the current directory

Options:
  -h  This help text.
  -q  Loggable output - no progress indicator
  -qq No output except for errors
  -d  Download only - do NOT install or unpack archives
  -s  No-act. Perform ordering simulation
  -y  Assume Yes to all queries and do not prompt
  -f  Attempt to correct a system with broken dependencies in place
  -m  Attempt to continue if archives are unlocatable
  -u  Show a list of upgraded packages as well
  -b  Build the source package after fetching it
  -V  Show verbose version numbers
  -c=? Read this configuration file
  -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp
See the apt-get(8), sources.list(5) and apt.conf(5) manual
pages for more information and options.
                       This APT has Super Cow Powers.

Show manual

$ man apt-get

Update packages list

$ apt-get update

Install packages

$ apt-get install apache2

Remove packages

$ apt-get remove apache2

你可能感兴趣的:(APT Practice)