【发布时间】:2021-06-10 09:21:30
【问题描述】:
每当我尝试在 ubuntu 中安装软件包时,它都会抛出如下代码所示的错误
但是如果我尝试用从机 ping 它看起来很好
172.31.6.185 | FAILED! => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python3"
},
"cache_update_time": 1619825195,
"cache_updated": false,
"changed": false,
"msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\" install 'httpd'' failed: E: Package 'httpd' has no installation candidate\n",
"rc": 100,
"stderr": "E: Package 'httpd' has no installation candidate\n",
"stderr_lines": [
"E: Package 'httpd' has no installation candidate"
],
"stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nPackage httpd is a virtual package provided by:\n nginx-core 1.18.0-0ubuntu1\n apache2 2.4.41-4ubuntu3.1\n\n",
"stdout_lines": [
"Reading package lists...",
"Building dependency tree...",
"Reading state information...",
"Package httpd is a virtual package provided by:",
" nginx-core 1.18.0-0ubuntu1",
" apache2 2.4.41-4ubuntu3.1",
""
]
}
【问题讨论】:
-
报告的问题是它无法安装任何所需的依赖项。需要虚拟包
httpd。根据包管理器的说法,这个要求可以通过nginx-core版本1.18.0-0ubuntu1或apache2版本2.4.41-4ubuntu3.1来满足。两者都不能在没有冲突的情况下安装。您应该找出为什么这些软件包都无法安装,也许可以通过单独尝试并查看问题所在。 -
我想安装
httpd只是我应该怎么做才能避免安装时的冲突