如何重新生成干净的 sources.list

如何重新生成干净的 sources.list

我弄乱了我的存储库,无法成功重建新存储库。这就是我拥有的存储库所发生的情况。(这是我尝试安装某些东西的唯一方法。)

sudo apt-get install apache2
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:
 apache2 : Depends: apache2-bin (= 2.4.10-10+deb8u4) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

否则我只会收到此消息

E: Unable to locate package

->这是我目前的 sources.list:

来源列表

我的 Ubuntu 版本是:

Distributor ID: Ubuntu
Description:    Ubuntu 16.04 LTS
Release:        16.04
Codename:       xenial

答案1

如何重新生成干净的 sources.list

请使用以下源生成器生成 sources.list 的内容(文件本身位于/etc/apt/sources.list

当前 sources.list 中有错误

只是想解释一些错误:

在此处输入图片描述

sources.list 有什么用

您的操作系统根据 sources.list 知道它可以找到哪些软件/软件包(从哪里),并据此将其提供给您的计算机。它在某种程度上是您的软件包管理器的重要组成部分。

一般提示/警告

在不了解自己正在做什么的情况下编辑系统相关文件可能会很危险。

对我来说,您似乎将 Debian Etch(一个非常古老的 Debian 版本)的 apt 源添加到了您的 Ubuntu 16.04 sources.list。这与您作为初学者应该做的事情相去甚远。您可以将其与使用 Windows 98 中的 DLL 并尝试在 Windows 7 中使用它们进行比较。

如果涉及 Ubuntu 或其他 Linux 发行版 - 如果命令需要sudo权限 - 请阅读并尝试理解该命令应该做什么 - 然后再考虑执行它。

相关内容