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
FTX investors to get their money back - plus interest
What Is Node.js? A Complete Guide for Developers
Artem The Gambler
Minooka Channahon Patch
What spices do Germans cook with?
Goodbye Horses: The Many Lives of Q Lazzarus
Produzione mondiale di vino
Evita Role Wsj Crossword Clue
Best Restaurants In Seaside Heights Nj
Lost Pizza Nutrition
Pollen Count Central Islip
Red Heeler Dog Breed Info, Pictures, Facts, Puppy Price & FAQs
Culos Grandes Ricos
Gas Station Drive Thru Car Wash Near Me
Springfield Mo Craiglist
Gon Deer Forum
Mani Pedi Walk Ins Near Me
Razor Edge Gotti Pitbull Price
Msu 247 Football
Huntersville Town Billboards
Rural King Credit Card Minimum Credit Score
Reptile Expo Fayetteville Nc
Tu Pulga Online Utah
Knock At The Cabin Showtimes Near Alamo Drafthouse Raleigh
Scheuren maar: Ford Sierra Cosworth naar de veiling
Which Sentence is Punctuated Correctly?
Ontdek Pearson support voor digitaal testen en scoren
Low Tide In Twilight Ch 52
The Boogeyman (Film, 2023) - MovieMeter.nl
Hrconnect Kp Login
Encore Atlanta Cheer Competition
Ullu Coupon Code
Dreamcargiveaways
About | Swan Medical Group
LEGO Star Wars: Rebuild the Galaxy Review - Latest Animated Special Brings Loads of Fun With An Emotional Twist
Lichen - 1.17.0 - Gemsbok! Antler Windchimes! Shoji Screens!
Wednesday Morning Gifs
Buhsd Studentvue
Scanning the Airwaves
Jason Brewer Leaving Fox 25
Below Five Store Near Me
Sdn Fertitta 2024
21 Alive Weather Team
Leland Nc Craigslist
Dobratz Hantge Funeral Chapel Obituaries
Grand Park Baseball Tournaments
Uncle Pete's Wheeling Wv Menu
Nfl Espn Expert Picks 2023
8663831604
7 Sites to Identify the Owner of a Phone Number
Zalog Forum
Olay Holiday Gift Rebate.com
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.