Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue installing Debian packages #869

Closed
alajmo opened this issue Jan 28, 2020 · 1 comment · Fixed by #911
Closed

Issue installing Debian packages #869

alajmo opened this issue Jan 28, 2020 · 1 comment · Fixed by #911
Assignees
Labels

Comments

@alajmo
Copy link
Contributor

alajmo commented Jan 28, 2020

Several packages are no installed when you attempt to install packages from the requirements.txt file.

08:10:19 INFO cli.engine.ansible.AnsibleCommand - TASK [common : Install debian family packages] **************************************************************************
08:10:19 INFO cli.engine.ansible.AnsibleCommand - fatal: [avt]: FAILED! => {"cache_update_time": 1579507811, "cache_updated": false, "changed": false, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"      install 'netcat' 'curl' 'tmux' 'fping' 'iftop' 'htop' 'sshpass' 'vim' 'sysstat' 'python-setuptools' 'a
pt-transport-https' 'software-properties-common' 'ebtables' 'ethtool' 'jq'' failed: E: Unable to correct problems, you have held broken packages.\n", "rc": 100, "stderr": "E: Unable to correct problems, you have held broken packages.\n", "stderr_lines": ["E: Unable to correct problems, you have held broken packages."], "stdout": "Reading package lists...\nBuildin
g dependency tree...\nReading state information...\nSome packages could not be installed. This may mean that you have\nrequested an impossible situation or if you are using the unstable\ndistribution that some required packages have not yet been created\nor been moved out of Incoming.\nThe following information may help to resolve the situation:\n\nThe following
packages have unmet dependencies:\n curl : Depends: libcurl4 (= 7.58.0-2ubuntu3.8) but it is not going to be installed\n vim : Depends: libpython3.6 (>= 3.6.5) but it is not going to be installed\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "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:", " curl : Depends: libcurl4 (= 7.58.0-2ubuntu3.8) but it is n
ot going to be installed", " vim : Depends: libpython3.6 (>= 3.6.5) but it is not going to be installed"]}

I found the function deplist_cmd in data/common/ansible/playbooks/roles/repository/files/download-requirements/ubuntu-18.04/download-requirements.sh which is responsible for fetching dependencies.

# to download everything add "--recurse" here:
deplist_cmd() {
    apt-cache depends --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances --no-pre-depends $1
}

After adding --recurse, then it got the full list of dependencies and I got it working. Any reason why --recurse option is not set?

@to-bar
Copy link
Contributor

to-bar commented Feb 12, 2020

@samiralajmovic for now we download only direct dependencies of packages listed in requirements.txt by purpose, to limit their number. However, we are aware that such approach has drawbacks and may cause issues like this one, so we would like to use the --recurse option but we need to test it first on different environments and probably clean up/adjust requirements.txt as well.
For now, I've added two packages to the requirements.txt to fix this issue (see #911).

Here is short analysis performed on AWS VM (ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20190212.1):

## --- Without the --recurse flag ---
time /tmp/epi-download-requirements/download-requirements.sh /var/www/html/epirepo
real    3m31.501s

Fetched 319 packages, 1230 MB in 22s (55.4 MB/s)

du -m /var/www/html/epirepo/packages/
1174

# --- After adding the '--recurse' flag ---

time /tmp/epi-download-requirements/download-requirements.sh /var/www/html/epirepo
real    3m33.503s

Fetched 596 packages, 1366 MB in 23s (59.5 MB/s)

du -m /var/www/html/epirepo/packages/
1304

diff in size = 130 MB
diff in number = 277 packages

@to-bar to-bar self-assigned this Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants