使用apt get install而不插入DVD?


13

我使用DVD版本安装了Debian 7,因此每次尝试使用apt-get安装某些东西时,系统都会要求我安装DVD。有没有办法避免这种情况(每次插入DVD)。


编辑存储库列表没有帮助吗?
IBr

Answers:


7

您可以将DVD复制到ISO,然后将其作为文件系统永久安装在机器上(并通过修改指向它/etc/apt/sources.list)。但是,假设计算机已建立Internet连接,则可以切换到使用在线存储库。

详细信息在这里

但这是一个例子

编辑/etc/apt/sources.list并用其替换内容(这适用于Wheezy或Debian 7,对于早期或更高版本,请检查上面的链接),

deb http://http.debian.net/debian wheezy main contrib non-free
deb-src http://http.debian.net/debian wheezy main contrib non-free

deb http://http.debian.net/debian wheezy-updates main contrib non-free
deb-src http://http.debian.net/debian wheezy-updates main contrib non-free

deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free

然后运行apt-get update以刷新软件包详细信息。


我绑了:#root:“ gedit / etc / ...”无法访问文件,我也尝试过,chmod 777 / etc ..“但是没有碰巧,我想知道如何访问该文件!
timmz

因此,您的问题是错误的,您的问题需要为“我试图编辑/etc/apt/sources.list但不能”。在提出问题之前,您确实需要确保已向所有人提供了所有信息。
AugustBitTony

我现在可以访问它。我是否需要替换文件的所有内容,还是只在最后添加行?
timmz

用我上面提供的替换所有内容。
AugustBitTony13年

有命令行选项吗?我实际上是在尝试安装emacs,所以目前没有文本编辑器。

2

请注意这里。

如果您正在处理其中设置错误的问题/etc/apt/sources.list,例如需要使用磁盘,那么从头开始重写文件可能是个好主意。

为此,我仅使用https://debgen.simplylinux.ch/生成文件。

最初,我只是尝试sources.list按照建议从中删除引用,但是随后在尝试更新软件包时遇到了其他错误,例如

Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution...`

要么

git : Depends: liberror-perl but it is not installable

这些对我来说是因为我的版本sources.list 没有指向我需要的软件包源,但是重新生成sources.list解决了这个问题。


1

我需要一些见识,因此在阅读这些文章后,我使用了nano来编辑/etc/apt/sources.list文件,即

# nano /etc/apt/sources.list

进入文件后,第一个来源是CD指针,因此我要做的就是用#字符注释掉该行,并且所有内容都已固定。我现在从sources.list文件中列出的存储库中获取软件包。

谢谢您的帮助。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.