How to remove PPA repositories on Ubuntu Server.
What are PPA & repositories?
PPA stands for "Personal Package Archive". Repositories (shortly repo) are servers that have a set of packages. PPA is a collection of packages that are hosted on the Launchpad server. Adding PPA means adding a new repository to our system. We can install the application from that repository. PPA repositories are unofficial repositories that are used to connect third-party software to the Ubuntu operating system. To cut it short; with PPA, you can easily get newer software version or software that are not available via the official Ubuntu repositories. A PPA repository can help with this.
Over the time these PPAs might not be updated with the latest version of the operating system. This might create trouble when you try updating Ubuntu. You may end up with “Repository does not have a release file” error.
You may have other reasons as well for deleting or removing a PPA from your system. Whatever be your reason, let's show you how to remove a PPA from your system.
Removing a PPA repository in Ubuntu Server
We have four ways to remove the PPA repository from the system:
- Remove PPA repository via terminal
- Remove PPA repository from source
- Remove PPA repository using purge
We will demonstrate to you how to safely uninstall the PPA repository using in Ubuntu 20.04 in this post:
How to list all installed repositories:
To see a list of all the repositories installed on your system, copy the following command apt policy
and paste it into the terminal:
OUTPUT
Package files:
100 /var/lib/dpkg/status
release a=now
500 https://dl.yarnpkg.com/debian stable/main all Packages
release o=yarn,a=stable,n=stable,l=yarn-stable,c=main,b=all
origin dl.yarnpkg.com
500 https://dl.yarnpkg.com/debian stable/main arm64 Packages
release o=yarn,a=stable,n=stable,l=yarn-stable,c=main,b=arm64
origin dl.yarnpkg.com
500 https://packages.cisofy.com/community/lynis/deb stable/main arm64 Packages
release o=CISOfy,a=stable,n=stable,c=main,b=arm64
origin packages.cisofy.com
Also, printing the content of the /etc/apt/sources.list.d is another way to get a list.
$ ls /etc/apt/sources.list.d
OUTPUT
cisofy-lynis.list cisofy-lynis.list.save yarn.list
Remove PPA repository via terminal:
If you want to remove a PPA repository that has been added to your system, use the below-given command syntax:
$ sudo add-apt-repository --remove [ppa:ppa-file]
For example, to remove the Jonathon F’s PPA which provides FFmpeg version 4.x you would run:
$ sudo add-apt-repository --remove ppa:jonathonf/ffmpeg-4
Remove PPA from the source list Manually:
You can also remove the PPA from the sources list, where all repositories are kept by using the rm
command as follows:
$ sudo rm /etc/apt/sources.list.d/<ppa-file>
For instance, to remove the PPA for FFMpeg, first use the following command to find the exact name of the PPA:
$ ls /etc/apt/sources.list.d/
Then use the rm
command followed by the exact name of the PPA.
$ sudo rm /etc/apt/sources.list.d/jonathonf-ubuntu-ffmpeg-4-focal.list
Remove PPA repository using purge:
All of the approaches we have covered so far only work to remove the PPAs from the system. They do not uninstall the application that was installed through that specific PPA.
We will use the PPA purge utility in this approach, which removes the PPA repository and uninstall the application installed with it.
On Ubuntu, the PPA purge utility is not preinstalled. Type the showing command to install it:
$ sudo apt install ppa-purge
Once installed, you can then run the following command to purge a repository:
$ sudo ppa-purge ppa:<ppa-file>
Incase of above example, the command would be:
$ sudo ppa-purge ppa:jonathonf/ffmpeg-4
That is all there is to it!
I hope you’ll find at least one good method to delete or remove a PPA and uninstall the corresponding applications. Cheers :)