On Linux systems, packages to install are normally available via the sources.list file. But you can find some packages which are not maintained by the team of your official Linux system. This article will show you how to remove and add PPA on Ubuntu 18.04 systems.
There are some teams around the world who develop applications they make available to users through their personal repositories called personal packages archives (PPA). You have to follow a specific procedure to add them to your system.
What is PPA?
PPA are unofficial repositories of software packages made available to all through the LaunchPad platform developed and maintained by Canonical. Developers who want to make their work available to Ubuntu users deposit their source code on this site. Launchpad then builds .deb packages for the different versions of Ubuntu that users can then install through their software package manager. It exists some methods to install or remove PPA on Ubuntu systems.
Using the terminal
a) Add PPA
To add the PPA through the terminal, we use the
add-apt-repository command which adds a PPA repository to your package manager's configuration.
On Ubuntu 18.04, after adding the ppa, you can directly install the package because the command launches the update process so the syntax is as below
add-apt-repository ppa:ppa_name apt install package_name
On Ubuntu 16.04 and earlier, you need to update the package manager then, install the package that you need
add-apt-repository ppa:ppa_name apt update apt install package_name
You can need to download the keyserver of a package during the process, so if need, use the command below
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys key_value
When you add a PPA on your system, it will create the ppa file in the
Note: You should notice that when you add a repository, the apt update command can take longer and longer time as if like non-Ubuntu repositories are not as fast or don't have as much band.
b) Remove ppa
There are 3 ways to remove PPA from terminal:
ppa-purgecommand: purge all traces of the use of a PPA repository. The command also tries to replace the installed packages with the version of the Officially Ubuntu Repositories. It is not present by default so you need to install it.
# apt install ppa-purge # ppa-purge ppa:ppa_name
You can follow the example below
# ppa-purge ppa:sebastian-stenzel/cryptomator Updating packages lists PPA to be removed: sebastian-stenzel cryptomator Package revert list generated: cryptomator- Disabling sebastian-stenzel PPA from /etc/apt/sources.list.d/sebastian-stenzel-ubuntu-cryptomator-xenial.list Updating packages lists ... ... The following packages will be REMOVED: cryptomator
add-apt-repository --removecommand: to delete a PPA repository with the associated packages
add-apt-repository --remove ppa:name_ppa
You can try to follow the example below
# add-apt-repository --remove ppa:stephenczetty/gerbera More info: https://launchpad.net/~stephenczetty/+archive/ubuntu/gerbera Press [ENTER] to continue or ctrl-c to cancel removing it
- Manually remove: As we mentioned earlier, the ppa repositories are added into a specific folder. So you can delete the ppa contained in the
The example below deletes PPA on Ubuntu 16.04
# rm /etc/apt/sources.list.d/cubic-wizard-ubuntu-release-xenial.list
Using the GUI method
a) Add PPA
You can use the graphical method to add and remove PPA on Ubuntu systems. You just have to search for Software & Updates, go to Other Software tab and click on Add button to add a new PPA.
You can see the result
b) Remove PPA
To remove a particular PPA, you just need to select it from the list as shown and click on Remove button. You will be prompted for the password
How to List PPA's
You can list the PPA in your system with the command below
# grep ^ /etc/apt/sources.list.d/* /etc/apt/sources.list.d/bitcoin-ubuntu-bitcoin-xenial.list:deb http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu xenial main /etc/apt/sources.list.d/bitcoin-ubuntu-bitcoin-xenial.list:# deb-src http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu xenial main /etc/apt/sources.list.d/bitcoin-ubuntu-bitcoin-xenial.list.save:deb http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu xenial main /etc/apt/sources.list.d/bitcoin-ubuntu-bitcoin-xenial.list.save:# deb-src http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu xenial main /etc/apt/sources.list.d/cubic-wizard-ubuntu-release-xenial.list.save:deb http://ppa.launchpad.net/cubic-wizard/release/ubuntu xenial main .... ....
You can also use the script below
# vim list-ppa.sh #! /bin/bash for X in /etc/apt/sources.list.d/* do cat $X echo -e "** $X **\n" done
Then you can run it
# ./list-ppa.sh deb http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu xenial main # deb-src http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu xenial main ** /etc/apt/sources.list.d/bitcoin-ubuntu-bitcoin-xenial.list ** deb http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu xenial main # deb-src http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu xenial main ** /etc/apt/sources.list.d/bitcoin-ubuntu-bitcoin-xenial.list.save ** deb http://ppa.launchpad.net/cubic-wizard/release/ubuntu xenial main # deb-src http://ppa.launchpad.net/cubic-wizard/release/ubuntu xenial main ** /etc/apt/sources.list.d/cubic-wizard-ubuntu-release-xenial.list.save ** ... ...
Now you exactly know the different ways to add and remove PPA on your Ubuntu systems. By activating these PPA filings, you acknowledge trusting their authors. The PPA repositories may contain multiple software that may depend on several updated libraries. So, it is possible that the installation of these updates may have an impact on the stability of your Ubuntu system.