How to Enable Non-Free Packages on Debian 12

Users can change the source code of the open-source operating system, Debian. It also allows its users to share and use the source code, however, there are some packages whose code is not open-source. 

To use the packages which are not open source, follow the steps which are going to explain in this post for enabling the non-free packages on Debian 12. 

Why Enable Non-Free Packages on Debian 12?

The packages which are not open source may contain restricted components. To use these packages, Debian users are supposed to enable these packages. 

Allowing or enabling the non-free packages on Debian 12, make it possible for the users to install such packages. 

What Types of Repositories Can Be Found in Debian 12?

Different types of repositories in Debian 12 are:

  • Main: This type of repository contains only those packages which are open source.
  • Contrib: This type of repository contains the packages which are not included in Debian’s official repository but are open-source. 
  • Non-Free: This type of repository contains the packages which are not open-source. 

What is the Method to Enable Non-Free Packages on Debian 12?

To enable the non-free packages on Debian 12, run the commands explained below.

Step 1: Open the Terminal

To begin, launch the terminal and enter the below-mentioned command:

Step 2: Open the sources.list File

After opening the terminal, with the help of the nano text editor, open the sources.list file:

$ sudo nano /etc/apt/sources.list

Step 3: Add the Non-Free Repository

Now to add the non-free repositories, add the “non-free” to each line of the file which is being started with the “deb”, as shown below:

Save the file with the CTRL+S and close it with CTRL+X shortcut keys.

Step 4: Update the Packages

Now update the free and non-free packages of Debian 12:

$ sudo apt update

The non-free packages on Debian 12 are successfully enabled. 

How to Search the Non-Free Packages on Debian 12?

To search the non-free packages on the Debian 12 after enabling them, use the command:

$ sudo apt search nonfree

This shows all the packages which are non-free in Debian’s repository.

Conclusion

To enable the non-free packages on Debian 12, open the sources.list file with the nano text editor. Then add the “non-free” at the end of every line which begins with “deb”. This will enable all the non-free packages on Debian 12, and one can use them by installing it on the computer.