Fix You must put some ‘deb-src’ URIs in your sources.list Error

When working with package management systems like apt or apt-get on Debian-based Linux distributions, you may encounter various errors.

One common error is the “E: You must put some ‘deb-src’ URIs in your sources.list” message, which occurs when attempting to use the source package repositories but missing the necessary configurations.

Understanding the Error

The “E: You must put some ‘deb-src’ URIs in your sources.list” error occurs when the apt-get command is unable to locate the source package repositories specified in the system’s sources.list file.

Source packages contain the source code used to build the binary packages available for installation. Enabling the source repositories allows users to fetch the source code of packages for inspection, modification, or recompilation.

E: You must put some 'deb-src' URIs in your sources.list"
E: You must put some ‘deb-src’ URIs in your sources.list”

Fixing E: You must put some ‘deb-src’ URIs in your sources.list

In this article, we will delve into the cause of this error and explore the steps to resolve it in the Ubuntu system via command line and desktop.

Using Ubuntu Command Line

To resolve the “E: You must put some ‘deb-src’ URIs in your sources.list” error, you can follow these steps:

1. First, open the sources.list file located in the /etc/apt/ directory using a nano text editor.

$ sudo nano /etc/apt/sources.list

Next, in the sources.list file, you will see lines that begin with "deb" and "deb-src" followed by a repository URL. The "deb" lines represent the binary package repositories, while the "deb-src" lines are used for source packages.

Ubuntu Sources List File
Ubuntu Sources List File

Locate the "deb-src" lines and ensure that they are not commented out (not preceded by a '#' symbol). If they are commented, remove the '#' symbol to uncomment them.

deb-src http://in.archive.ubuntu.com/ubuntu lunar main restricted
Enable deb-src Source
Enable deb-src Source

After adding or uncommenting the "deb-src" lines, save the changes to the sources.list file by pressing Ctrl + O, followed by Enter, and then exit the text editor by pressing Ctrl + X.

Now, update the package lists using the following command:

$ sudo apt-get update

This command will refresh the repository information, including the newly added source package repositories.

You can now retry the previous apt-get command that resulted in the error.

The “E: You must put some ‘deb-src’ URIs in your sources.list” error should no longer occur, and you can proceed with your desired package management task.

$ sudo apt-get source vsftpd
Downloading Package Source Code
Downloading Package Source Code

Using Ubuntu Desktop

To enable the Source Code repository in Ubuntu Desktop, you can follow these steps:

Open the “Software & Updates” application and navigate to the “Ubuntu Software” tab and enable the “Source code” option as shown.

Enable Source Code Repository in Ubuntu
Enable Source Code Repository in Ubuntu

When you close the “Software & Updates” window, Ubuntu will automatically refresh the package information to include the source code repositories.

Conclusion

The “E: You must put some ‘deb-src’ URIs in your sources.list” error can be resolved by adding or uncommenting the "deb-src" lines in the sources.list file and updating the package lists.

By enabling the source package repositories, you gain access to the source code of packages, enabling further exploration and customization. With the steps outlined in this article, you can overcome this error and continue effectively managing packages on your Debian-based Linux system.

Two small things before you go

If something didn’t work on your setup, leave a comment and tell me which distro and version you’re on. I read every one, and most of these articles got better because a reader pointed out what was missing.

And if it did work, share it. TecMint has stayed free for 14 years because people pass these articles around, and that traffic is what pays for writing the next one.

Leave a comment
Get two free Linux courses

Learn the Linux basics with two free courses and join 34,000+ readers getting practical TecMint tutorials and selected Pro TecMint articles every week.

Pro TecMint
Get lifetime access for $99

If you want to go beyond the free tutorials, Pro gives you 18 courses, 5 ebooks, and every future course I add. One payment, lifetime access, no renewals.

Ravi Saive
Ravi Saive
Administrator
About the author

I'm Ravi Saive, an award-winning entrepreneur and founder of several successful 5-figure online businesses, including TecMint.com, GeeksMint.com, UbuntuMint.com, and the premium learning hub Pro.Tecmint.com.

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.