14

I installed Debian 11 (Bullseye) onto a device with no internet. I used the "firmware CD" version of the ISO. I have configured the network, so I can do ping 8.8.8.8. I tried to run sudo apt update, but I discovered that there weren't any sources in the sources.list file (e.g., it was empty).

I found this question, but it is for Debian Jessie, not Bullseye.

I would also like non-free packages. How can I restore the default repositories, as if I had installed Debian with an internet connection?

2 Answers 2

21

You can find all the information about sources.list in the official Debian wiki site, specifically about your question under Example sources.list:

deb http://deb.debian.org/debian bullseye main contrib non-free
deb-src http://deb.debian.org/debian bullseye main contrib non-free

deb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free
deb-src http://deb.debian.org/debian-security/ bullseye-security main contrib non-free

deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free

You can comment or delete the cdrom lines, since they are not useful anymore, and when executing apt update an error will be thrown.

Also comment out the deb-src lines unless you actually intend to download and compile source packages in the near future. Commenting them out halves the download time for apt update. Uncomment them if and when you want to recompile a package or examine its source code.

1
  • 1
    I think there is another simple way that doesn't involve browsing any wiki. As far as I remember, you can actually copy the sources.list from the iso image / CD / flash drive you used to install Debian in the first place.
    – D4RIO
    Commented Oct 4, 2021 at 0:57
6

The original list already there just copy it

$ sudo cp /usr/share/doc/apt/examples/sources.list /etc/apt/sources.list

$ sudo apt update
1
  • This solution does not require to know the original content, which depends on the version installed. It should be the accepted answer.
    – ocroquette
    Commented Nov 29, 2023 at 17:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .