全新服务器 14.04 安装:所有内容均“无法找到包(xyz)”;如何编辑 sources.list?

全新服务器 14.04 安装:所有内容均“无法找到包(xyz)”;如何编辑 sources.list?

我无法在apt-get全新安装的 14.04 Server 上安装任何东西。我Unable to locate package [xyz]尝试了所有方法,但sudo apt-get update都失败了。什么都没发生。这一页意味着我需要编辑sources.list,但我不知道如何编辑。我认为没有安装任何文本编辑器,因为这是服务器版本。

我该如何修复这个问题?如果我无法安装任何东西,我的服务器就变得毫无用处了。

编辑:这是输出sudo apt-get update

Ign cdrom://Ubuntu-Server 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.3) trusty InRelease
Ign cdrom://Ubuntu-Server 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.3) trusty/main Translation-en_US
Ign cdrom://Ubuntu-Server 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.3) trusty/main Translation-en
Ign cdrom://Ubuntu-Server 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.3) trusty/restricted Translation-en_US
Ign cdrom://Ubuntu-Server 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.3) trusty/restricted Translation-en
Reading package lists... Done

它应该这么做吗?

编辑2:只有一行sources.list

deb cdrom:[Ubuntu-Server 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.3)]/ trusty main restricted

答案1

目前,使用它作为你的sources.list

deb http://[cc].archive.ubuntu.com/ubuntu/ trusty main multiverse universe restricted
deb http://[cc].archive.ubuntu.com/ubuntu/ trusty-updates main multiverse universe restricted
deb http://[cc].archive.ubuntu.com/ubuntu/ trusty-security main multiverse universe restricted

替换[cc]为您的国家代码(例如us美国、fr法国、in印度)。并删除您不需要的频道(一个或多个、、multiverse)。universerestricted

相关内容