Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk10 min

How to Remove a Repository From Ubuntu’s Package Sources

A practical guide to removing or disabling Ubuntu package sources, including PPAs, deb822 files, verification with apt update, duplicate-entry troubleshooting, and separate cleanup of installed packages and signing keys.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To remove an Ubuntu repository, remove its active source definition, refresh APT, and check the update output for errors. Desktop users can open Software & Updates → Other Software, select the entry, and click Remove. For a PPA or source managed by add-apt-repository, run sudo add-apt-repository --remove <repository>. Manually added sources require editing or moving the matching .list or .sources file under /etc/apt/sources.list.d/, or the older main /etc/apt/sources.list file.

What removing a repository actually does

An APT repository is a package-source definition, not a package installed on your computer. Removing that definition stops APT from consulting the server for future package lists and updates. It does not automatically uninstall applications or libraries that were already installed from the repository.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

That distinction matters when a third-party source supplied a newer build than Ubuntu’s archives. After the source is gone, the installed software may remain in place, receive no further updates from that source, or be replaced later by a package from another archive. Decide what to do with those packages separately.

You can either disable a source or remove it. Disabling leaves a reversible configuration in place, usually by commenting out the entry or unticking it in the graphical interface. Removing deletes the active definition. Disable a source while troubleshooting or when you may need to restore it; remove one that is obsolete, no longer trusted, or permanently unwanted.

Choose the right removal method

Method Best for Reversibility Remote systems Targeting precision Main risk
Software & Updates Desktop users who want to identify entries visually Unticking is reversible; Remove deletes the active entry Requires a graphical session Targets the selected repository entry Similar-looking entries can be confused
add-apt-repository --remove PPAs and repositories originally added with that utility The matching lines are disabled or removed according to the utility’s behavior Well suited to SSH and scripted administration Targets the repository identity you provide A guessed PPA name or URI can target the wrong source
Manual file edit or move Custom entries, deb822 files, and sources the utility cannot identify Easy to restore when you make a backup or move the file Works everywhere Can target one stanza inside a file Editing the wrong stanza can disable an unrelated source

Before changing anything, note the repository’s host, PPA name, Ubuntu codename or suite, and the file that contains it. Duplicate definitions are common, so removing one visible entry may not remove every active copy.

Remove a repository with Software & Updates

This is the clearest approach on an Ubuntu desktop because the interface lists configured sources instead of requiring you to interpret APT syntax.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Open the application search and launch Software & Updates.
  2. Select the Other Software tab. Third-party repositories and many locally added sources appear there.
  3. Click the repository entry you want to remove. Read the complete line, including its host and distribution, before making a change.
  4. Choose Remove and authenticate when Ubuntu requests your password.
  5. Close the window. Ubuntu may immediately ask to reload package information; accept that reload. If no refresh starts, open a terminal and run sudo apt update.

Ubuntu flavors and releases can use slightly different wording or arrange the controls differently, but the repository list and the Other Software tab serve the same purpose. If the source is only being investigated, untick its checkbox instead of removing it. You can return to the tab and re-enable it without reconstructing the entry.

If the source is not listed, it may be in the main source file, represented as a deb822 .sources file, or duplicated under another filename. Use the manual discovery procedure below rather than deleting an entire directory.

Remove a PPA or supported source from the terminal

For a PPA or repository that was added with Ubuntu’s add-apt-repository utility, use the same repository identity that was originally added:

sudo add-apt-repository --remove ppa:vendor/name
sudo apt update

Replace ppa:vendor/name with the actual PPA identifier. Do not infer the name from an application’s display name. Check the command’s proposed change and output before confirming it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The utility’s current Ubuntu documentation states that --remove removes the specified repository. It first disables matching lines; files under /etc/apt/sources.list.d that then contain only empty or commented lines can be removed by the utility. Unless component-specific options are supplied, matching deb and deb-src lines and all their components are handled together.

If the original source was supplied as a full URI or source line rather than a PPA shorthand, pass the repository identity accepted by the utility. A command that completes without an error does not prove that every duplicate entry is gone, so always inspect the result with apt update and, when necessary, search the source files.

This method is convenient over SSH because it does not need a desktop session. It is less suitable when several unrelated repositories share one file or when the source uses deb822 syntax that the utility does not manage in the way you expect; use a manual edit in those cases.

Find and edit a repository definition manually

Know where Ubuntu stores source definitions

  • /etc/apt/sources.list is the traditional central file and is especially common on older Ubuntu releases.
  • /etc/apt/sources.list.d/*.list contains traditional one-line entries. Filenames usually identify the software or vendor that added them.
  • /etc/apt/sources.list.d/*.sources contains deb822-format entries used by newer Ubuntu documentation. An example is /etc/apt/sources.list.d/ubuntu.sources.

Do not remove the whole /etc/apt/sources.list.d directory. It can contain unrelated repositories, local mirrors, or configuration needed by other software.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Search before you edit

Search by the repository host, PPA name, or another distinctive string. This command checks the main file and both common file types while suppressing harmless “file not found” messages:

grep -RniE 'vendor|example.org|ppa.launchpadcontent.net' /etc/apt/sources.list /etc/apt/sources.list.d 2>/dev/null

Replace the example terms with text that identifies your source. The output gives you the filename and line number, so you can distinguish a matching source from an unrelated entry. Search for the host as well as the software name: one repository may have several suites or components, and a duplicate may use a different filename.

Back up the file

Make a copy before changing a source. For a dedicated one-line file, for example:

sudo cp -a /etc/apt/sources.list.d/vendor.list /etc/apt/sources.list.d/vendor.list.bak

For a file containing several repositories, copy that whole file and edit the original. A backup gives you a precise way to restore the previous configuration if an update later reports an unrelated error.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Disable a one-line entry without deleting it

Open the matching .list file with an editor that is available on your system, then place # at the start of each matching active line. Leave unrelated lines unchanged. A commented line remains readable and can be restored by removing the #.

When you want the source out of APT’s active search path but prefer not to edit its contents, move a dedicated file to a different name:

sudo mv /etc/apt/sources.list.d/vendor.list /etc/apt/sources.list.d/vendor.list.disabled
sudo apt update

APT only treats files with the supported source-list extensions as active definitions. Keeping the file as .disabled makes the change reversible, while the .list.bak backup preserves the original separately.

Remove a source from a deb822 file

Deb822 files use a multi-line stanza with fields such as Types, URIs, Suites, and Components. Do not delete only the URI line and leave a malformed partial stanza. Remove the complete stanza for the target URI and suite, or comment or move the entire file when it contains only that source.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If several stanzas share one file, preserve every stanza that belongs to sources you still need. After saving, inspect the file again and check that the remaining stanzas retain their field names, indentation, and values.

Disable versus permanently remove

Goal Action When to choose it
Temporarily stop using a source Untick it in Software & Updates, comment its line, or move a dedicated file to a non-active extension Testing whether the source causes an update or dependency problem
Delete the active definition Use Remove, add-apt-repository --remove, or delete the matching file or stanza after making a backup The repository is obsolete, unavailable, or no longer trusted

Disabling is safer when you are diagnosing a failure because restoration does not require reconstructing the original URI, suite, and components. Removal is appropriate when leaving the definition in place could cause APT to contact an untrusted or permanently retired server.

Refresh APT and verify that the source is gone

After every source change, rebuild APT’s package indexes:

sudo apt update

Watch the complete output. The removed host, PPA, suite, or file should no longer appear as an active download target. A successful command should finish without errors related to the source you intended to remove.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If APT still reports the repository, search all active locations again:

grep -RniE 'vendor|example.org|ppa.launchpadcontent.net' /etc/apt/sources.list /etc/apt/sources.list.d 2>/dev/null

Then check for:

  • A second .list file containing the same host.
  • A deb822 .sources stanza that points to the same URI.
  • An entry in the main /etc/apt/sources.list file.
  • A source with the same server but a different suite or component.
  • A file that was copied or renamed but still ends in an extension APT reads.

Remove or disable only the remaining matching definition, run sudo apt update again, and read the new output rather than assuming the previous error has been fixed.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common update errors

“The repository does not have a Release file”

This usually indicates that an active entry points to a server or suite that does not publish the expected metadata. Confirm that the old source was removed from every file and stanza. If you intentionally need the repository, verify that its suite matches your Ubuntu release; otherwise disable or remove the entry.

Signature or public-key errors

A signature error can result from a leftover source definition, an unavailable signing key, or a repository whose metadata no longer matches its key. First eliminate the source if you no longer need it. Do not work around the error by disabling APT’s signature checks globally.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The graphical list and terminal search disagree

The interface may show only entries it recognizes, while manual files can contain additional sources. Search both the main file and every .list and .sources file. Conversely, a disabled or malformed entry may be visible in a file but not function as an active source; inspect its syntax and run apt update to determine whether APT is reading it.

The command removed one entry but updates still contact the server

Look for duplicates under another filename, another suite, or another source format. A PPA can also have both binary (deb) and source-code (deb-src) lines. Remove the remaining lines or stanza only after confirming they refer to the same repository.

You edited the wrong file

Restore the backup with the same ownership and permissions, then run sudo apt update. If you moved a dedicated file, give it its original supported extension and location. When a file contains several stanzas, restore the backup and remove only the target stanza rather than replacing the entire file with a guessed version.

What to do with packages already installed from the repository

Source removal and package cleanup are separate decisions. Choose among these approaches:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Choice Result Use it when
Keep the installed packages The software remains installed, but the removed source no longer supplies updates The application is still needed and you accept its current update path
Use Ubuntu’s archives instead Reinstall or downgrade to versions available from Ubuntu’s configured archives You want maintenance from Ubuntu rather than the third-party source
Remove or revert the software Uninstall the packages, or replace them with versions from another trusted source The software is obsolete, incompatible, or no longer trusted

Check package origins and dependencies before changing installed software. Removing a repository alone does not perform any of these package operations, so do not expect disk space to be reclaimed automatically.

Handle the repository’s signing key carefully

A source may use a standalone key file under /usr/share/keyrings. Removing the source does not require immediate key deletion, and deleting a shared key can break another repository that still depends on it.

Only remove a key after confirming that no remaining source references it. Ubuntu documents manual removal of an unused standalone key from /usr/share/keyrings; preserve keys that serve multiple repositories and do not delete the directory itself.

Security checks before adding or removing sources

Ubuntu’s official guidance is: “Only add software repositories from sources that you trust!” Third-party repositories are not checked by Ubuntu members for security or reliability and may contain harmful software. Removing a source that you no longer trust is prudent, but it does not undo software or configuration that was already installed from it.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Read the full host, suite, and component before removing an entry.
  • Keep a backup of manually edited files.
  • Never delete the entire source-list directory to solve one repository problem.
  • Refresh with sudo apt update after each change and resolve errors before installing or upgrading packages.
  • Leave a signing key in place until you have verified that no other active source uses it.

Quick checklist

  1. Identify the exact repository host, PPA, suite, and source file.
  2. Choose disable for a reversible test or remove for a permanent cleanup.
  3. Use Software & Updates for a desktop entry, add-apt-repository --remove for a supported PPA, or a backed-up manual edit for custom files.
  4. Check both legacy .list and deb822 .sources files, including /etc/apt/sources.list.
  5. Run sudo apt update and inspect the complete output.
  6. Decide separately whether installed packages and unused signing keys should remain.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.