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

Installation on ubuntu 18.04 fails #37

Closed
pinkavaj opened this issue Oct 29, 2018 · 10 comments
Closed

Installation on ubuntu 18.04 fails #37

pinkavaj opened this issue Oct 29, 2018 · 10 comments

Comments

@pinkavaj
Copy link

Installation on ubuntu 18.04 fails fails with the following error:

failed: [X.X.X.X] (item=gnupg2) => {"changed": false, "item": "gnupg2", "msg": "No package matching 'gnupg2' is available"}
ok: [X.X.X.X] => (item=cron)
On Ubuntu 18.04 package with gnupg>=2 is named just 'gnupg'

Dependencies can be overriden (thanks for it), but is inconvinient.

@nickjj
Copy link
Owner

nickjj commented Oct 29, 2018

Hi,

That's interesting. It passes the tests for Ubuntu 18.04 on https://travis-ci.org/nickjj/ansible-docker/jobs/446816674 and I've installed this role a lot of times on DigitalOcean using 18.04.

Also, it looks like gnupg2 exists on https://packages.ubuntu.com/bionic/gnupg2.

Have you ran apt-get update on your host at least once? This should be a part of any Ansible bootstrap strategy which is why this role doesn't run apt-get update on its own.

@pinkavaj
Copy link
Author

pinkavaj commented Oct 29, 2018

That did the trick, thanks a lot and sorry for bothering!

@Zauxst
Copy link

Zauxst commented Nov 16, 2018

I'm having the same problem, I am not sure why gnupg2 is not present in the current repolist (even after apt-get update -y)

What I have did before running the play:

  • install the latest Ubuntu18.04 server on 2 virtualbox VMs.
  • install kubeadm, kubectl and kubelet ( like here: kubernetes.io )

If you need anything else from me to help you debug this problem I'll try and provide info.
I'll clone this machine to ensure the current configuration is not lost.

apt-cache search gnupg2; cat /etc/*-release; apt-cache policy
devscripts - scripts to make the life of a Debian Package maintainer easier
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 https://apt.kubernetes.io kubernetes-xenial/main amd64 Packages
     release o=kubernetes-xenial,a=kubernetes-xenial,n=kubernetes-xenial,l=kubernetes-xenial,c=main,b=amd64
     origin apt.kubernetes.io
 500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
     release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=main,b=amd64
     origin archive.ubuntu.com
 500 https://download.docker.com/linux/ubuntu bionic/edge amd64 Packages
     release o=Docker,a=bionic,l=Docker CE,c=edge,b=amd64
     origin download.docker.com
 500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     release o=Docker,a=bionic,l=Docker CE,c=stable,b=amd64
     origin download.docker.com
 500 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages
     release v=18.04,o=Ubuntu,a=bionic-security,n=bionic,l=Ubuntu,c=main,b=amd64
     origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
     release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=main,b=amd64
     origin archive.ubuntu.com
Pinned packages:

@nickjj
Copy link
Owner

nickjj commented Nov 17, 2018

@Zauxst I think I narrowed down the problem.

If you run cat /etc/apt/sources.list do all of your URLs end with main?

If so, edit that file so the first one ends with main universe and then run sudo apt-get update.

I think the problem is your installation of Ubuntu didn't configure the apt source lists to allow community packages to be installed and gnupg2 and others fall into that category.

Doing that really isn't a responsibility of this role. It should be done when you bootstrap your server or configure apt IMO.

@Zauxst
Copy link

Zauxst commented Nov 18, 2018

@nickjj yes indeed, adding universe solved the problem. Thanks a lot for taking the time.

I'm not going to go into a philosophical debate about it, this is my 2cent of this topic:
If a role requires a package to finish running, that is not in main (in our case it was Universe) it should ensure the package is ready to be downloaded, or at least mention it in the script requirements.

Besides... Ubuntu=16.04 and 18.04 doesn't require gnupg2 according to the official installation. Only the Debian install does.

before:

cat /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

after gnupg2 was found.

apt-cache search gnupg2
devscripts - scripts to make the life of a Debian Package maintainer easier
gnupg2 - GNU privacy guard - a free PGP replacement (dummy transitional package)

@nickjj
Copy link
Owner

nickjj commented Nov 18, 2018

Yep, but in this case, adding it for Ubuntu doesn't do any harm and while it's possible to split it up, it drastically complicates the role (both at configuration and implementation levels).

My philosophy is determining whether or not to use universe, backports, etc. is a system level decision that should be configured once with an apt or similar role.

Having this role start to modify apt source lists to make a system level decision as important as that one doesn't seem reasonable IMO.

But, having it as part of the documentation makes sense. It's just most cloud providers have universe enabled by default, so I didn't even think to add that. I only figured it out because I ended up setting up a stock Ubuntu server (which only allows main) recently and ran into the problem first hand.

@mjeffin
Copy link

mjeffin commented Feb 19, 2019

Hi nick, thanks for sharing the role. It has been quite useful. I also encountered the issue on a newly provisioned aws bionic server and running the apt-update step fixed the issue. will add the it as the first step in all my future ansible playbook.
thanks.

@nickjj
Copy link
Owner

nickjj commented Feb 19, 2019

Hi, yeah it's expected you run an apt-get update when bootstrapping a server. Otherwise you wind up in a situation explained in my previous reply.

@Nume
Copy link

Nume commented Jul 18, 2019

Ran into the same issue on a stock ubuntu 18.04 (which doesn't add universe per default).
Solved it by adding

- name: Add universe repository for bionic
  apt_repository: 
    repo: deb http://archive.ubuntu.com/ubuntu bionic universe
    state: present
  when: ansible_distribution_release == 'bionic'

in pre_tasks of my playbook

@nickjj
Copy link
Owner

nickjj commented Jul 18, 2019

Yep, that's standard. You may want to also consider offloading that task to a designated apt / bootstrap role since it's very much system dependent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants