How to Remove Software Repositories on Ubuntu (2024)

The ability to add repositories on Linux is essential to get software from third-party sources other than the official repos. On Ubuntu, you can add a repository using the add-apt-repository command or by editing the sources.list file.

But how do you remove the added repository once you're done with it? Deleting a repository entry on Ubuntu is even easier than adding one, and there are multiple ways to do the same.

Deleting the Repository Entry From sources.list

The most convenient way to remove an unwanted package repository on Ubuntu is by editing the sources.list file. The sources file lists all the configured repositories on your system. You can view the contents of the file using any of the file-viewing Linux programs.

Start by opening the file with a text editor of your choice (for this guide, we'll use Vim):

sudo vim /etc/apt/sources.list 
How to Remove Software Repositories on Ubuntu (1)

Find the repository you want to remove and delete the entire line. Save the file and exit Vim to proceed. Now, update the package sources with:

sudo apt update 

After removing a repository from the sources.list file, you won't receive any package updates from it.

The sources.list file is a root-owned file and it can break repository configuration if not modified properly.

Removing the GPG Key for the Repository

Packages in a repository are signed with a pair of keys: public and private. When you add a repository, you ask the package manager (APT) to trust the packages found in that repo. After deleting the repository entry from your sources file, you should also delete the GPG key associated with it.

To do so, first, list all the trusted keys with:

sudo apt-key list 
How to Remove Software Repositories on Ubuntu (2)

The second line in the pub entry is the actual key, while uid is the repository name. Find the repository you just deleted, then copy the last eight characters of its key.

Enter the following to remove the key, replacing the hex value at the end with the characters you copied:

sudo apt-key del D38B4796 

You can also specify the entire key in the command if you want:

sudo apt-key del "EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796" 

Remove a PPA Using add-apt-repository

When it comes to removing a PPA, the best—and safest—way is to use add-apt-repository. It's the only command you need to add as well as remove PPAs on Ubuntu. Don't let its name fool you into thinking otherwise.

Get a list of all configured PPAs by listing the contents of the /etc/apt/sources.list.d directory using the ls command:

ls /etc/apt/sources.list.d 

Once you've found the PPA you want to remove, use the -r flag with add-apt-repository:

sudo add-apt-repository -r ppa:author/reponame 

If the output displays the "add-apt-repository: command not found" error, you'll have to install the tool first.

You can also delete the PPA folder from the sources.list.d directory and it'll remove the repository from your system.

Use the Ubuntu Software Updater to Remove a Repository

Ubuntu offers a graphical way to manage software repositories and third-party PPAs using the Software Updater app. To begin, launch Software Updater from the applications menu and click Settings.

Once launched, switch to the Other Software tab. You'll see a list of all the third-party software sources configured on your computer. To disable a repository, uncheck the box corresponding to the repo and enter the administrator password.

How to Remove Software Repositories on Ubuntu (3)

If you've decided to remove the package repository, highlight the entry and click Remove.

Finally, update the package sources using APT:

sudo apt update 

You can also edit or add a third-party repository on Ubuntu using the Software Updater app.

Software Management on Ubuntu Made Easy

Adding and deleting repositories is another aspect of package management on Ubuntu and other Linux distros. To maintain your system security, you should always check if a repository or PPA is genuine, and doesn't offer any malicious software.

Ubuntu comes with a few repositories preconfigured. These are the official repositories from where you can download trusted packages to install.

How to Remove Software Repositories on Ubuntu (2024)
Top Articles
How to lock up CRO on Crypto.com Exchange? | Crypto.com Help Center
Liquidity Pools and Adding Liquidity
Katie Nickolaou Leaving
Joe Taylor, K1JT – “WSJT-X FT8 and Beyond”
Cappacuolo Pronunciation
Thor Majestic 23A Floor Plan
Free Atm For Emerald Card Near Me
Coffman Memorial Union | U of M Bookstores
Yi Asian Chinese Union
Celsius Energy Drink Wo Kaufen
Globe Position Fault Litter Robot
Aces Fmc Charting
Gmail Psu
Pekin Soccer Tournament
R Personalfinance
PowerXL Smokeless Grill- Elektrische Grill - Rookloos & geurloos grillplezier - met... | bol
Tu Pulga Online Utah
Rochester Ny Missed Connections
The Many Faces of the Craigslist Killer
Ecampus Scps Login
Regina Perrow
EVO Entertainment | Cinema. Bowling. Games.
Angel Haynes Dropbox
Mjc Financial Aid Phone Number
Meowiarty Puzzle
Bridgestone Tire Dealer Near Me
Lincoln Financial Field, section 110, row 4, home of Philadelphia Eagles, Temple Owls, page 1
Publix Daily Soup Menu
Acuity Eye Group - La Quinta Photos
Craigslist Free Puppy
140000 Kilometers To Miles
Kvoa Tv Schedule
42 Manufacturing jobs in Grayling
Orion Nebula: Facts about Earth’s nearest stellar nursery
PruittHealth hiring Certified Nursing Assistant - Third Shift in Augusta, GA | LinkedIn
Vocabulary Workshop Level B Unit 13 Choosing The Right Word
Bartow Qpublic
Henry Ford’s Greatest Achievements and Inventions - World History Edu
Bob And Jeff's Monticello Fl
Trivago Sf
Isabella Duan Ahn Stanford
Emily Browning Fansite
Collision Masters Fairbanks
10 Types of Funeral Services, Ceremonies, and Events » US Urns Online
Kenwood M-918DAB-H Heim-Audio-Mikrosystem DAB, DAB+, FM 10 W Bluetooth von expert Technomarkt
Sam's Club Gas Price Sioux City
Advance Auto.parts Near Me
antelope valley for sale "lancaster ca" - craigslist
18 Seriously Good Camping Meals (healthy, easy, minimal prep! )
View From My Seat Madison Square Garden
Mawal Gameroom Download
Latest Posts
Article information

Author: Moshe Kshlerin

Last Updated:

Views: 6394

Rating: 4.7 / 5 (77 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Moshe Kshlerin

Birthday: 1994-01-25

Address: Suite 609 315 Lupita Unions, Ronnieburgh, MI 62697

Phone: +2424755286529

Job: District Education Designer

Hobby: Yoga, Gunsmithing, Singing, 3D printing, Nordic skating, Soapmaking, Juggling

Introduction: My name is Moshe Kshlerin, I am a gleaming, attractive, outstanding, pleasant, delightful, outstanding, famous person who loves writing and wants to share my knowledge and understanding with you.