How to Remove a PPA from Ubuntu Linux

Personal Package Archives (PPAs) let you install software not available in Ubuntu’s official repositories, but sometimes you need to remove them to maintain system stability, resolve conflicts, or eliminate security risks from outdated sources. Removing unused or broken PPAs keeps APT running smoothly and reduces the chance of unexpected package downgrades or signature warnings.

This guide walks you through identifying active PPAs, confirming which packages they supply, removing them with either add-apt-repository or manual cleanup, and finishing with ppa-purge, package hygiene, and duplicate-entry troubleshooting (verified on Ubuntu 22.04/24.04 LTS). By the end, you’ll know how to identify which packages a PPA provides, remove the repository cleanly with verification, and decide whether to keep packages or downgrade them to official Ubuntu versions.

List Active PPAs on Your System

List Current PPAs in sources.list.d

First, find out which PPAs are enabled on your system. Open a terminal and run the command below to list every repository file:

ls /etc/apt/sources.list.d/

This lists the repository files in /etc/apt/sources.list.d/. PPAs may appear as .sources files using the newer DEB822 format or legacy .list files. The filename typically follows the format username-ppa-name.sources or username-ppa-name.list. It’s important to pinpoint the exact PPA you intend to remove for precise and safe system management.

Ubuntu 24.04 LTS defaults to DEB822 .sources format with embedded keys, while Ubuntu 22.04 LTS fully supports .sources but may show legacy .list files from older PPAs or third-party installers. Both formats work identically for removal—remove whichever file format your system shows when you clean up a PPA.

This guide supports Ubuntu 22.04 LTS and 24.04 LTS installations. Commands shown work identically on both supported LTS releases.

Example Output from sources.list.d

Consider this sample command run and the repositories it reports:

josh@ubuntu:~$ ls /etc/apt/sources.list.d/
apt-fast-ubuntu-stable-jammy.list
kdenlive-ppa-nightly.list
libreoffice-ppa-noble.sources

This list reflects the PPAs currently active on your system. Identifying the specific PPA names ensures accurate removal and prevents inadvertent system changes.

Verify Which Packages Came From the PPA

Before removing a PPA it’s a good idea to check which packages were installed or upgraded from it so you can predict the impact of removing the source (or using ppa-purge). Replace <package> with the package name you want to inspect.

apt policy <package>
# or search installed packages that include the name
apt list --installed | grep <package>

The apt policy command (or apt-cache policy legacy syntax) shows which repository provides a package and whether it’s installed. The second lists installed packages that match the query so you can quickly inspect package names and versions before making changes.

josh@ubuntu:~$ apt policy kdenlive
kdenlive:
  Installed: 24.08.3
  Candidate: 24.08.3
  Version table:
 *** 24.08.3 500
        500 http://ppa.launchpad.net/kdenlive/kdenlive-nightly/ubuntu noble/main amd64 Packages
        100 /var/lib/dpkg/status
     23.08.5 500
        500 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages

This output confirms the package came from the PPA (version 24.08.3) while Ubuntu’s official repository offers an older version (23.08.5). After PPA removal, APT will reference the official version instead.

Before removing a PPA, verify that official Ubuntu repositories provide the packages you need. If Ubuntu lacks the package entirely, removing the PPA may leave the software uninstallable unless you switch to an alternative installation method like Flatpak or manual compilation.

Select a PPA Removal Strategy

Ubuntu offers three approaches for removing PPAs. Each method suits different scenarios based on whether you need automated package downgrading or prefer manual control:

  • add-apt-repository –remove: Quick automated removal that deletes the repository file and comments but leaves packages installed. Best for most users.
  • Manual file deletion: Direct removal of repository files and GPG keys when the command-line tool fails or isn’t available. Requires careful verification.
  • ppa-purge: Automatically downgrades packages back to official Ubuntu versions before removing the PPA. Safest when PPA packages conflict with system updates or security patches.

The sections below cover each method in detail. Use add-apt-repository --remove first unless you encounter errors or need to revert package versions.

Remove a PPA Using add-apt-repository

Use add-apt-repository –remove for Quick Removal

After identifying the PPA you want to disable, run the add-apt-repository command with the --remove flag:

Replace [ppa:username/ppa-name] with the actual PPA’s details:

sudo add-apt-repository --remove ppa:username/ppa-name

The add-apt-repository command lives in the software-properties-common package on minimal or server images. If you see command not found, install it before running the removal command:

sudo apt update
sudo apt install software-properties-common

Example: Remove the Kdenlive Nightly PPA

If, for instance, the PPA kdenlive-ppa-nightly.list was listed as installed and you no longer require it, the removal command would be:

sudo add-apt-repository --remove ppa:kdenlive/kdenlive-nightly

The PPA name in the removal command (ppa:kdenlive/kdenlive-nightly) differs from the file name (kdenlive-ppa-nightly.list). It’s essential to use the correct PPA name format for successful removal.

Ubuntu prints status messages so you know it worked. Expect output similar to the following example:

josh@ubuntu:~$ sudo add-apt-repository --remove ppa:kdenlive/kdenlive-nightly
[sudo] password for josh:
PPA to be removed: PPA for Kdenlive by KDE
Removing deb: http://ppa.launchpad.net/kdenlive/kdenlive-nightly/ubuntu jammy main
Removing deb-src: http://ppa.launchpad.net/kdenlive/kdenlive-nightly/ubuntu jammy main
PPA removed: 'http://ppa.launchpad.net/kdenlive/kdenlive-nightly/ubuntu jammy main'

Delete PPA Files Manually

Remove Repository Files Directly

If add-apt-repository isn’t available or fails to remove the entry, delete the PPA file directly. Replace the filename with the one you found earlier.

For DEB822 .sources files (Ubuntu 24.04 LTS default format), removing the file severs the repository immediately:

sudo rm /etc/apt/sources.list.d/username-ppa-name.sources

For legacy .list files (common on Ubuntu 22.04 LTS or older PPAs), delete the list file instead:

sudo rm /etc/apt/sources.list.d/username-ppa-name.list

Before permanently deleting the file, move it to a temporary location first, inspect it or run sudo apt update, and only delete it when you’re sure everything works correctly. This makes an easy rollback possible:

sudo mv /etc/apt/sources.list.d/username-ppa-name.sources /tmp/
# later, if everything is OK
sudo rm /tmp/username-ppa-name.sources

Before removing a source file, inspect it to confirm it is the correct PPA and check for the Signed-By entry (which points to a key in /usr/share/keyrings/), for example:

sudo cat /etc/apt/sources.list.d/username-ppa-name.sources
grep -n "Signed-By" /etc/apt/sources.list.d/username-ppa-name.sources || true

Remove GPG Keys Associated with the PPA

After removing repository files, check for GPG keys that the PPA installed. Keys typically reside in /usr/share/keyrings/ (modern DEB822 format) or /etc/apt/trusted.gpg.d/ (legacy format). Only remove a key if you’re certain no other repositories use it.

First, verify the key isn’t shared by multiple repositories:

# Check if other repos reference the key
grep -r "ppa-username.gpg" /etc/apt/sources.list.d/

If the command returns no results, the key is only used by the removed PPA. Proceed with deletion:

ls /usr/share/keyrings/
ls /etc/apt/trusted.gpg.d/
# Remove the key after confirming it belongs only to the removed PPA
sudo rm /usr/share/keyrings/ppa-username.gpg

Verify the key no longer exists:

ls /usr/share/keyrings/ | grep ppa-username

Before removal, the key file exists:

josh@ubuntu:~$ ls /usr/share/keyrings/ | grep ppa-username
ppa-username.gpg

After deletion, the grep command returns no results:

josh@ubuntu:~$ ls /usr/share/keyrings/ | grep ppa-username
josh@ubuntu:~$

The empty output confirms the GPG key was successfully removed.

Verify PPA Removal

After manually removing repository files and GPG keys, verify that APT no longer references the PPA. First, confirm the repository file is gone:

ls /etc/apt/sources.list.d/ | grep kdenlive
josh@ubuntu:~$ ls /etc/apt/sources.list.d/ | grep kdenlive
josh@ubuntu:~$

The empty output confirms the file no longer exists. Next, refresh APT’s package cache so it stops querying the removed repository:

sudo apt update

Finally, verify that packages from the removed PPA now reference Ubuntu’s official repositories:

apt policy kdenlive
josh@ubuntu:~$ apt policy kdenlive
kdenlive:
  Installed: 24.08.3
  Candidate: 23.08.5
  Version table:
 *** 24.08.3 100
        100 /var/lib/dpkg/status
     23.08.5 500
        500 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages

The output shows the installed version (24.08.3 from the removed PPA) remains on the system, but APT now considers the official repository version (23.08.5) as the candidate for future updates or reinstallation. The PPA URL no longer appears in the version table.

Refresh the APT Index After Removing a PPA

Update the APT Package List

After removing a PPA, update your package information so APT (Advanced Package Tool, Ubuntu’s package manager) stops referencing it.

Run the following command in the terminal:

sudo apt update

This updates package information from all active repositories and prevents APT from querying the removed PPA.

You should see the removed PPA disappear from the output. A shortened example looks like this:

josh@ubuntu:~$ sudo apt update
Hit:1 http://archive.ubuntu.com/ubuntu noble InRelease
Hit:2 http://security.ubuntu.com/ubuntu noble-security InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.

Clean Up Packages After Removing a PPA

Remove Orphaned Packages with apt autoremove

After removing a PPA, your system may still have packages installed from it that you no longer need. You can remove these unused packages to free disk space.

After removing a PPA, check for orphaned dependencies that were automatically installed to support packages from that PPA. Running autoremove verification ensures complete cleanup and prevents leftover server packages or libraries from consuming disk space unnecessarily.

Run the autoremove command with the --purge option:

sudo apt autoremove --purge

The --purge flag removes configuration files along with the packages, ensuring complete cleanup. Without it, APT removes binaries but leaves configuration files in case you reinstall later.

This removes packages that are no longer required. If orphaned packages exist, APT prompts for confirmation before removal:

josh@ubuntu:~$ sudo apt autoremove --purge
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  kdenlive-data*
After this operation, 38.1 MB disk space will be freed.
Do you want to continue? [Y/n] y

If no orphaned packages exist, APT reports zero packages to remove—this is normal and indicates the PPA packages have dependencies still in use:

josh@ubuntu:~$ sudo apt autoremove --purge
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.

Double-check the packages listed for removal. Sometimes autoremove may suggest removing packages you still rely on (for example, shared libraries). If you see anything unexpected, answer n and investigate the package dependencies with apt show <package>.

For a deeper dive into cleaning up packages, review our guide on removing software from Ubuntu using the command line. To keep your system current after removing outdated PPAs, see our Ubuntu package update guide.

Automate Removals with ppa-purge

Install the ppa-purge Utility

The ppa-purge tool downgrades packages back to Ubuntu’s repository versions and removes the PPA automatically.

Install ppa-purge with APT:

sudo apt install ppa-purge

APT confirms the installation with package details and dependencies:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  ppa-purge
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 5,852 B of archives.
After this operation, 35.8 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu noble/universe amd64 ppa-purge all 0.2.8+bzr63 [5,852 B]
Fetched 5,852 B in 0s (18.1 kB/s)
Selecting previously unselected package ppa-purge.
(Reading database ... 195432 files and directories currently installed.)
Preparing to unpack .../ppa-purge_0.2.8+bzr63_all.deb ...
Unpacking ppa-purge (0.2.8+bzr63) ...
Setting up ppa-purge (0.2.8+bzr63) ...

ppa-purge may downgrade or remove packages, which in turn can affect other installed packages that depend on those versions. Downgrading can break dependencies when newer package APIs or configuration formats aren’t backward-compatible. On production systems take a snapshot or backup first, test ppa-purge on a non-production system if possible, and read the proposed changes that ppa-purge prints before you confirm them.

Downgrade Packages and Remove the PPA with ppa-purge

Replace [ppa:username/ppa-name] with the PPA you want to remove and run:

sudo ppa-purge ppa:username/ppa-name

The tool downgrades packages from that PPA back to Ubuntu’s versions before removing the entry. Therefore, inspect the proposed package changes carefully when ppa-purge runs. If you want to preview general package interactions without using ppa-purge, use the package policy commands above and simulate apt operations with apt -s for your specific package names.

Example: Roll Back LibreOffice Packages with ppa-purge

To remove the LibreOffice PPA and revert its packages, run:

sudo ppa-purge ppa:libreoffice/ppa

The tool downgrades any LibreOffice packages installed from the PPA and then removes the entry. Typical output includes downgrade notices so you know which packages changed:

josh@ubuntu:~$ sudo ppa-purge ppa:libreoffice/ppa
Updating packages lists
PPA to be removed: LibreOffice PPA
Downgrading these packages:
  libreoffice libreoffice-core libreoffice-writer
Proceed with the package changes? [Y/n] y
The following packages will be REMOVED:
  libreoffice-gtk3
After this operation, 50.2 MB disk space will be freed.

Update Package Information After Running ppa-purge

Update APT with the following command so it refreshes its data without the removed PPA:

sudo apt update

Troubleshoot Common PPA Removal Issues

Fix Duplicate PPA Entries

If sudo apt update reports duplicate entries or mismatched repository definitions for a PPA you still use, a leftover .list file may be competing with the newer .sources entry. Confirm which file should stay (typically the .sources file), then convert the obsolete .list into a read-only placeholder so future updates stay quiet:

sudo rm /etc/apt/sources.list.d/username-ppa-name.list
sudo touch /etc/apt/sources.list.d/username-ppa-name.list
sudo chmod 444 /etc/apt/sources.list.d/username-ppa-name.list

Replace username-ppa-name.list with the exact filename the installer keeps recreating. The placeholder keeps the path reserved, and any installer that tries to recreate the file will hit a permission error instead of re-enabling the PPA. Run sudo apt update again afterward to confirm the warning is gone.

Some third-party installers re-create .list files when they run, but making the file read-only can break the installer’s update or repair processes. If you still need the PPA, prefer converting it to a proper .sources file (DEB822) or update the installer if possible. Also inspect both files to see what differs:

# Compare entries and find duplicates
grep -n "^deb" /etc/apt/sources.list.d/*
# Inspect both files to choose the one you want to keep

Handle add-apt-repository Failures

If add-apt-repository --remove reports “PPA not found” or fails to locate the repository, the PPA might have been added manually or the repository metadata is corrupted. Switch to manual file deletion instead:

josh@ubuntu:~$ sudo add-apt-repository --remove ppa:example/ppa
Error: PPA 'ppa:example/ppa' not found in /etc/apt/sources.list.d/

List repository files to find the exact filename, then delete it manually following the steps in the “Delete PPA Files Manually” section above.

Resolve Packages Without Official Equivalents

When a PPA provides software that doesn’t exist in Ubuntu’s official repositories, ppa-purge will remove the packages entirely instead of downgrading them. Before running ppa-purge, check if alternative installation methods exist:

  • Search for Flatpak versions with flatpak search package-name
  • Check if the software offers official .deb packages or vendor repositories
  • Review our Ubuntu software installation guides for alternative methods

If no alternatives exist and you need the software, keep the PPA but verify it’s maintained and secure. Check the PPA’s Launchpad page for recent updates and community activity.

Conclusion: Maintain a Clean Ubuntu System

You can now remove PPAs using add-apt-repository --remove for quick cleanup, manual file deletion when the automated tool fails, or ppa-purge when packages need to revert to official Ubuntu versions. Each method serves different scenarios—use the quickest approach that matches your needs, verify removal with apt policy, and run apt autoremove --purge to clean up orphaned dependencies.

Next, audit installed packages with apt list --installed to identify other outdated or unnecessary PPAs worth removing. For systems running multiple PPAs, set up automatic security updates to prevent dependency conflicts when official Ubuntu packages receive security patches. If you prefer graphical package management, install Synaptic Package Manager for an alternative to command-line APT operations.

Leave a Comment