Raspberry Pi

How to Delete Repositories on Raspberry Pi

Adding repositories on Linux systems, including the Raspberry Pi OS, is one of the most used processes. It allows users to install an application or software that isn’t available in the official system repository. Though adding too many repositories in the system slows down the updating process. As a Raspberry Pi user, removing repositories that are no longer required on the system is better. In this way, you can free up space and improve the updating process’s speed.

This article will show you how to remove repositories from Raspberry Pi.

How to Remove Repositories from Raspberry Pi

The repositories you add to the Raspberry Pi system are stored in the location “/etc/apt/sources.list.d” and you have to navigate to the repository directory using the following command in the terminal:

$ cd /etc/apt/sources.list.d

To check for the repository, you can use the “ls” command inside the repository directory:

The highlighted repository with the .list” extension is the repository currently added on the Raspberry Pi system. The “raspi.list” is the official Raspberry Pi repository, so you don’t require removing it from the system. The third-party repository “bitcoin.list” is the repository I will remove from the Raspberry Pi system. For removal, you can use the following command:

$ sudo rm -rf bitcoin.list

This removes the repository from the Raspberry Pi system and you can confirm it using the “ls” command again.

Once the repository is successfully removed, you must run the following command to update the repository on the Raspberry Pi system.

$ sudo apt update

In this way, you can remove multiple repositories from your system that you don’t want to use.

Conclusion

Removing repositories on the Raspberry Pi system is a simple task, which only requires navigating to the repository directory “/etc/apt/sources.list.d” using the “cd” command and checking for the added repositories using the “ls” command. The repository can then be removed from the Raspberry Pi system using the “sudo rm -rf” command with the repository name. You must update the repository using the “update” command to apply the changes.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.