You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "Doroszlai, Attila (JIRA)" <ji...@apache.org> on 2018/09/13 09:05:00 UTC

[jira] [Created] (AMBARI-24632) APT/DPKG existence check doesn't work for system packages

Doroszlai, Attila created AMBARI-24632:
------------------------------------------

             Summary: APT/DPKG existence check doesn't work for system packages
                 Key: AMBARI-24632
                 URL: https://issues.apache.org/jira/browse/AMBARI-24632
             Project: Ambari
          Issue Type: Bug
            Reporter: Doroszlai, Attila
             Fix For: 3.0.0


Package existence check for APT/DPKG is a bit too strict:

{noformat:title=https://github.com/apache/ambari/blob/c17762bdd91fddc0cca87d3aa24e4121c7b5e675/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py#L70}
check_cmd = pkg_manager_bin + " --get-selections | grep -v deinstall | awk '{print $1}' | grep ^%s$"
{noformat}

Also in previous versions: https://github.com/apache/ambari/blob/64cc76bfc7c83707f395d8487ea983dc8fddb267/ambari-common/src/main/python/resource_management/core/providers/package/apt.py#L51

System packages are postfixed by architecture, hence {{grep}} fails to find these due to {{$}}.  Examples where the existence check fails:

{noformat}
$ dpkg --get-selections | grep -v deinstall | awk '{print $1}' | grep -e '^liblzo2-2' -e '^libsnappy-dev'
liblzo2-2:amd64
libsnappy-dev:amd64
{noformat}

This results in {{Installing package ...}} being logged, which is a bit confusing.  Plus an unnecessary {{apt-get}} call, including wait for {{apt.lock}}, which the {{dpkg}} command was supposed to avoid.  Once {{apt-get}} gets to run, it returns quickly.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)