Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to solve the problem that apt-get update cannot add new CD-ROM under Ubuntu

Shulou Source: shulou.com Published: 2022-06-01 15:58:13 10月03日 Update

This article mainly explains "how to solve the problem that apt-get update can not add new CD-ROM under Ubuntu". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to solve the problem that apt-get update can not add new CD-ROM under Ubuntu".

I am experiencing Elementary OS Freya these days, during which time 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:

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

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

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.

Fixed a bug where apt-get update could not add a new CD-ROM

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

In Ubuntu, find "Software and updates":

In the first tab of Ubuntu Software, find cdrom, and if it is checked, uncheck it.

Close the software source and run the update again. It should be ready for use now.

Further troubleshooting:

The method described above has fixed this apt-get update cannot be used to add new CD-ROMs error. But this method doesn't work for me, because the option for cdrom is grayed out at this time, because I'm using the live version.

Now it's time to fix our problem, we're going to take the command line route. Open the terminal and see which sources are included in the software source:

The code is as follows:

Cat / etc/apt/sources.list

My output is as follows:

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 contains cdrom. We need to comment out this line with'#':

The code is as follows:

# deb cdrom: [elementary OS 0.3 _ Freya_-Daily amd64 (20150208)] / trusty main restricted

To use the following command:

The code is as follows:

Sudo gedit / etc/apt/sources.list

After you have finished editing the software source, run apt-get update again. The "apt-get update cannot be used to add new CD-ROMs" bug should have been fixed. If you have any other problems, take a look at this article, which collects most of the common Ubuntu update bug fixes.

Thank you for reading, the above is "how to solve the problem that apt-get update can not add a new CD-ROM under Ubuntu". After the study of this article, I believe you have a deeper understanding of how to solve the problem that apt-get update can not add new CD-ROM under Ubuntu, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Problems errors code software updates learning running content again commands common articles methods faces one line middle reasons most of which are ideas Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Shulou Information MariaDB Xiaomi MySQL