Solve the problem that apt get update under Ubuntu cannot add a new CD-ROM

Time:2022-7-15

I’m experiencing elemental OS Freya these days. During this period, I encountered a very common update error: failed to fetch CDROM please use apt CDROM to make this CD-ROM recognized by apt. apt get update cannot be used to add new CD ROMs. The complete error looks like this after running apt get update:

   

Copy code

The code is as follows:

W: Failed to fetch cdrom://elementary OS 0.3 Freya – Daily amd64 (20150208)/dists/trusty/main/binary-amd64/Packages Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs</p>
<p> W: Failed to fetch cdrom://elementary OS 0.3 Freya – Daily amd64 (20150208)/dists/trusty/restricted/binary-amd64/Packages Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs</p>
<p> E: Some index files failed to download. They have been ignored, or old ones used instead.

In this article, we will learn how to fix this error.
Fix the error that apt get update cannot add a new CD-ROM

The reason for this error is that CDROM has been included in the source. To fix this problem, we need to remove it from the software source.

In Ubuntu, find “software and updates”:
201563180519871.jpg (512×220)

In the first tab of Ubuntu software, find CDROM. If it is checked, uncheck it.
201563180541449.jpg (597×468)

Close the software source and run the update again. It should be available now.
Further Troubleshooting:

The method described above has fixed the apt get update cannot be used to add new CD ROMs error. But this method is invalid for me, because the CDROM option is gray at this time, because I use the live version.
201563180601359.png (503×406)

Now to fix our problem, we need to adopt the command line route. Open the terminal and check which sources are included in the software source:

Copy code

The code is as follows:

cat /etc/apt/sources.list

My output is as follows:

   

Copy code

The code is as follows:

deb cdrom:[elementary OS 0.3 _Freya_ – Daily amd64 (20150208)]/ trusty main restricted
deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse

In the first line above. It includes CDROM. We need to comment out this line with ‘#’:

   

Copy code

The code is as follows:

#deb cdrom:[elementary OS 0.3 _Freya_ – Daily amd64 (20150208)]/ trusty main restricted

Use the following command to:

   

Copy code

The code is as follows:

sudo gedit /etc/apt/sources.list

After you edit the software source, run apt get update again. The error “apt get update cannot be used to add new CD ROMs” should have been fixed. If you have other problems, take a look at this article, which collects most of themUbuntu common update error repairArticle.