How to Install Software on Ubuntu: A Beginner’s Guide to Snap and APT
Ubuntu
Quick Links
-
The Ubuntu Software Ecosystem
-
Installing Software Through Ubuntu Software Center
-
Installing Software at the Command Line using Snap
-
Installing Software at the Command Line Using APT
-
Installing Software from Third-Party Sources
-
Best Practices for Software Management on Ubuntu
Finding and installing software on Ubuntu Linux can be confusing at first. This guide will show you how to install, update, and remove any application you may need on your Ubuntu system!
The Ubuntu Software Ecosystem
Ubuntu’s software ecosystem is built around repositories, which are centralized locations that contain pre-verified software packages. Ubuntu’s software repositories are separated into four distinct categories:
- Main: Officially supported open-source software.
- Universe: Community-maintained open-source software.
- Multiverse: Software that may have licensing restrictions.
- Restricted: Proprietary drivers and other software essential for functionality.
Repositories ensure software stability and security, creating the underlying infrastructure that makes the Ubuntu Software Center possible.
Ubuntu Package Formats: DEB and Snap
Ubuntu supports two main package formats: DEB and Snap. DEB packages are the traditional format for Ubuntu, providing fast, efficient installations. Snap packages are designed to be more secure and portable. Snap applications come bundled with everything they need to run (no dependencies). This makes them easier to manage, but sometimes larger and/or slower than the same app installed via DEB packages.
Installing Software Through Ubuntu Software Center
The Ubuntu Software Center provides a graphical interface for software management, making it perfect for users who prefer a point-and-click experience. It will allow you to install, update, and remove software in both DEB and Snap format.
You can either browse through the software center through various categories, or run a direct search by typing in the name or type of program you are looking for. You can also search for the name of software that you have installed if you want to uninstall it. The search bar is conveniently located at the top-center of the window.
Results under “Snap Packages” are, obviously, snaps. Results under “Debian Packages” are DEB packages.
To install or remove software, click on the software title and then click on “Install” or “Remove” as the case may be. It’s as simple as that!
Software Center will automatically take care of downloading and installing (or removing) Snap packages, DEB packages, and any needed dependencies without any further intervention from you. After new software is installed, Ubuntu will automatically update it when new versions are available.
Installing Software at the Command Line using Snap
Generally, the Software Center will do everything you need to do with snaps. You can, however, manage snap packages from the command line if you want more fine-grained control. The following are a few quick commands to get you started.
For basic help with the snap command:
snap help
To search for specific snap packages enter:
snap find package-name
To list all installed snap packages:
sudo snap list
To install a specific snap package:
sudo snap install package-name
To remove a snap package:
sudo snap remove package-name
Be careful when removing snaps. Some are needed for your Ubuntu system to function properly. If you’re not sure what a package is or does, it is always safest to leave it as is.
If you’re interested in learning more, check out this advanced guide to managing snaps on your Ubuntu system.
Installing Software at the Command Line Using APT
The Advanced Package Tool (APT) is a command-line (terminal) tool for managing DEB packages. It handles everything from downloads and resolving dependencies for complex applications to updating all of your software and even the Ubuntu operating system itself.
An APT Quick Start Guide
Before installing anything, it’s always a good idea to update the package list to ensure access to the latest versions:
sudo apt update
To install a package, use the following command:
sudo apt install package-name
For example, the popular VLC video player:
sudo apt install vlc
If you no longer need a package, uninstall it with:
sudo apt remove package-name
For example, to remove VLC:
sudo apt remove vlc
You can have APT check for and install updates for all packages on your system (including Ubuntu system packages):
sudo apt upgrade
APT will also clean up for you and automatically remove leftover packages that are no longer needed:
sudo apt autoremove
Installing Software from Third-Party Sources
You will occasionally run across software that is distributed by its author(s) or a third-party organization which is not available in the Ubuntu Software Center. This software can be in several possible formats, but most commonly you will need to download a DEB package or add a PPA location to your system.
Adding a PPA (Personal Package Archive)
PPAs are repositories maintained by developers for distributing the latest versions of their software. They work in exactly the same way as Ubuntu’s own software repositories, but they are privately managed by a third party. After you add a PPA, APT will automatically include its contents in all future operations. You can install software from the PPA using the same commands listed above. Any software you do install will be included in updates when they are run as well. You can add a new PPA and install software from it with just three quick commands in the terminal:
To add a new PPA, use the following command:
sudo add-apt-repository ppa:repository-name
Next, update the software information cache to include data from the new PPA:
sudo apt update
Finally, install the software just like any other package:
sudo apt install package-name
For example, if you wanted to add the official PPA for the popular web browser Firefox and then install it, you would enter the following commands at a terminal prompt:
sudo add-apt-repository ppa:mozillateam/ppa
sudo apt update
sudo apt install firefox
Firefox would then be updated along with all your other software automatically when the software updater runs. Firefox comes installed on Ubuntu, of course, but this example illustrates the steps to add a new PPA to your Ubuntu system’s repositories.
Installing From a Downloaded DEB File
Some applications provide standalone DEB files. Here’s how to install them from the Ubuntu terminal:
Download the DEB file from a source you trust and save it to a destination you can remember, such as your Downloads folder. At your terminal prompt, switch into the directory where you saved the file and use dpkg to install it.
cd ~/Downloads
sudo dpkg -i filename.deb
If dpkg returns any errors indicating dependency issues, you should be able to correct them with the following command:
sudo apt --fix-broken install
Best Practices for Software Management on Ubuntu
- Keep Your System Updated: Snaps should be updated automatically as new versions become available. You can also run “Software Updater” from the app launcher to check and update all DEB packages on your system.
- Use Trusted Sources: Installing any software means potentially giving it complete access to all the data on your computer or even your network. Don’t install anything you are unsure of. You should always check the legitimacy of any third-party application you come across.
- Back Up Your Data: Before experimenting with new software, ensure your critical data is backed up. Small mistakes can cause big losses.
You are now well-equipped to explore the wide world of Ubuntu’s software ecosystem. You should be able to find, install, and remove any software you need with ease. From simple task tracking programs to full-featured office suites and exciting games, Ubuntu has you covered.