A PPA (Personal Package Archive) is quickly added, for example to get a newer version of PHP or some other program. When removing it there are two options: delete only the package source – then the packages already installed from the PPA stay in place – or additionally reset all packages to the official Ubuntu versions.
Which PPAs are enabled?
ls /etc/apt/sources.list.d/
PPA files can be recognised by their name, e.g. ondrej-ubuntu-php-noble.sources. Since Ubuntu 24.04 they have the extension .sources, on older releases .list.
Option 1: remove only the package source
sudo add-apt-repository --remove ppa:user/ppa-name
sudo apt update
Installed packages remain unchanged but no longer receive updates from the PPA. This makes sense if the versions are identical to the official ones anyway or the package is no longer needed.
Option 2: go back to the official packages with ppa-purge
ppa-purge removes the PPA and resets all packages installed from it to the version from the Ubuntu repositories. Packages that do not exist there are uninstalled.
sudo apt install ppa-purge
sudo ppa-purge ppa:user/ppa-name
It is worth checking beforehand which packages are affected: apt policy package-name shows which source the installed version comes from. A detailed example for the popular PHP PPA by Ondřej Surý can be found in the article Removing PHP from ppa:ondrej/php.
Option 3: by hand
If add-apt-repository does not work (e.g. on a minimal system without software-properties-common), simply delete the file:
sudo rm /etc/apt/sources.list.d/user-ubuntu-ppa-name-*.sources
sudo apt update
Cleaning up keys
On newer Ubuntu releases the key is embedded directly in the .sources file and disappears along with it. On older installations it is stored in /etc/apt/trusted.gpg.d/ and can be deleted there. The formerly common apt-key command is deprecated and should no longer be used.
Tip before a release upgrade
do-release-upgrade disables PPAs anyway. If you remove them cleanly with ppa-purge beforehand, you avoid conflicts caused by package versions that are newer than those of the target release.
Originally published in 2011, completely revised in November 2026.