Debian

How to Enable the Contrib and Non-Free Repositories on Debian 12

On Debian 12, the official package repositories’ main and non-free-firmware are enabled by default. Debian 12 has two more official package repositories which are “contrib” and “non-free”. Debian 12 contrib and non-free package repositories come with thousands of extra software packages that you will definitely need.

In this article, we will show you how to enable the official Debian 12 contrib and non-free package repositories. We will also show you how to disable the official Debian 12 contrib and non-free package repositories.

Topic of Contents:

    1. How to List the Currently Enabled Debian 12 Repositories
    2. How to Enable the Contrib Repository on Debian 12
    3. How to Enable the Non-Free Repository on Debian 12
    4. How to Disable the Contrib Repository on Debian 12
    5. How to Disable the Non-Free Repository on Debian 12
    6. Conclusion

How to List the Currently Enabled Debian 12 Repositories

To list the currently enabled Debian 12 repositories, run the following command:

$ sudo apt-add-repository --list

 
As you can see, the Debian 12 main and non-free-firmware package repositories are enabled by default.

How to Enable the Contrib Repository on Debian 12

To enable the official Debian 12 contrib package repository on Debian 12, run the following command:

$ sudo apt-add-repository contrib

 
Press <Enter>.


The official Debian 12 contrib package repository should be enabled and the APT package database should be updated.


As you can see, the official Debian 12 contrib package repository was added to Debian 12.

$ sudo apt-add-repository --list

 

How to Enable the Non-fFree Repository on Debian 12

To enable the official Debian 12 non-free package repository on Debian 12, run the following command:

$ sudo apt-add-repository non-free

 
Press <Enter>.


The official Debian 12 non-free package repository should be enabled and the APT package database should be updated.


As you can see, the official Debian 12 non-free package repository was added to Debian 12.

$ sudo apt-add-repository --list

 

How to Disable the Contrib Repository on Debian 12

To disable/remove the official Debian 12 contrib package repository, run the following command:

$ sudo apt-add-repository --remove contrib

 
Press <Enter>.


The official Debian 12 contrib package repository should be disabled/removed and the APT package database should be updated to reflect the changes.


As you can see, the official Debian 12 contrib package repository is not on the enabled package repository list of Debian 12 anymore.

$ sudo apt-add-repository --list

 

How to Disable the Non-Free Repository on Debian 12

To disable/remove the official Debian 12 non-free package repository, run the following command:

$ sudo apt-add-repository --remove non-free

 
Press <Enter>.


The official Debian 12 non-free package repository should be disabled/removed and the APT package database should be updated to reflect the changes.


As you can see, the official Debian 12 non-free package repository is not on the enabled package repository list of Debian 12 anymore.

$ sudo apt-add-repository --list

 

Conclusion

In this article, we showed you how to enable/add the official Debian 12 contrib and non-free package repositories. We also showed you how to disable/remove the official Debian 12 contrib and non-free package repositories.

About the author

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.