How to fix apt-get source You must put some 'source' URIs in your sources.list
Problem:
You want to download an apt source package using
apt_get_source_example.sh
apt-get source <package name>but instead you see this error message:
example.txt
E: You must put some 'source' URIs in your sources.listSolution
In most cases, you can fix this easily using
example.sh
sudo apt-get updateIf this does not fix the issue, edit /etc/apt/sources.list, e.g. using
example.sh
sudo nano /etc/apt/sources.listand ensure that the deb-src lines are not commented out.
Example: You need to change
example.txt
deb http://archive.ubuntu.com/ubuntu artful main restricted
# deb-src http://archive.ubuntu.com/ubuntu artful main restrictedto
example.txt
deb http://archive.ubuntu.com/ubuntu artful main restricted
deb-src http://archive.ubuntu.com/ubuntu artful main restrictedand run sudo apt update after changing the file.
If there are repositories without a deb-src line, you can often try to copy the deb line - for example, from
example.sh
deb http://myserver.com/deb focal mainyou can create an additional line
example.txt
deb-src http://myserver.com/deb focal mainby changing deb to deb-src and running sudo apt update afterwards. This often works, but it depends on the repository.
Check out similar posts by category:
Linux
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow