Introduction

Installing applications on a Linux operating system is a bit different from installing them on Windows.  When it comes to Windows applications, you’ll usually buy a disc at the store or pay online for a download.  Loading the disc or opening the download installs the software in a graphical user interface (GUI).  Also in Windows, updates are usually handled by the application.  When it launches, it checks with its home servers for updates.  Some applications, like antivirus software, check for updates automatically.

In Linux, special tools were developed for managing applications.  Application software for Linux usually comes in a package.  The package is a zipped (compressed) file, which holds all the files needed to install the software.  Sometimes an application has dependencies – that is, it relies on other components to work.

Linux operating systems use a software tool known as a package manager to make sure the software is correctly installed and up-to-date. The default package manager in Ubuntu is apt-get, and CentOS uses yum. The Package Manager is a local utility that manages software updates. It also keeps a current list of available software, stored externally in a database called a repository.  You can enable extra repositories to get access to additional software.  This guide will help you use apt-get commands to manage your packages.

Prerequisites

  • A Linux operating system
  • An internet connection
  • Access to a terminal / command line

Tools/Software

  • The apt-get tool, pre-loaded in Ubuntu and Debian-based Linux

Installation Procedure

The apt-get tool is included by default in most Debian-based versions of Linux, including Ubuntu. Different versions of Linux, like CentOS, Fedora, or FreeBSD, use different package managers. The theory is similar, but the actual commands will be slightly different. Refer to the manual pages to use package managers in other flavors of Linux.

Open a Terminal or Command Line (also known as a Console window, or a Shell)

Open a terminal  or command line (also known as a Console window, or a Shell)

Right-click the desktop, then left-click Open Terminal.

Or you can click the system menu > Applications > System Tools > Terminal. Alternatively, you can use use the Ctrl + Alt + A function keys to open Terminal.

Step 2: Updating Your Database of Available Packages

Linux software is maintained in databases that you can access over the internet.  Your machine keeps a sort of a “master list” of available software.  Refreshing your local list of software before installing a new application is a good habit to develop.

To refresh your local list of software. Type the following in a terminal:

sudo apt-get update

Your system will check the repositories for updated information.

NOTE

The sudo command tells Linux to perform the operation as a temporary administrator.  It may ask you for your password.

Step 3: Installing a Package, and Adding New Repositories

Most Linux software developers give instructions on how to access their software repositories. One way to add repositories is to install a software package called software-properties-common. This enables the add-apt-repository command (used in the next step). This will walk you through how to install a package using apt-get.

In your terminal window, type:

sudo apt-get install software-properties-common

Your system will reach out to the repositories, then download and install the software.  Once that completes, enter the following:

sudo add-apt-repository ppa:[repository_string]

Replace [repository_string] with the name of the repository you’re adding. This is usually located on the software developer’s website.

Once that completes, run another update (see Step 2).

Step 4: Install Software Updates

One handy feature of apt-get is that it can check for and apply software updates to all your packages at once.  Normally this is handled automatically on a schedule.  But if you’d like to manually scan and install updates, including updates for your core operating system, run the following command:

sudo apt-get upgrade

Your system will contact the servers, and start downloading all available software updates. This may take some time. Allow the process to complete.

Step 5: Uninstalling Software

The process for uninstalling an application using apt-get is simple.  Enter the following:

sudo apt-get remove [package_name]

Replace [package_name] with the system name of your application.  This may be different from the popular name, so make sure you double-check the name if you receive any errors.

Conclusion

Package managers are an incredibly handy feature for Linux users. They handle most of the grunt work, checking for updates and dependencies for you. With a basic understanding of apt-get, you gain a lot of control over your Linux installation.