Skip to content

Make sure to install podman package from repo #2990

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

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

afbjorklund
Copy link
Member

@afbjorklund afbjorklund commented Dec 7, 2024

Newer versions of Fedora come with an older pre-installed Podman,
make sure to install the package from the repository like before.

Closes #2978


Fixes the issue on my machine:

INFO[0019] READY. Run `limactl shell podman` to open the shell. 
INFO[0019] Message from the instance "podman":          
To run `podman` on the host (assumes podman-remote is installed), run the following commands:
------
podman system connection add lima-podman "unix:///home/anders/.lima/podman/sock/podman.sock"
podman system connection default lima-podman
podman --remote run quay.io/podman/hello
------
$ podman.lima version
Client:       Podman Engine
Version:      4.9.3
API Version:  4.9.3
Go Version:   go1.21.7
Git Commit:   8d2b55ddde1bc81f43d018dfc1ac027c06b26a7f
Built:        Fri Feb 16 11:30:23 2024
OS/Arch:      linux/amd64

Server:       Podman Engine
Version:      5.3.1
API Version:  5.3.1
Go Version:   go1.23.3
Built:        Thu Nov 21 01:00:00 2024
OS/Arch:      linux/amd64

It needed --best too, or it would exit:

Package "podman-5:5.2.5-1.fc41.x86_64" is already installed.

@jandubois
Copy link
Member

I thought we could put something in boot.sh to export a LIMA_IS_FIRST_BOOT variable, so templates don't have to implement it themselves, but this is probably good enough for now.

install the package from the repository like before.

What do you mean by "like before"? Did dnf upgrade it before, but now it is broken?

@jandubois
Copy link
Member

I'm not sure if /var/tmp/lima-podman is the right location for this flag; it is not unconceivable that the user wants to clean that directory, and now this would implicitly trigger an update of podman.

I would suggest /etc/lima-podman instead.

@jandubois
Copy link
Member

What do you mean by "like before"? Did dnf upgrade it before, but now it is broken?

Ok, I just realized that the issue is that Fedora comes with podman already installed, which disables our code that used to install the latest version on first boot.

So this PR does restore the old behaviour; the only reason I'm not merging is because I think the sentinel file should be in /etc instead of /var/tmp.

@afbjorklund
Copy link
Member Author

afbjorklund commented Dec 8, 2024

install the package from the repository like before.

What do you mean by "like before"? Did dnf upgrade it before, but now it is broken?

Like with older versions of Fedora, what was I referring to (but that info was only in issue)

The dnf behaviour of not upgrading, had been there already since changing from yum

Originally I used /tmp instead of /var/tmp, but that is also broken because Fedora (tmpfs)

Using /etc is slightly better, but it is not ideal that programs are creating config on their own...

Newer versions of Fedora come with an older pre-installed Podman,
make sure to install the package from the repository like before.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
@@ -43,7 +43,7 @@ provision:
mkdir -p /etc/tmpfiles.d
echo "d /run/podman 0700 {{.User}} -" > /etc/tmpfiles.d/podman.conf
fi
dnf -y install podman
dnf -y install --best podman && touch /etc/lima-podman
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--best is nice, but touch /etc/lima-podman seems controversial

Copy link
Member

@jandubois jandubois Dec 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how using /etc/lima-podman can create any problems. Every service nowadays seems to store their config in there (including apps, e.g. nanorc or screenrc):

$ lima ls /etc | wc -l
     189

But if you don't like it, how about mkdir -p /var/lib/lima then? I don't really care; I was only pointing out that a temp dir that a user may reasonably wipe clean is a poor location for a file that should never be deleted.

Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM.

Not merging myself as there doesn't seem to be consensus about the sentinel location yet.

@jandubois jandubois added this to the v1.0.3 milestone Dec 8, 2024
@AkihiroSuda
Copy link
Member

location

My concern was not about the location.
I'm not sure we really need the /etc/lima-podman or whatever else.
Probably just running dnf install --best podman once is enough for now?

@jandubois
Copy link
Member

Probably just running dnf install --best podman once is enough for now?

That's what this is all about: how do you make sure that we are not running dnf install --best podman again at some random point in the future when the user did not intend to change their podman version?

Before we relied on Fedora not including podman, so we ran the install only when podman was not available via the PATH. This mechanism has been broken since Fedora started shipping with an older version of podman pre-installed.

So we want to upgrade to the latest podman on first-boot, but from then on leave it alone. So we need some kind of marker that says "we already did upgrade podman once". This marker would be the existence of the /etc/lima-podman file or /var/lib/lima directory, as neither of them exist on a pristine Fedora image.

How would you solve the issue of running dnf install --best podman only once?

@nirs
Copy link
Member

nirs commented Dec 9, 2024

What do you mean by "like before"? Did dnf upgrade it before, but now it is broken?

Ok, I just realized that the issue is that Fedora comes with podman already installed, which disables our code that used to install the latest version on first boot.

So old podman is installed by default and dnf install podman installs a newer version?! This sounds like a packaging bug. Do we have a Fedora bug for this?

@jandubois
Copy link
Member

So old podman is installed by default and dnf install podman installs a newer version?! This sounds like a packaging bug.

Unless I misunderstand, this is simply due to the latest Fedora 41 1.4 image being from Oct 24 containing podman 5.2.5 released on Oct 23.

Since then there have been podman releases 5.3.0 (Nov 13) and 5.3.1 (Nov 21) that you can install via dnf. It's not like the bundled version is massively out of date.

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda merged commit 365e7e2 into lima-vm:master Dec 10, 2024
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

limactl start template://podman installs an outdated version
4 participants