alvistack / ansible-role-podman

Ansible Role for Podman Installation
Apache License 2.0
57 stars 6 forks source link

install fails if Debian official podman packages already installed #7

Closed hmoffatt closed 1 year ago

hmoffatt commented 2 years ago

I have podman 3.0.1 installed from the Debian bullseye repository. When I try to install the latest using the Ansible role, it fails because the packages don't properly conflict with the Debian ones.

I guess this is a problem with the packages rather than the ansible role, but I am not sure where to report an issue with that.

TASK [alvistack.podman : apt-get install] **********************************************************************************************************************************************
changed: [vm-dbx] => (item={'state': 'latest', 'name': 'containernetworking-dnsname'})
changed: [vm-dbx] => (item={'state': 'latest', 'name': 'containernetworking-plugins'})
changed: [vm-dbx] => (item={'state': 'latest', 'name': 'containernetworking-podman-machine'})
FAILED - RETRYING: [vm-dbx]: apt-get install (3 retries left).
FAILED - RETRYING: [vm-dbx]: apt-get install (2 retries left).
FAILED - RETRYING: [vm-dbx]: apt-get install (1 retries left).
failed: [vm-dbx] (item={'state': 'latest', 'name': 'podman'}) => {"ansible_loop_var": "item", "attempts": 3, "cache_update_time": 1657072636, "cache_updated": false, "changed": false, "item": {"name": "podman", "state": "latest"}, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"       install 'podman=100:4.1.1-1'' failed: E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).\n", "rc": 100, "stderr": "E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).\n", "stderr_lines": ["E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution)."], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\npodman is already the newest version (100:4.1.1-1).\nYou might want to run 'apt --fix-broken install' to correct these.\nThe following packages have unmet dependencies:\n podman : Depends: containers-common but it is not going to be installed\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "podman is already the newest version (100:4.1.1-1).", "You might want to run 'apt --fix-broken install' to correct these.", "The following packages have unmet dependencies:", " podman : Depends: containers-common but it is not going to be installed"]}
FAILED - RETRYING: [vm-dbx]: apt-get install (3 retries left).
FAILED - RETRYING: [vm-dbx]: apt-get install (2 retries left).
FAILED - RETRYING: [vm-dbx]: apt-get install (1 retries left).
failed: [vm-dbx] (item={'state': 'latest', 'name': 'podman-aardvark-dns'}) => {"ansible_loop_var": "item", "attempts": 3, "cache_update_time": 1657072636, "cache_updated": false, "changed": false, "item": {"name": "podman-aardvark-dns", "state": "latest"}, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"       install 'podman-aardvark-dns=100:1.0.3-1'' failed: E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).\n", "rc": 100, "stderr": "E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).\n", "stderr_lines": ["E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution)."], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nYou might want to run 'apt --fix-broken install' to correct these.\nThe following packages have unmet dependencies:\n podman : Depends: containers-common but it is not going to be installed\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "You might want to run 'apt --fix-broken install' to correct these.", "The following packages have unmet dependencies:", " podman : Depends: containers-common but it is not going to be installed"]}
FAILED - RETRYING: [vm-dbx]: apt-get install (3 retries left).
FAILED - RETRYING: [vm-dbx]: apt-get install (2 retries left).
FAILED - RETRYING: [vm-dbx]: apt-get install (1 retries left).
failed: [vm-dbx] (item={'state': 'latest', 'name': 'podman-docker'}) => {"ansible_loop_var": "item", "attempts": 3, "cache_update_time": 1657072636, "cache_updated": false, "changed": false, "item": {"name": "podman-docker", "state": "latest"}, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"       install 'podman-docker=100:4.1.1-1'' failed: E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).\n", "rc": 100, "stderr": "E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).\n", "stderr_lines": ["E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution)."], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nYou might want to run 'apt --fix-broken install' to correct these.\nThe following packages have unmet dependencies:\n podman : Depends: containers-common but it is not going to be installed\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "You might want to run 'apt --fix-broken install' to correct these.", "The following packages have unmet dependencies:", " podman : Depends: containers-common but it is not going to be installed"]}
ok: [vm-dbx] => (item={'state': 'latest', 'name': 'podman-gvproxy'})

I tried to check it out by hand:

vagrant@bullseye:~$ sudo apt install podman
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
podman is already the newest version (100:4.1.1-1).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 podman : Depends: containers-common but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
vagrant@bullseye:~$ sudo apt install podman -f
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
podman is already the newest version (100:4.1.1-1).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 podman : Depends: containers-common but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
vagrant@bullseye:~$ apt-cache policy containers-common
containers-common:
  Installed: (none)
  Candidate: 100:0.48.0-1
  Version table:
     100:0.48.0-1 500
        500 http://downloadcontent.opensuse.org/repositories/home:/alvistack/Debian_11  Packages
     100:0.47.5-1 500
        500 http://downloadcontent.opensuse.org/repositories/home:/alvistack/Debian_11  Packages
     100:0.47.4-1 500
        500 http://downloadcontent.opensuse.org/repositories/home:/alvistack/Debian_11  Packages
     100:0.47.3-1 500
        500 http://downloadcontent.opensuse.org/repositories/home:/alvistack/Debian_11  Packages
vagrant@bullseye:~$ sudo apt install containers-common
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  buildah dconf-gsettings-backend dconf-service fuse-overlayfs glib-networking glib-networking-common glib-networking-services golang-github-containernetworking-plugin-dnsname
  golang-github-containers-common golang-github-containers-image gsettings-desktop-schemas libarchive13 libavahi-client3 libavahi-common-data libavahi-common3 libavahi-glib1
  libdconf1 libgpgme11 libostree-1-1 libproxy1v5 libslirp0 libsoup2.4-1 slirp4netns uidmap
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  containers-common
0 upgraded, 1 newly installed, 0 to remove and 30 not upgraded.
2 not fully installed or removed.
Need to get 0 B/12.1 kB of archives.
After this operation, 65.5 kB of additional disk space will be used.
(Reading database ... 32662 files and directories currently installed.)
Preparing to unpack .../containers-common_100%3a0.48.0-1_amd64.deb ...
Unpacking containers-common (100:0.48.0-1) ...
dpkg: error processing archive /var/cache/apt/archives/containers-common_100%3a0.48.0-1_amd64.deb (--unpack):
 trying to overwrite '/etc/containers/policy.json', which is also in package golang-github-containers-common 0.33.4+ds1-1+deb11u1
Errors were encountered while processing:
 /var/cache/apt/archives/containers-common_100%3a0.48.0-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
hmoffatt commented 2 years ago

Ah the policy.json conflict also occurs with the kubic repository. It also conflicts on registries.conf in another package.

hswong3i commented 2 years ago

I guess this is a problem with the packages rather than the ansible role, but I am not sure where to report an issue with that.

You could report packaging related here, because both packaging with OBS (https://build.opensuse.org/project/show/home:alvistack) and its Ansible Role (https://github.com/alvistack) are highly related.

The reason of conflict due to my greedy package versioning with Epoch = 100, which means you should accept ALL of my package dependency or reject ALL, you couldn't make it in hybrid mode and mixing them together.

BTW, my OBS repo already package ALL required dependencies, e.g. podman > containers-common / containers-storage > conmon > crun > etc. Due to each OS always coming with different package naming, I give an unified naming for my packages across all of my supported OS. This also happened for which config files should belong to which packaging and more and more conflict generated if working in hybrid mode...

Long story short: this is a feature, not a bug; AlviStack is a greedy 3rd party solution, but not an official downstream OS subproject with 100% compatibility; AlviStack always with dirty workaround, e.g. skipping test and doc during packaging, but always keep tracing upstream components update and report bug as much as possible.

hmoffatt commented 2 years ago

I don't expect to mix and max your packages with Debian, but it would be nice if there was an upgrade path from the official Debian packages. At first glance you would just need Conflicts (maybe Confilcts+Replaces) with golang-github-containers-common and golang-github-containers-images, although more issues might show up once those are resolved.

hswong3i commented 2 years ago

By design Epoch with 100 should already enough for fresh system to choose our greedy package dependency, which also checked with this Ansible Role GitLab CI Molecule test cases.

At least with my current limited man power, I have no plan for adding this additional constraints into my packaging script. But PR is welcome 🙏

hmoffatt commented 2 years ago

Which repo has the packaging?

hswong3i commented 2 years ago

I build the packages with my Ubuntu 22.04 laptop as above GIT commit message, then using Open Build Service ‘osc build’ command to test multi OS build, and finally push to OBS with ‘osc commit’ and wait for it build.