The apt-get Package Management Tool

From Free Knowledge Base- The DUCK Project: information for everyone
Revision as of 12:52, 26 February 2014 by Admin (Talk | contribs)

Jump to: navigation, search

The apt-get command is a powerful command-line tool for performing such functions as installation of new software packages, upgrade of existing software packages, updating of the package list index, and even upgrading the entire linux distribution system on a computer.

The apt-get command is part of APT, or Advanced Packaging Tool. APT was originally designed as a front-end for dpkg to work with Debian's .deb packages. There is no single "apt" program; apt is a collection of tools. Two such programs are apt-get and apt-cache. This document focuses on apt-get.

Some common distributions that use apt-get:

  • Debian
  • Ubuntu / KUbuntu

install software using apt-get

The command to install a package

apt-get install package

apt-get install --only-upgrade <packagename> will not install any new packages

apt-get install <packagename> will upgrade only that single package

repositories

Apt stores a list of repositories or software channels in the file.

/etc/apt/sources.list

These are places where software can be obtained from using apt-get. The main repositories are stored in this file, not additional repositories use add with the add-apt-repository command. Do not manually edit sources.list or, if you feel you must, make a backup first before editing.

For example, user wanted to install the tv-maxe app on Ubuntu which is not in the typical Ubuntu repositories. So user added a repository.

add-apt-repository ppa:venerix/pkg
apt-get update

The second command, 'apt-get update' downloads the package lists from the repositories and "updates" them to get information on the newest versions of packages and their dependencies. Since user added a new repository, the command is ran to update the latest package list from that new repository. A new repository is also known as a 'PPA'.

The new repositories user added do not get added to the sources.list file, but instead they go into separate files under

/etc/apt/sources.list.d

And you can use the add-apt-repository command to remove them

sudo apt-add-repository --remove ppa:venerix/pkg

This does not remove the program that was installed, in this case tv-maxe. Now user will not be able to easily update tv-maxe via the 'apt-get install <packagename> will upgrade only that single package.' - since the repository is gone. If user wishes to keep tv-maxe easily updated with new releases, user will have to keep the repository.