skip to Main Content

Whenever I tried to install the package in ubuntu but it’s throwing an error like below following code

But if I tried to ping with slave machine it’s look fine

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 candidaten",
    "rc": 100,
    "stderr": "E: Package 'httpd' has no installation candidaten",
    "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-0ubuntu1n  apache2 2.4.41-4ubuntu3.1nn",
    "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",
        ""
    ]
}

2

Answers


  1. Hmm, how about try to update your adhoc command

    sudo apt update && sudo apt upgrade && sudo apt install apache2
    
    Login or Signup to reply.
  2. The problem is that Ubuntu does not have httpd as a package name, which is explained in the following error message:failed: E: Package ‘httpd’ has no installation candidate

    The Red Hat distribution family (RHEL, CentOS, and Fedora) call it httpd that because technically that’s the upstream project name, the Debian distribution family (of which Ubuntu is a descendant) is called apache2.

    https://www.thinbug.com/q/58357332

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search