可能是服务器问题 - 无法 apt-get 更新

可能是服务器问题 - 无法 apt-get 更新

当我跑步时:

sudo apt-get update

我最后收到这个错误:

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/Release  Unable to find expected entry 'restricted/source/Sources' in Release file (Wrong sources.list entry or malformed file)

E: Some index files failed to download. They have been ignored, or old ones used instead.

问题如何从我的 sources.list 中删除格式错误的行?类似,但是有错误报告Malformed line 91 in但是这个错误没有显示任何错误的行号。

在过去的两个小时里,我一直在尝试解决这个问题。

  • 确认sources.list没有错误
  • 尝试过解决方案并得到同样的错误。

最后,几分钟前起作用的是从 Synaptic 中“选择最佳服务器”,最终成功刷新了所有软件包列表。

但我仍然无法安装新软件。这是一个新鲜的安装Ubuntu 14.04.3 64 位来自主页

当我运行时sudo apt-get install libpq-dev,我收到以下响应:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libpq-dev : Depends: libssl-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

来源列表- 删除评论

deb http://archive.ubuntu.com/ubuntu trusty main restricted
deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted
deb http://archive.ubuntu.com/ubuntu trusty universe
deb http://archive.ubuntu.com/ubuntu trusty-updates universe
deb http://archive.ubuntu.com/ubuntu trusty-security main restricted
deb http://archive.ubuntu.com/ubuntu trusty-security universe
deb http://archive.canonical.com/ubuntu trusty partner
deb-src http://archive.canonical.com/ubuntu trusty partner
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main

apt-cache policy libssl-dev

libssl-dev:
  Installed: (none)
  Candidate: 1.0.1f-1ubuntu2.15
  Version table:
     1.0.1f-1ubuntu2.15 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
     1.0.1f-1ubuntu2 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

apt-cache policy libpq-dev

libpq-dev:
  Installed: (none)
  Candidate: 9.3.9-0ubuntu0.14.04
  Version table:
     9.3.9-0ubuntu0.14.04 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
     9.3.7-0ubuntu0.14.04 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
     9.3.4-1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

答案1

我看不出你的(编辑过的)答案有什么问题。试试这个

sudo apt-get update
sudo apt-get install libssl-dev
sudo apt-get install libpq-dev

并给我留言。对于所有其他读者,这是一个正在进行的答案。

相关内容