E: You Must Put Some 'deb-src' Uris In Your Sources.list

Kalali
Jun 05, 2025 · 3 min read

Table of Contents
Fixing the "E: You Must Put Some 'deb-src' URIs in Your Sources.list" Error in Debian/Ubuntu
This error message, "E: You must put some 'deb-src' URIs in your sources.list," often pops up during package installations or updates in Debian-based systems like Ubuntu. It signifies that your system's /etc/apt/sources.list
file is missing the necessary deb-src
lines. This article explains what deb-src
is, why it's needed, and how to resolve this error effectively.
What are deb
and deb-src
URIs?
When you install software using APT (Advanced Package Tool) in Debian or Ubuntu, you're essentially downloading packages from repositories specified in your /etc/apt/sources.list
file. These repositories contain compiled binary packages (deb
URIs). However, deb-src
URIs point to the source code for those packages. This source code isn't typically necessary for basic installation, but it's crucial for specific tasks like:
- Building packages from source: This is essential if you need to compile a package with specific options or customizations not available in pre-built binaries.
- Debugging package issues: Having the source code allows you to inspect the codebase to identify and potentially fix problems within a package.
- Contributing to open-source projects: Accessing the source code allows you to participate in the development and improvement of the software.
- Advanced package management: Certain package management techniques and tools require access to the source code for their operation.
Why the Error Occurs
The "E: You must put some 'deb-src' URIs in your sources.list" error arises when you attempt an action (like building a kernel module, compiling a package from source using dpkg-buildpackage
, or using certain debugging tools) that requires access to source code, but your /etc/apt/sources.list
file lacks the corresponding deb-src
entries. The system is simply telling you that it cannot find the source code repositories.
How to Solve the Error
The solution is straightforward: add deb-src
lines to your /etc/apt/sources.list
file. These lines should mirror your existing deb
lines, but with deb-src
instead of deb
. Crucially, only add deb-src
entries if you actually need them. Including them unnecessarily might increase download times and storage usage.
Here's how to do it:
-
Backup your sources.list: Before making any changes, create a backup of your
/etc/apt/sources.list
file:sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
-
Open sources.list: Use a text editor with root privileges to open the file:
sudo nano /etc/apt/sources.list
-
Add deb-src lines: For every
deb
line, add a correspondingdeb-src
line directly beneath it. For example, if you have:deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
Add the following line below it:
deb-src http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
Repeat this for all your
deb
entries. -
Save and update: Save the changes and update your package lists:
sudo apt update
This should resolve the "E: You must put some 'deb-src' URIs in your sources.list" error. Remember to only add deb-src
entries when you need access to the source code for specific tasks. If the error persists after following these steps, consider checking for typos in your sources.list
file or verifying your internet connection. Also ensure that the repositories you're referencing are still active and available.
Latest Posts
Latest Posts
-
Wood Filler For Hardwood Floor Gaps
Jun 06, 2025
-
A Spark Plug With Too Cold A Heat Range Will
Jun 06, 2025
-
Can I Paint A Toilet Bowl
Jun 06, 2025
-
Dragon Age Inquisition How To Save Everyone In Haven
Jun 06, 2025
-
Can You Play Munchkin With 2 Players
Jun 06, 2025
Related Post
Thank you for visiting our website which covers about E: You Must Put Some 'deb-src' Uris In Your Sources.list . We hope the information provided has been useful to you. Feel free to contact us if you have any questions or need further assistance. See you next time and don't miss to bookmark.