How to disable the repository on Ubuntu 22.04 LTS (2024)

In this article, I will demonstrate various methods for disabling a repository on Ubuntu.

Quick and effective ways to disable a repository on Ubuntu

Disable a Repository by Renaming a File in the sources.list.d Folder

One swift method to disable a repository on Ubuntu 22.04 involves renaming the appropriate file located in /etc/apt/sources.list.d/. For instance, if you wish to disable the “virtualbox” repository, you can simply rename /etc/apt/sources.list.d/virtualbox.list to /etc/apt/sources.list.d/virtualbox.list-disabled. Ensure you replace “virtualbox” with the name of your target repository.

$ sudo mv /etc/apt/sources.list.d/virtualbox.list /etc/apt/sources.list.d/virtualbox.list-disabled

The drawback of this approach is that you may encounter the following error message when you run the apt command:

“N: Ignoring file ‘virtualbox.list-disabled’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension.”

Disable a Repository by Deleting a File in the sources.list.d Folder

This method not only disables the repository but also helps you avoid the error message mentioned above. To disable the “virtualbox” repository, you need to move the repository configuration file from /etc/apt/sources.list.d/ to another location, such as /tmp/virtualbox.list-disabled.

$ sudo mv /etc/apt/sources.list.d/virtualbox.list /tmp/virtualbox.list-disabled

Voila – no more errors when running the “apt” command!

Using the apt-add-repository Command

Despite its name, the apt-add-repository command can be employed for deleting a repository. You can refer to the manual page using the command man apt-add-repository for more details. The option -r or --remove is used to remove a specified repository.

$ man apt-add-repository
$ sudo apt-add-repository --remove virtualbox

Unfortunately, you may encounter an error stating, “Unable to handle repository shortcut.”

Conclusion

The swiftest and most efficient method for disabling an APT repository is to remove the repository file from the /etc/apt/sources.list.d/ directory. This approach ensures the complete removal of the repository, whereas the apt-add-repository command is more prone to errors and may require troubleshooting.

How useful was this post?

Click on a star to rate it!

Average rating 4 / 5. Vote count: 3

No votes so far! Be the first to rate this post.

How to disable the repository on Ubuntu 22.04 LTS (2024)
Top Articles
lender
Why Ares Management for Private Equity? / Overview of Ares Management
Scheelzien, volwassenen - Alrijne Ziekenhuis
Exclusive: Baby Alien Fan Bus Leaked - Get the Inside Scoop! - Nick Lachey
Ffxiv Palm Chippings
Chatiw.ib
Don Wallence Auto Sales Vehicles
South Park Season 26 Kisscartoon
Costco The Dalles Or
1movierulzhd.fun Reviews | scam, legit or safe check | Scamadviser
Blairsville Online Yard Sale
Comenity Credit Card Guide 2024: Things To Know And Alternatives
Obituary Times Herald Record
Delectable Birthday Dyes
Valentina Gonzalez Leak
Check From Po Box 1111 Charlotte Nc 28201
Katherine Croan Ewald
Spider-Man: Across The Spider-Verse Showtimes Near Marcus Bay Park Cinema
The best TV and film to watch this week - A Very Royal Scandal to Tulsa King
Zack Fairhurst Snapchat
Missed Connections Inland Empire
12 Top-Rated Things to Do in Muskegon, MI
Evil Dead Rise Showtimes Near Regal Sawgrass & Imax
Yosemite Sam Hood Ornament
Costco Gas Hours St Cloud Mn
Black Panther 2 Showtimes Near Epic Theatres Of Palm Coast
Sinfuldeed Leaked
How often should you visit your Barber?
Broken Gphone X Tarkov
Boneyard Barbers
Mrstryst
Frommer's Belgium, Holland and Luxembourg (Frommer's Complete Guides) - PDF Free Download
Murphy Funeral Home & Florist Inc. Obituaries
The Bold And The Beautiful Recaps Soap Central
Rage Of Harrogath Bugged
15 Best Things to Do in Roseville (CA) - The Crazy Tourist
Infinite Campus Farmingdale
Umiami Sorority Rankings
R: Getting Help with R
Is Ameriprise A Pyramid Scheme
Nimbleaf Evolution
Swsnj Warehousing Inc
Large Pawn Shops Near Me
Hillsborough County Florida Recorder Of Deeds
Keci News
Lesson 5 Homework 4.5 Answer Key
antelope valley for sale "lancaster ca" - craigslist
The Missile Is Eepy Origin
Supervisor-Managing Your Teams Risk – 3455 questions with correct answers
Latest Posts
Article information

Author: Cheryll Lueilwitz

Last Updated:

Views: 6152

Rating: 4.3 / 5 (74 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Cheryll Lueilwitz

Birthday: 1997-12-23

Address: 4653 O'Kon Hill, Lake Juanstad, AR 65469

Phone: +494124489301

Job: Marketing Representative

Hobby: Reading, Ice skating, Foraging, BASE jumping, Hiking, Skateboarding, Kayaking

Introduction: My name is Cheryll Lueilwitz, I am a sparkling, clean, super, lucky, joyous, outstanding, lucky person who loves writing and wants to share my knowledge and understanding with you.