Ade Malsasa Akbar contact
Senior author, Open Source enthusiast.
Thursday, August 23, 2018 at 14:20


After Basic Software Installation, this seventh tutorial talks about adding PPA and installing software from it. A PPA is actually a repository. People use PPAs mostly for installing software versions that are not available in Ubuntu normal repository. You will learn what PPAs available and how to determine a PPA suitable to your version of Ubuntu or not. You will also learn how to remove a PPA and the package installed from it. Happy learning!

Subscribe to UbuntuBuzz Telegram Channel to get article updates directly.
To practice this tutorial you can read List of PPAs for 16.04 LTS, 16.10, and 17.04.
Read previous parts Part 1, Part 2, Part 3, Part 4, Part 5, and Part 6.

Your Ubuntu Version


Know your version first before adding up any PPA.
- By command line: $ lsb_release -a
- By GUI: see desktop menu > Details

PPA Examples


This tutorial is based on 18.04 "bionic". Here's some popular PPAs that support bionic:
- Inkscape
- GIMP
- LibreOffice
- Persepolis

What Is PPA


A PPA is a page with information for adding software to your system. A PPA address looks like ppa:[name]/[name] like these examples:

  • ppa:inkscape.dev/stable
  • ppa:otto-kesselgulasch/gimp
  • ppa:libreoffice/ppa
  • ppa:persepolis/ppa

Mostly, you will find PPA address under "Adding this PPA to your system":

Selected text above is the PPA address

PPA Version vs Ubuntu Version


You cannot install PPA if it mismatches your Ubuntu version. This means the PPA should have packages for your Ubuntu version, for example, if you use 18.04 then look for PPA that support 18.04. To see if a PPA supports your version, see the "Adding this PPA to your system" section. If there is your Ubuntu version, then it means it supports your Ubuntu version. If there is not, then it doesn't.

This picture means the PPA supports 14.04, 16.04, 17.10, 18.04, and 18.10


1. Adding New PPA


After making sure your Ubuntu version matches PPA version, then add the PPA. Mostly, in each addition, your permission will be asked so answer the prompt by pressing Enter. Or, if you want not to be asked, simply add  --yes  option before the PPA address.

Steps to add:
  1. Use the apt-add-repository command.
  2. Press Enter to permit addition. (however, press Ctrl+C to cancel)
  3. Newer version of Ubuntu will automatically refresh (redownload repo indexes).
  4. If no refresh committed, run refresh command: sudo apt-get update
  5. Finished.

Formula:
$ sudo apt-add-repository [ppa_name]

Examples:
$ sudo apt-add-repository ppa:libreoffice/ppa
$ sudo apt-add-repository ppa:otto-kesselgulasch/gimp
$ sudo apt-add-repository ppa:inkscape.dev/stable
$ sudo apt-add-repository ppa:persepolis/ppa

Sample output:
ubuntu-mate@ubuntu-mate:~$ sudo apt-add-repository ppa:persepolis/ppa
 Persepolis download manager is a GUI for aria2
[...]
Press [ENTER] to continue or Ctrl-c to cancel adding it.

Get:1 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:2 http://ppa.launchpad.net/persepolis/ppa/ubuntu bionic InRelease [15.9 kB]
Get:3 http://ppa.launchpad.net/persepolis/ppa/ubuntu bionic/main amd64 Packages [564 B]
[...]

2. Checking Software Versions


When you add a new PPA, it may adds more than 1 version to a package. For example, adding LibreOffice PPA may gives you 3 different versions of LibreOffice. How to check the versions?

Formula:
$ apt-cache policy [package_name]

Examples:
$ apt-cache policy libreoffice
$ apt-cache policy gimp
$ apt-cache policy inkscape
$ apt-cache policy persepolis

Sample output:
ubuntu-mate@ubuntu-mate:~$ apt-cache policy libreoffice
libreoffice:
  Installed: (none)
  Candidate: 1:6.0.6-0ubuntu0.18.04.1
  Version table:
     1:6.0.6-0ubuntu0.18.04.1 500
        500 http://ppa.launchpad.net/libreoffice/ppa/ubuntu bionic/main amd64 Packages
***1:6.0.3-0ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
ubuntu-mate@ubuntu-mate:~$

Meanings of sample output:
  • The package name is libreoffice. 
  • The download address is http://ppa.launchpad.net.
  • libreoffice version from PPA is newer than from repo. See 6.0.6 vs 6.0.3.
  • Installed version is 6.0.3 from repo, and the PPA version is not installed. See *** sign.
  • If you do install libreoffice then the PPA version 6.0.6 will be installed because it's newer.

3. Installing Software


This installation command will install the package:

Formula:
$ sudo apt-get install [package_name]

Examples:
$ sudo apt-get install libreoffice
$ sudo apt-get install gimp
$ sudo apt-get install inkscape
$ sudo apt-get install persepolis

4. Installing Specific Version of Software 


If there are 2 or more different version of one package, you can specify which version to install by ' = ' sign:

Formula:
$ sudo apt-get install [package_name]=[version]

Examples:
$ sudo apt-get install persepolis=3.0.1
$ sudo apt-get install libreoffice=6.0.6
$ sudo apt-get install gimp=2.10
$ sudo apt-get install inkscape=0.92.3

5. Running Software


Go to desktop menu and find the program there.

6. Uninstall Software


Same as installing but use the keyword remove instead of install.

Formula:
$ sudo apt-get remove [package_name]

Examples:
$ sudo apt-get remove persepolis
$ sudo apt-get remove gimp
$ sudo apt-get remove inkscape
$ sudo apt-get remove libreoffice

7. Removing PPA


Removing PPA is removing the address and then doing refresh. Removing a PPA means making it no more a download source ("repository") for your system. This involves manual refresh if your system does not automatically refresh. Notice: removing a PPA is not removing the package.

Formula:
$ sudo apt-add-repository --remove [ppa_address]

Examples:
$ sudo apt-add-repository --remove ppa:libreoffice/ppa
$ sudo apt-add-repository --remove ppa:otto-kesselgulasch/gimp
$ sudo apt-add-repository --remove ppa:inkscape.dev/stable
$ sudo apt-add-repository --remove ppa:persepolis/ppa

If it does not refresh automatically:
$ sudo apt-get update

Troubleshooting


Common problems are (1) mismatch Ubuntu version and (2) dependency conflict.

  • Problem (1) is not to be troubleshooted, but to be avoided. If the problem existed, remove the PPA.
  • Problem (2) is mostly difficult to deal with. First aid: remove the PPA, remove the package from it, and then try to fix it: $ sudo apt-get -f install

to be continued...



This article is licensed under CC BY-SA 3.0.