translated

This commit is contained in:
geekpi 2015-03-08 11:44:25 +08:00
parent 84dee5a79d
commit 8ce034ad64

View File

@ -1,10 +1,8 @@
Translating----geekpi 如何修复apt-get update无法添加新的CD-ROM
How To Fix: Failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs
================================================================================ ================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/12/elementary_OS_Freya.jpg) ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/12/elementary_OS_Freya.jpg)
These days I am experimenting with Elementary OS Freya and during this, I encountered a very common updater 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 looked like this after running the apt-get update command: 这些天我正在体验Elementary OS Freya在这期间我遇到了一个非常常见的更新错误**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**。完整的错误在运行apt-get update后看上去像这样
> 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/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
> >
@ -12,33 +10,33 @@ These days I am experimenting with Elementary OS Freya and during this, I encoun
> >
> E: Some index files failed to download. They have been ignored, or old ones used instead. > E: Some index files failed to download. They have been ignored, or old ones used instead.
In this post, we shall see how to fix this error. 本篇中,我们会了解如何修复这个错误。
### Fix Failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs error ### ### 修复apt-get update无法添加新的CD-ROM的错误 ###
The reason for this error is that cdrom has been included as one of the the sources here. And to fix this issue, we need to remove this from the list of software sources. 这个错误的原因是cdrom已经被包含在源之中。要修复这个问题我们需要将它从软件源中移除。
In Ubuntu, look for Software & Updates: 在Ubuntu中找到“软件与更新”
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Software_Update_Ubuntu.jpeg) ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Software_Update_Ubuntu.jpeg)
In the first tab Ubuntu Software, look for the cdrom, if its checked, uncheck it. 在Ubuntu Software的第一个标签中找到cdrom如果它是勾选的那么取消勾选。
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/CDROM_Error_Update_Software_Sources.jpeg) ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/CDROM_Error_Update_Software_Sources.jpeg)
Close the Software Sources and run the update again. It should work fine now. 关闭软件源并再次运行更新。现在应该可以用了。
### Further troubleshoot: ### ### 进一步故障排除: ###
The method described above should have fixed this **apt-get update cannot be used to add new CD-ROMs** error. But this was not the case for me because the option of cdrom was already grayed out as I was using live session. 上面描述的方法已经修复了这个**apt-get update cannot be used to add new CD-ROMs**错误。但是这个方法对我无效因为cdrom的选项这时是灰色的因为我使用的live版本。
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/CDROM_Update_Error.png) ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/CDROM_Update_Error.png)
Now to fix our error, we shall take the command line route. Open a terminal and use the following line to see what is included in sources list: 现在要修复我们的问题了,我们是要采用命令行路线。打开终端并查看软件源中包含了哪些源:
cat /etc/apt/sources.list cat /etc/apt/sources.list
The output for me was as following: 我的输出是下面这样:
deb cdrom:[elementary OS 0.3 _Freya_ Daily amd64 (20150208)]/ trusty main restricted 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 http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
@ -48,17 +46,17 @@ The output for me was as following:
deb http://archive.ubuntu.com/ubuntu/ trusty-updates 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 deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
Look at the first line in the above list. It includes cdrom. We need to comment out this line by adding # in front of it to make it look like this: 在上面的第一行中。它包含了cdrom。我们需要用#’来注释掉这行:
#deb cdrom:[elementary OS 0.3 _Freya_ Daily amd64 (20150208)]/ trusty main restricted #deb cdrom:[elementary OS 0.3 _Freya_ Daily amd64 (20150208)]/ trusty main restricted
To do that use the command below: 要用下面的命令来:
sudo gedit /etc/apt/sources.list sudo gedit /etc/apt/sources.list
Once you have edited the sources.list, run the apt-get update once again. The error apt-get update cannot be used to add new CD-ROMs should have been fixed. If you are facing any other update issue, do look at this article which is a collection of most [common Ubuntu update error fixes][1]. 在你编辑完软件源后再次运行apt-get update。“apt-get update cannot be used to add new CD-ROMs”这个错误应该已经修复了。如果你还遇到其他的问题看一下这篇收集了大部分[Ubuntu常见更新错误修复][1]的文章。
I hope you found this tutorial helpful. If you have any questions or suggestions, feel free to drop a comment. 我希望这篇教程对你有用。如果你还有其他的问题和建议,请在下面留言。
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------