Remove Software Repositories from Ubuntu [3 Easy Ways] 😎 (2024)

Remove Software Repositories from Ubuntu [3 Easy Ways] 😎 (1)

You can add external repositories in Ubuntu to access packages unavailable in the official repositories.

For example, if you install Brave browser in Ubuntu, you add its repository to your system. If you add a PPA, that is added as an external repository too.

When you don't need the specific software, you remove it. However, the external repository is still added. You can, and you should also remove it to keep your system pristine.

Ubuntu lets you remove a software repository easily. There are different ways to do that:

  1. Using apt-add-repository command to remove the repository
  2. Using GUI to remove the repository (for desktop users)
  3. By modifying the file contents of the /etc/apt/sources.list file (for experts)

But before that, I highly advise getting familiar with the concept of package managers and repositories if you are new to this concept.

What is a Package Manager in Linux?Learn about packaging system and package managers in Linux. You’ll learn how do they work and what kind of package managers available.It's FOSSAbhishek Prakash

Method 1. Remove the repository using apt πŸ€–

Did you know you can also use the apt command to remove repositories? Well, technically, it's not part of the core apt command but it works in similar fashion.

You can use the add-apt-repository or apt-add-repository commands (both represent the same command) while dealing with external repositories.

First, list the added repositories using the following command:

apt-add-repository --list
Remove Software Repositories from Ubuntu [3 Easy Ways] 😎 (4)

Once done, you can use the apt-add-repository command with the -r flag in shown manner to remove the directory:

sudo apt-add-repository -r repo_name

For example, if I want to remove the yarn repository, I would have to use the following command:

sudo add-apt-repository -r deb https://dl.yarnpkg.com/debian/ stable main
Remove Software Repositories from Ubuntu [3 Easy Ways] 😎 (5)

Press the Enter key for confirmation.

Next, update the repositories using the following:

sudo apt update

And now, if you list enabled repositories, you won't find the removed repository here:

apt-add-repository --list
Remove Software Repositories from Ubuntu [3 Easy Ways] 😎 (6)

There you have it!

Using apt Commands in Linux [Ultimate Guide]This guide shows you how to use apt commands in Linux with examples so that you can manage packages effectively.It's FOSSAbhishek Prakash

Method 2. Remove the software repository in Ubuntu using GUI πŸ–₯️

🚧

Removing a repository you know nothing about is not recommended as it may restrict you from installing your favorite package in the future, so make sure you know what you are up to.

Being one of the best distros for beginners, You can use GUI to remove the repository without needing the terminal.

To do so, first, open the software and updates the app from the system menu:

Remove Software Repositories from Ubuntu [3 Easy Ways] 😎 (9)

Now, click on Other Software section, and it will list PPAs and external repositories in your system.

The ones listed as checked βœ… are enabled ones.

To remove a repository, you'd have to follow three simple steps:

  • Select a repository that needs to be removed
  • Click on the remove button
  • And finally, hit the close button
Remove Software Repositories from Ubuntu [3 Easy Ways] 😎 (10)

Once you click on the close button, it will open a prompt asking you to update the information as you make changes.

Simply click on the Reload button:

Remove Software Repositories from Ubuntu [3 Easy Ways] 😎 (11)

Alternatively, you can update the repository from the command line to take effect from the changes:

sudo apt update

Method 3. Remove the repository by removing its directory (for experts πŸ§‘β€πŸ’»)

Previously, I explained how you could use tools (GUI and CLI) to remove a repository; here, you will modify the system directory (/etc/apt/sources.list.d) responsible for managing repositories.

So first, change your working directory to sources.list.d and list its contents:

cd /etc/apt/sources.list.d/ && ls
Remove Software Repositories from Ubuntu [3 Easy Ways] 😎 (12)

Here, you will find the list of all the repositories.

If you notice carefully, there will be two files for one repo. Once with the .list extension and one with the .save extension.

You will have to remove the one having the .list extension:

sudo rm Repo_name.list

For example, here, I removed the node repo using the command below:

sudo rm nodesource.list
Remove Software Repositories from Ubuntu [3 Easy Ways] 😎 (13)

To take effect from the changes, update the repository index with:

sudo apt update

Want to know more about the sources.list? Read this article.

What is the Use of sources.list File in Ubuntu Linux?Understanding the concept of sources.list in Ubuntu will help you understand and fix common update errors in Ubuntu.It's FOSSAbhishek Prakash

Additional Step: Remove GPG keys after removing the repository (for advanced users)

If you wish to remove the GPG keys after removing the repository, here's how you do it.

First, list the existing GPG keys using the following command:

apt-key list

Now, the output may seem confusing to some users.

Here's what to remember:

  • The GPG key name will be placed above the dashed line (----)
  • The public key is in the second line

For example, here's the relevant data of the Chrome GPG key:

Remove Software Repositories from Ubuntu [3 Easy Ways] 😎 (16)

To remove the GPG key, you can use the last two strings of the public key (without any space).

For example, here's how I will remove the GPG key of the Chrome browser using the last two strings of its public key (D38B 4796):

sudo apt-key del D38B4796
Remove Software Repositories from Ubuntu [3 Easy Ways] 😎 (17)

Similarly, you can also use the entire public key. But this time, you have to include spaces between two strings, as shown:

sudo apt-key del "72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310"

Careful with what you add and what you remove

Especially when you are a new Linux user, you will encounter many exciting things and repositories you will add and remove.

While it is good to experiment, you should always be careful about anything you add/remove to your system. You should keep some things in mind, like: Does it include updated packages? Is it a trusted or maintained repository?

Being cautious will keep your system free from unnecessary repositories and packages.

I hope this guide helps you remove the repository you do not want!

Feel free to let me know if you face any issues in the comments below, and consider joining our It's FOSS Community forum to get faster help!

Remove Software Repositories from Ubuntu [3 Easy Ways] 😎 (2024)
Top Articles
Accept payments with Tap to Pay on Android | Square Support Center
A guide to Bacs Direct Debit payments | Stripe
Cranes For Sale in United States| IronPlanet
Katmoie
Practical Magic 123Movies
Georgia Vehicle Registration Fees Calculator
Toyota gebraucht kaufen in tacoma_ - AutoScout24
AB Solutions Portal | Login
1TamilMV.prof: Exploring the latest in Tamil entertainment - Ninewall
Rochester Ny Missed Connections
Roblox Character Added
Becky Hudson Free
LeBron James comes out on fire, scores first 16 points for Cavaliers in Game 2 vs. Pacers
Shuiby aslam - ForeverMissed.com Online Memorials
Los Angeles Craigs List
Ts Lillydoll
Mile Split Fl
Cinebarre Drink Menu
Leader Times Obituaries Liberal Ks
Everything We Know About Gladiator 2
Farmer's Almanac 2 Month Free Forecast
Vigoro Mulch Safe For Dogs
Lista trofeΓ³w | Jedi UpadΕ‚y Zakon / Fallen Order - Star Wars Jedi Fallen Order - poradnik do gry | GRYOnline.pl
Schedule An Oil Change At Walmart
Ahn Waterworks Urgent Care
north jersey garage & moving sales - craigslist
Barber Gym Quantico Hours
2013 Ford Fusion Serpentine Belt Diagram
Pearson Correlation Coefficient
Wics News Springfield Il
Gas Buddy Prices Near Me Zip Code
Nottingham Forest News Now
Askhistorians Book List
RUB MASSAGE AUSTIN
Sephora Planet Hollywood
Viewfinder Mangabuddy
Dollar Tree's 1,000 store closure tells the perils of poor acquisitions
159R Bus Schedule Pdf
Wrigley Rooftops Promo Code
2700 Yen To Usd
Seminary.churchofjesuschrist.org
'Guys, you're just gonna have to deal with it': Ja Rule on women dominating modern rap, the lyrics he's 'ashamed' of, Ashanti, and his long-awaited comeback
The Attleboro Sun Chronicle Obituaries
Trivago Anaheim California
'The Night Agent' Star Luciane Buchanan's Dating Life Is a Mystery
Paperlessemployee/Dollartree
Tropical Smoothie Address
Bridgeport Police Blotter Today
Home | General Store and Gas Station | Cressman's General Store | California
Costco Gas Price Fort Lauderdale
Latest Posts
Article information

Author: Carlyn Walter

Last Updated:

Views: 5685

Rating: 5 / 5 (50 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Carlyn Walter

Birthday: 1996-01-03

Address: Suite 452 40815 Denyse Extensions, Sengermouth, OR 42374

Phone: +8501809515404

Job: Manufacturing Technician

Hobby: Table tennis, Archery, Vacation, Metal detecting, Yo-yoing, Crocheting, Creative writing

Introduction: My name is Carlyn Walter, I am a lively, glamorous, healthy, clean, powerful, calm, combative person who loves writing and wants to share my knowledge and understanding with you.