ltstudiooo - Fotolia
The Advanced Package Tool, also known as apt-get, is an application manager for Unix and Linux-like systems. It was originally released in 1998 to handle retrieving and loading applications into Debian Linux systems. One of apt-get's claims to fame is its excellent ability to resolve software dependencies. It normally uses .deb-formatted files, although it has been modified to also handle Red Hat's Package Manager (RPM) files using apt-rpm.
Apt-get is widely used by the Linux community, making it an important tool for managing desktops, notebooks and networks. As Linux gains popularity in the enterprise, it makes sense for Windows and Mac users to be aware of how applications are loaded using apt-get.
Also, with increasing interest in the single-board devices, such as the Raspberry Pi, apt-get is a convenient way to load applications on those platforms. If the program you want to load needs a library or another application to work properly, apt-get will find it and load that code as well. The current stable version is 22.214.171.124, released in October 2014.
Mainstream Linux systems using apt-get include Debian and variants of Ubuntu. Most of the time, the tool runs from the command line. There are a few graphical front ends you can use on the desktop, including Synaptic Package Manager, the Ubuntu Software Center, Aptitude and Kpackage. Raspberry Pi and Beaglebone Black nano-Linux board users can easily use apt-get to load programs because these systems generally are derived from Ubuntu or Debian code.
The Red Hat Package Manager is an alternative package manager and uses a somewhat different methodology. Generally, you can use RPM on Red Hat systems to load applications.
One package manager isn't necessarily better than another. I think dependency resolution under apt-get is better than in RPM, although I also think it's a little more complicated to use, particularly for novices working from the command line.
You need Ubuntu, KDE or Debian on the machine in whose the command line apt-get will be used.
Loading applications, called packages, is a little different than on Windows or Mac machines. Typically you'd grab an installation file on Windows and execute it to load the new program. There may be digital rights manager issues to deal with. Many times, you'll need to have superuser or root privileges to run apt-get on the Linux box. That makes sense, because you don't want just anybody loading programs on your machine. The sudo command gives you temporary privileges for apt-get when loading applications on your individual notebook and desktop.
The basic form of the command for apt-get is:
sudo apt-get install [package name]
Before loading a new application, it's best to issue a command that brings all the application repository lists up to date. The following command retrieves a new list of available apps in your repositories.
sudo apt-get update
After completion, you can then use the normal apt-get install to load the program.
For example, if you wanted to install the popular Wireshark network sniffer, you'd use the following command:
sudo apt-get install wireshark
The command will run, and you'll see some text scroll by. At some point, you'll probably be asked a question if you want new files downloaded and installed. This is normal and you'd just type "y" for yes to proceed.
After a little while, you'll be returned to the command line, and the program will be available for use. You can execute the file from the command line, or it may show up in one of the desktop menus. Sometimes the program name won't appear in the desktop menus until you log out and then log back in.
Say you don't want a certain application on your Linux notebook anymore. Removing the program with apt-get is one option. Here's the appropriate command
sudo apt-get remove [package name]
Removing our newly installed Wireshark program might look like the following.
sudo apt-get remove wireshark
This time, you'll get a message asking if you want to free up disk space. Again, just type "y" to proceed.
Suppose something goes amiss with apt-get or your power goes off while installing a package. Just check to see if there are broken dependencies with this command:
sudo apt-get check
If you need to fix a package or repair dependencies, you can use apt-get with the "-f" option. Make sure to run the autoremove option to get rid of any broken stuff that's hanging around.
sudo apt-get autoremove
sudo apt-get install -f
If you run into problems running apt-get, a good place to find a solution is the apt-get wiki from Debian.
There is quite a selection of options for apt-get. You can get a terse list of options from the command line with the following:
Another place to look for more information is the Ubuntu community how-to page for apt-get. This page gives a comprehensive view of apt-get, its options, and why things work the way they do.
Also, if you are interested in seeing how apt-get and Red Hat Package Manager work but don't have Linux on your machine, you can boot to that operating system with a USB stick.
Package managers make installing Linux programs easier
Alternative OSes, productivity suites grow their niche
Learn ways to install Linux on Windows 7 machines
Consider an open source OS after Windows XP