PPA (Personal Package Archive) is used for distributing software in Ubuntu without going through the whole process of making software available in official Ubuntu repositories.
Usually, PPA’s are used for making available non-standard software, which are unavailable in Ubuntu repositories, for installation via ‘apt‘ utility. A PPA has a corresponding custom repository to it, and with every ‘apt update‘ run, the list of packages is fetched from it.
The user might want to enable or disable an already added PPA in Ubuntu based on the availability and well-functioning of the repository, without deleting the PPA entry itself.
Today, we will see how to disable a particular PPA in Ubuntu.
Listing Ubuntu Repositories
The list of repositories, both standard and PPA, is maintained in configuration files called Source files, in Ubuntu. When you run ‘sudo apt update‘ you can see the URLs to the repositories in the log.
$ sudo update
Here, the URLs with ‘ppa.launchpad.net‘ are the PPA repositories.
The configuration files are available in the directory ‘/etc/apt/‘.
$ cd /etc/apt $ ls
Here, the file ‘sources.list‘ contains standard Ubuntu repositories, while PPA source files are available in folder ‘sources.list.d‘.
$ cd sources.list.d $ ls
Disable a PPA in Ubuntu
There is one source file in this folder; which defines a repository for unofficial PPA for PHP installation. Let’s open this file.
$ sudo vim ondrej-ubuntu-php-groovy.list
To disable the repository, simply comment on the lines by adding a hash (#)
character at the beginning of the lines.
Save and exit the file.
Now run the apt update again to verify if the PPA source is not being read.
$ sudo apt update
The apt update is now only considering the standard repositories, and thus, we have disabled the PPA for unofficial PHP installation.
To enable this PPA again, simply uncomment the lines, by removing the hash (#)
characters from both the lines.
Conclusion
In this article, we have seen how to disable a PPA in Ubuntu. PPA’s do not follow the same set of security procedures as standard Ubuntu packages, and hence are less secure. Users should take precautions while adding a PPA repository on their Ubuntu machine.
If you have any questions or feedback, let us know in the comments below!