How to Fix ‘apt update’ Using CD-ROM Source?

0
10
Asked By CuriousHedgehog42 On

I'm going through a tutorial about using the `apt` command but ran into a snag when trying to execute the commands `sudo apt update` and `sudo apt upgrade`. Instead of connecting to the online Debian repositories, it seems like my system is trying to update from a CD-ROM. The terminal output shows a lot of errors related to the CD-ROM source:

`Err:2 cdrom://[Debian GNU/Linux 12.11.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20250517-09:52] bookworm Release`

I double-checked the sources.list file at `/etc/apt/sources.list` and confirmed there's a line referencing the CD-ROM. How do I fix this? Should I edit the sources file to point to an online repository instead? If so, what should I replace the CD-ROM entry with? Any help would be greatly appreciated!

4 Answers

Answered By NerdyGiraffe88 On

Run `sudo nano /etc/apt/sources.list` and look for the line that points to the DVD/CD. Delete that line or comment it out by placing a '#' in front of it. Save your changes and then try running `sudo apt update` and `sudo apt upgrade` again in a new terminal. That should clear up the problem!

Answered By HelpfulFalcon77 On

You can find examples of how the sources.list file should look at the Debian wiki. You need to either delete the line referencing the CD-ROM or comment it out by adding a '#' at the beginning. Just open the file with a text editor using `sudo`, like this: `sudo nano /etc/apt/sources.list`. Make those changes and save it! Afterward, run `sudo apt update` again to see if it works.

Answered By WittyOtter15 On

It's strange that the installer keeps a CD source for updates. You can try removing it after installing. Also, it sounds like you’re not the only one surprised by this setup. Consider switching to a different distro that handles packages from the internet right from the start, such as Ubuntu or Linux Mint. They tend to be more beginner-friendly.

CuriousHedgehog42 -

Thanks for the tip! I didn't reboot after the install, and I'm intrigued by the suggestion to try a different distribution. I'll give these solutions a shot and see where it leads me!

Answered By TechyTurtle93 On

For a quick fix, you can copy the example sources.list file found at `/usr/share/doc/apt/examples/sources.list` into your `/etc/apt/` directory. After doing that, run `sudo apt update` and `sudo apt install netselect-apt` to help find a nearby mirror. Then create or modify your sources.list file to include non-free components and point to the new sources. This should solve your issue!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.