Pages

Wednesday, June 28, 2017

Understanding APT, APT-Cache and Their Frequently Used Commands

If you’ve ever used Debian or a Debian based distribution like Ubuntu or Linux Mint, then chances are that you’ve used the APT package system to install or remove software. Even if you’ve never dabbled on the command line, the underlying system that powers your package manager GUI is the APT system.
apt-get commands and apt-cache commands
Understanding APT and APT-Cache
Today, we are going to take a look at some familiar commands, and dive into some less or more frequently used APT commands, and shed some light on this brilliantly designed system.

What is APT?

APT stands for Advanced Package Tool. It was first seen in Debian 2.1 back in 1999. Essentially, APT is a management system for dpkg packages, as seen with the extension *.deb. It was designed to not only manage packages and updates, but to solve the many dependency issues when installing certain packages.
As anyone who was using Linux back in those pioneer days, we were all too familiar with the term “dependency hell” when trying to compile something from source, or even when dealing with a number of Red Hat’s individual RPM files.
APT solved all of these dependency issues automatically, making installing any package, regardless of the size or number of dependencies a one line command. To those of us who laboured for hours on these tasks, this was one of those “sun parting the clouds” moments in our Linux lives!

Understanding APT Configuration

This first file we are going to look at is one of APT’s configuration files.
$ sudo cat /etc/apt/sources.list
Sample Output
deb http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ precise main
deb-src http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ precise main
deb http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ precise-updates main
deb-src http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ precise-updates main
deb http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ precise universe
deb-src http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ precise universe
deb http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ precise-updates universe
deb-src http://us-west-2.ec2.archive.ubuntu.com/ubuntu/ precise-updates universe
deb http://security.ubuntu.com/ubuntu precise-security main
deb-src http://security.ubuntu.com/ubuntu precise-security main
deb http://security.ubuntu.com/ubuntu precise-security universe
deb-src http://security.ubuntu.com/ubuntu precise-security universe
As you can probably deduce from my sources.list file, I’m using Ubuntu 12.04 (Precise Pangolin). I’m also using three repositories:
  1. Main Repository
  2. Universe Repository
  3. Ubuntu Security Repository
The syntax of this file is relatively simple:
deb (url) release repository
The accompanying line is the source file repository. It follows a similar format:
deb-src (url) release repository
This file is pretty much the only thing you’ll ever have to edit using APT, and chances are that the defaults will server you quite well and you will never need to edit it at all.
      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
                                                    ► Read more: http://adf.ly/1nBSWu
      ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

No comments:

Post a Comment