18.04 服务器和 18.04.1 服务器 ISO 之间的 sources.list 条目不同

18.04 服务器和 18.04.1 服务器 ISO 之间的 sources.list 条目不同

我已经构建了 2 个全新的 Ubuntu 服务器虚拟机。一个来自 18.04.1 ISO,另一个来自较旧的 18.04 ISO。我遇到的问题是“apt get install ansible”在 18.04.1 VM 上不起作用,而在 18.04 VM 上可以起作用。(我应该注意,即使我将 ppa:ansible/ansible 添加到 18.04.1 VM,它仍然不起作用,因为它需要 sshpass 模块,而该模块在 18.04.1 上似乎也无法访问。)

因此,深入研究两个虚拟机之间的差异后,我注意到 18.04 虚拟机在其 /etc/apt/source.list 文件中有 10 个左右的存储库(不包括 deb-src 行),而 18.04.1 只有 4 个。

我在 18.04.1 自述文件中没有看到任何说明,表明 sources.list 文件会有所不同。那么,我在这里做错了什么?

答案1

安装后遇到了同样的问题这幅特定的图像

只有 3 个来源/etc/apt/sources.list

deb http://archive.ubuntu.com/ubuntu bionic main
deb http://archive.ubuntu.com/ubuntu bionic-security main
deb http://archive.ubuntu.com/ubuntu bionic-updates main

我必须借助以下工具手动添加其他 7 个常见来源GitHub 上的这些说明

简而言之,文件的内容应如下所示。使用sudo nano或您最喜欢的文本编辑器将内容更改为此。

#deb cdrom:[Ubuntu 18.04 LTS _Bionic Beaver_ - Release amd64 (20180426)]/ bionic main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic universe
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner

deb http://security.ubuntu.com/ubuntu bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse

答案2

同样的问题,似乎有一个错误,但我还没有找到如何修复它的线索。

这是我的sources.list

deb http://archive.ubuntu.com/ubuntu bionic main 
deb http://archive.ubuntu.com/ubuntu bionic-security main 
deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main
deb http://archive.ubuntu.com/ubuntu bionic-updates main

我的 Ubuntu 服务器版本:

Ubuntu 18.04.1 LTS \n \l

错误如下:

sudo apt-get install ansible
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:
ansible : Depends: sshpass but it is not installable
E: Unable to correct problems, you have held broken packages.

找到解决办法:

我不太明白为什么 Ubuntu 18.04.1 的默认安装不包含更多源,/etc/apt/sources.list默认情况下它只包含:

deb http://archive.ubuntu.com/ubuntu bionic main
deb http://archive.ubuntu.com/ubuntu bionic-security main
deb http://archive.ubuntu.com/ubuntu bionic-updates main

我修复丢失的软件包的方法是添加这个:

https://gist.github.com/jackw1111/d31140946901fab417131ff4d9ae92e3

答案3

下载服务器版本时默认获得的版本也存在同样的问题。这使用了新的 Subiquity 安装程序,它有点不同,显然会产生略有不同的结果。似乎更适合云...

阅读文本并下载了替代安装程序版本,这是旧的安装程序...sources.list 与人们对此版本的期望一致。

相关内容