源列表 /etc/apt/sources.list 第 1 行中类型 '--2016-08-04' 未知

源列表 /etc/apt/sources.list 第 1 行中类型 '--2016-08-04' 未知

我想在我的Ubuntu 14.04系统中安装Hadoop。按照博客的指示,我需要更新“源列表”。

但是当我输入命令时:sudo apt-get update我收到错误:

E: Type '--2016-08-04' is not known on line 1 in source list /etc/apt/sources.list       E: The list of sources could not be read.
E: The package lists or status file could not be parsed or opened.

同时,菜单右上角会出现一个停止标志,上面写着:

出现错误。请从右键菜单运行包管理器或在终端中运行 apt-get 来查看错误原因。

错误信息如下:

'Unknown error: '<class 'SystemError'
E:Type '--2016-08-04' is not known on line 1 in the source list /etc/apt/sources.list.
This usually means that your installed packages have unmet dependencies"

/etc/apt/sources.list

--2016-08-04 21:29:00-- (try: 1) http://pastebin.com     
/raw.php?i=uzhrtg5M Resolving pastebin.com (pastebin.com)...     
104.20.63.56, 104.20.64.56 Connecting to pastebin.com  
(pastebin.com)|104.20.63.56|:80... connected.
HTTP request sent, awaiting response...
Read error (Connection reset by peer) in headers. Retrying.

这是 sources.list 的开头。

答案1

/etc/apt/sources.list以 root 身份在编辑器中打开(例如在终端中输入gksudo gedit /etc/apt/sources.list,并将其所有内容替换为以下内容

#############################################################
################### OFFICIAL UBUNTU REPOS ###################
#############################################################

###### Ubuntu Main Repos
deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse 

###### Ubuntu Update Repos
deb http://us.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse 
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse 
deb http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse 

###### Ubuntu Partner Repo
deb http://archive.canonical.com/ubuntu trusty partner
deb-src http://archive.canonical.com/ubuntu trusty partner

###### Ubuntu Extras Repo
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main

您的问题是,这个文件中没有 repositorires,而是一些命令的输出。我不知道它是怎么到那里的,您最好知道这一点。

相关内容