Apt-get Usage

From Glitchdata
Jump to navigation Jump to search

Update Package Index

The ‘update‘ command is used to resynchronize the package index files from the their sources specified in /etc/apt/sources.list file. The update command fetched the packages from their locations and update the packages to newer version.

$ sudo apt-get update

Search Package Index

Apt-cache is use to search for an available package from the repositories.

$ sudo apt-cache search packagename

Examine Package Details

Apt-cache is used to find details of a package

$ sudo apt-cache show packagename
$ sudo apt-cache showpkg packagename

Install a Package

Use apt-get to install a package:

$sudo apt-get install packagename

Upgrade Installed Packages

The ‘upgrade‘ command is used to upgrade all the currently installed software packages on the system. Under any circumstances currently installed packages are not removed or packages which are not already installed neither retrieved and installed to satisfy upgrade dependencies.

$ sudo apt-get upgrade

List Installed Packages

$dpkg --list

Upgrade Specific Packages

Use install to upgrade specific pacakges.

$ sudo apt-get install packagename

Remove Specific Package

$ sudo apt-get remove packagename
$ sudo apt-get --purge remove packagename