我最近将 Debian 8.1 安装到我的硬盘上,并将 iso 映像刻录到 DVD-R。当我尝试从终端安装 g++ 时,它要求我将安装操作系统的 DVD 插入到硬盘上,然后再继续。这是我的第一个担忧,更引发了我的第二个担忧。但关于第一个问题的更多细节;它不起作用。我插入CD,它给了我一个非常大的错误消息。我尝试过apt-get update
,但它给了我同样的错误。每当我尝试安装任何东西apt-get install
并按照要求放入 DVD 时,我都会收到此错误。该错误是:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
binutils g++-4.9 gcc gcc-4.9 libasan1 libatomic1 libc-dev-bin libc6-dev libcilkrts5
libgcc-4.9-dev libitm1 liblsan0 libstdc++-4.9-dev libtsan0 libubsan0 linux-libc-dev
manpages-dev
Suggested packages:
binutils-doc g++-multilib g++-4.9-multilib gcc-4.9-doc libstdc++6-4.9-dbg gcc-multilib make
autoconf automake libtool flex bison gdb gcc-doc gcc-4.9-multilib gcc-4.9-locales libgcc1-dbg
libgomp1-dbg libitm1-dbg libatomic1-dbg libasan1-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg
libcilkrts5-dbg libquadmath0-dbg glibc-doc libstdc++-4.9-doc
The following NEW packages will be installed:
binutils g++ g++-4.9 gcc gcc-4.9 libasan1 libatomic1 libc-dev-bin libc6-dev libcilkrts5
libgcc-4.9-dev libitm1 liblsan0 libstdc++-4.9-dev libtsan0 libubsan0 linux-libc-dev
manpages-dev
0 upgraded, 18 newly installed, 0 to remove and 92 not upgraded.
Need to get 1,008 kB/39.2 MB of archives.
After this operation, 116 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://security.debian.org/ jessie/updates/main linux-libc-dev amd64 3.16.7-ckt20-1+deb8u3 [1,008 kB]
Err cdrom://[Debian GNU/Linux 8.2.0 _Jessie_ - Official amd64 DVD Binary-1 20150906-11:13]/ jessie/main manpages-dev all 3.74-1
Read error - read (5: Input/output error)
Fetched 1,008 kB in 11s (85.8 kB/s)
E: Failed to fetch cdrom://[Debian GNU/Linux 8.2.0 _Jessie_ - Official amd64 DVD Binary-1 20150906-11:13]/pool/main/b/binutils/binutils_2.25-5_amd64.deb Hash Sum mismatch
E: Failed to fetch cdrom://[Debian GNU/Linux 8.2.0 _Jessie_ - Official amd64 DVD Binary-1 20150906-11:13]/pool/main/m/manpages/manpages-dev_3.74-1_all.deb Read error - read (5: Input/output error)
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
我的第二个问题是,考虑到整个 DVD 事件的发生,我是否可以在没有 DVD 的情况下关闭计算机后真正启动到 Debian。这行得通吗?如果我关闭计算机并重新打开它,它会自动启动到 Debian 吗?我不敢关掉我的电脑,因为我一开始就很难在我的笔记本电脑上运行它(Lenovo 对 GNU/Linux 不友好)。
答案1
您的问题是 APT 配置为在 Debian DVD 集中查找软件包。
编辑您的sources.list文件,确保任何包含以下内容的行光盘要么被删除,要么被评论。
编辑sources.list文件
# vi /etc/apt/sources.list
或者
# gksu gedit /etc/apt/sources.list
所以你的sources.list文件看起来像这样
deb cdrom:[Debian GNU/Linux 8 _Jessie_ - Official Snapshot amd64 LIVE/INSTALL Binary 20150908-22:01]/ jessie main
deb cdrom:[Debian GNU/Linux 8 _Jessie_ - Official Snapshot amd64 LIVE/INSTALL Binary 20150908-22:01]/ jessie main
deb http://httpredir.debian.org/debian/ jessie main
deb-src http://httpredir.debian.org/debian/ jessie main
deb http://security.debian.org/ jessie/updates main contrib
deb-src http://security.debian.org/ jessie/updates main contrib
# jessie-updates, previously known as 'volatile'
deb http://httpredir.debian.org/debian/ jessie-updates main
deb-src http://httpredir.debian.org/debian/ jessie-updates main
现在评论罪魁祸首:
# deb cdrom:[Debian GNU/Linux 8 _Jessie_ - Official Snapshot amd64 LIVE/INSTALL Binary 20150908-22:01]/ jessie main
# deb cdrom:[Debian GNU/Linux 8 _Jessie_ - Official Snapshot amd64 LIVE/INSTALL Binary 20150908-22:01]/ jessie main
deb http://httpredir.debian.org/debian/ jessie main contrib non-free
deb-src http://httpredir.debian.org/debian/ jessie main contrib non-free
...
或删除它们:
deb http://httpredir.debian.org/debian/ jessie main contrib non-free
deb-src http://httpredir.debian.org/debian/ jessie main contrib non-free
...
请注意,我添加了“contrib”和“non-free”存储库。这是必要的,例如,如果您想要良好的图形加速,为所有架构安装 gcc-doc 软件包等。AMD 和 nVidia 专有驱动程序包含在非自由存储库中,并且考虑了一些 GCC 联机帮助页非自由的由 Debian 提供,因为 GFDL(GNU 自由文档许可证)与 DFSG(Debian 自由软件指南)不兼容。
现在,关于您的第二个问题,我认为如果您将 GRUB2 安装到第一个驱动器的 MBR,一切都会顺利,但是,为了确保安全,请以 root 身份运行此命令。
# update-grub
如果您看到输出中列出了所有操作系统,我们会很高兴。