实验环境:centos7.7.1908
1.安装podman并查看版本
$ yum install podman -y
$ podman -v
[root@d7cb4574cd89 /]# podman -v
podman version 1.6.4
centos7默认安装的podman版本是1.6.4,现在我们要把podman升级到最新版。
2.删除现有podman
$ yum remove -y podman
3. 添加EPEL存储库
添加用于安装开发工具的EPEL(Extra Packages for Enterprise Linux)存储库。
$ yum install -y epel-release
or
$ yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
4.安装所需的软件包
$ yum install -y "@Development Tools"
$ yum install -y curl gcc make device-mapper-devel git btrfs-progs-devel \
conmon containernetworking-plugins containers-common glib2-devel glibc-devel \
glibc-static golang-github-cpuguy83-md2man iptables libselinux-devel pkgconfig \
systemd-devel autoconf python3 python3-devel python3-pip yajl-devel libcap-devel
5.GoLang配置
$ cd /usr/local/src
$ curl -LO "https://go.dev/dl/go1.20.3.linux-amd64.tar.gz"
$ tar xzvf go1.20.3.linux-amd64.tar.gz -C /usr/local/
$ mkdir /usr/local/gopath
5.1设置Profile变量
$ vi /etc/profile
# GoLang
export GO_HOME=/usr/local/go
export GOPATH=/usr/local/gopath
export PATH=$PATH:$GO_HOME/bin
$ source /etc/profile
6.安装conmon&runc
6.1.安装conmon
$ git clone https://github.com/containers/conmon.git /usr/local/src/conmon
$ cd /usr/local/src/conmon
$ export GOCACHE="$(mktemp -d)"
$ make -j $(nproc)
$ make install
6.2.安装runc
$ git clone https://github.com/opencontainers/runc.git $GOPATH/src/github.com/opencontainers/runc
$ cd $GOPATH/src/github.com/opencontainers/runc
$ make -j $(nproc) BUILDTAGS="selinux seccomp"
$ cp runc /usr/bin/runc
执行make -j $(nproc) BUILDTAGS="selinux seccomp"有以下报错
执行yum install libseccomp-devel,然后重新make -j $(nproc) BUILDTAGS="selinux seccomp"
问题解决! 然后cp runc /usr/bin/runc,最后查看版本runc -version
7.编译库
为了编译Podman,需要下面列出的库。
Libgpg-error, Libassuan, nPth, Libgcrypt, Libksba, ntbTLS, GnuPG, GPGME
https://gnupg.org/download/index.html
虽然CentOS支持该库包,但版本较低,无法编译最新版本的Podman。
因此,需要将库编译为源代码后单独指定。
7.1 安装Libgpg-error
$ cd /usr/local/src
$ curl -LO "https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.47.tar.bz2"
$ tar xjvf libgpg-error-1.47.tar.bz2
$ cd libgpg-error-1.47
$ ./configure --prefix=/usr/local/libgpg-error
$ make -j $(nproc)
$ make install
7.2 安装Libassuan
必须将configure的gpg-error-config更改为gpgrt-config。
$ cd /usr/local/src
$ curl -LO "https://gnupg.org/ftp/gcrypt/libassuan/libassuan-2.5.5.tar.bz2"
$ tar xjvf libassuan-2.5.5.tar.bz2
$ cd libassuan-2.5.5
$ sed -i 's/gpg-error-config/gpgrt-config/g' configure
$ ./configure --prefix=/usr/local/libassuan \
--with-libgpg-error-prefix=/usr/local/libgpg-error
$ make -j $(nproc)
$ make install
7.3 安装nPth
$ cd /usr/local/src
$ curl -LO "https://gnupg.org/ftp/gcrypt/npth/npth-1.6.tar.bz2"
$ tar xjvf npth-1.6.tar.bz2
$ cd npth-1.6
$ ./configure --prefix=/usr/local/npth
$ make -j $(nproc)
$ make install
7.4 安装Libgcrypt
$ cd /usr/local/src
$ curl -LO "https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.10.2.tar.bz2"
$ tar xjvf libgcrypt-1.10.2.tar.bz2
$ cd libgcrypt-1.10.2
$ ./configure --prefix=/usr/local/libgcrypt \
--with-libgpg-error-prefix=/usr/local/libgpg-error
$ make -j $(nproc)
$ make install
在进行7.4的 ./configure之前先把7.10配置完成
配置完后执行 ./configure --prefix=/usr/local/libgcrypt --with-libgpg-error-prefix=/usr/local/libgpg-error如果出现如下问题
$
export PATH=$LIBGPG_ERROR_HOME/bin:$PATH
$ which gpg-error
执行完上面代码后重新执行 ./configure,就可以执行成功,生成makefile文件
之后继续执行 make -j $(nproc) 和 make install 就可以了
7.5 安装Libksba
$ cd /usr/local/src
$ curl -LO "https://gnupg.org/ftp/gcrypt/libksba/libksba-1.6.3.tar.bz2"
$ tar xjvf libksba-1.6.3.tar.bz2
$ cd libksba-1.6.3
$ ./configure --prefix=/usr/local/libksba \
--with-libgpg-error-prefix=/usr/local/libgpg-error
$ make -j $(nproc)
$ make install
7.6 安装ntbTLS
必须将configure中的–with-libksba-prefix更改为–with-ksba-prefix。
$ cd /usr/local/src
$ curl -LO "https://gnupg.org/ftp/gcrypt/ntbtls/ntbtls-0.3.1.tar.bz2"
$ tar xjvf ntbtls-0.3.1.tar.bz2
$ cd ntbtls-0.3.1
$ ./configure --prefix=/usr/local/ntbtls \
--with-ksba-prefix=/usr/local/libksba \
--with-libgcrypt-prefix=/usr/local/libgcrypt \
--with-libgpg-error-prefix=/usr/local/libgpg-error
$ make -j $(nproc)
$ make install
执行 make -j $(nproc) 会有如下错误
执行 yum install zlib-devel 后重新执行 make -j $(nproc) 即可
7.7 安装GnuPG
必须将configure中的–with-libksba-prefix更改为–with-ksba-prefix。
$ cd /usr/local/src
$ curl -LO "https://gnupg.org/ftp/gcrypt/gnupg/gnupg-2.4.0.tar.bz2"
$ tar xjvf gnupg-2.4.0.tar.bz2
$ cd gnupg-2.4.0
$ ./configure --prefix=/usr/local/gnupg \
--without-libintl-prefix \
--without-libiconv-prefix \
--with-npth-prefix=/usr/local/npth \
--with-ntbtls-prefix=/usr/local/ntbtls \
--with-ksba-prefix=/usr/local/libksba \
--with-libgcrypt-prefix=/usr/local/libgcrypt \
--with-libassuan-prefix=/usr/local/libassuan \
--with-libgpg-error-prefix=/usr/local/libgpg-error
$ make -j $(nproc)
$ make install
7.8 安装GPGME
$ cd /usr/local/src
$ curl -LO "https://gnupg.org/ftp/gcrypt/gpgme/gpgme-1.20.0.tar.bz2"
$ tar xjvf gpgme-1.20.0.tar.bz2
$ cd gpgme-1.20.0
$ ./configure --prefix=/usr/local/gpgme \
--with-libassuan-prefix=/usr/local/libassuan \
--with-libgpg-error-prefix=/usr/local/libgpg-error
$ make -j $(nproc)
$ make install
执行7.8./configure之前要先执行完7.9,之后再执行7.8 ./configure
执行 make -j $(nproc) 会有如下报错
$ cd /usr/local/src/gpgme-1.20.0/tests/gpg/
$ vi gpg.conf
$ comment 第5行
回到 /usr/local/src/gpgme-1.20.0目录下重新执行make -j $(nproc)
export LD_LIBRARY_PATH=/usr/local/libksba/lib:/usr/local/libgcrypt/lib:/usr/local/npth/lib:/usr/local/libgpg-error/lib
env | grep LD_LIBRARY_PATH
缺哪个export哪个,应该是4个都缺,所以要export4个
之后重新执行 make -j $(nproc),会有如下报错
上面错误是因为版本太低导致很多奇怪的编译错误,我们要升级gcc的版本才可以,然后重新执行make -j $(nproc)
到此还没有找到好的解决办法
7.9 设置PKGCONFIG
$ mkdir /usr/local/pkgconfig
$ cd /usr/local/pkgconfig
$ ln -s /usr/local/gpgme/lib/pkgconfig/* ./
$ ln -s /usr/local/ntbtls/lib/pkgconfig/* ./
$ ln -s /usr/local/libksba/lib/pkgconfig/* ./
$ ln -s /usr/local/libgcrypt/lib/pkgconfig/* ./
$ ln -s /usr/local/libassuan/lib/pkgconfig/* ./
$ ln -s /usr/local/libgpg-error/lib/pkgconfig/* ./
7.10 Profile变量设置
$ vi /etc/profile
# PKGCONFIG
export PKG_CONFIG_PATH=/usr/local/pkgconfig
# Libgpg-error
# Libgpg-error
export LIBGPG_ERROR_HOME=/usr/local/libgpg-error
export PATH=$PATH:$LIBGPG_ERROR_HOME/bin
# Libassuan
export LIBASSUAN_HOME=/usr/local/libassuan
export PATH=$PATH:$LIBASSUAN_HOME/bin
# nPth
export NPTH_HOME=/usr/local/npth
export PATH=$PATH:$NPTH_HOME/bin
# Libgcrypt
export LIBGCRYPT_HOME=/usr/local/libgcrypt
export PATH=$PATH:$LIBGCRYPT_HOME/bin
# Libksba
export LIBKSBA_HOME=/usr/local/libksba
export PATH=$PATH:$LIBKSBA_HOME/bin
# ntbTLS
export NTBTLS_HOME=/usr/local/ntbtls
export PATH=$PATH:$NTBTLS_HOME/bin
# GnuPG
export GNUPG_HOME=/usr/local/gnupg
export PATH=$PATH:$GNUPG_HOME/bin
# GPGME
export GPGME_HOME=/usr/local/gpgme
export PATH=$PATH:$GPGME_HOME/bin
$ source /etc/profile
8 Podman安装
$ cd /usr/local/src
$ PODMAN_VER_TAG="v4.6.1"
$ wget https://github.com/containers/podman/archive/refs/tags/${PODMAN_VER_TAG}.tar.gz
$ tar xzvf ${PODMAN_VER_TAG}.tar.gz
$ cd ${PODMAN_VER_TAG}
$ make -j $(nproc) BUILDTAGS="selinux seccomp"
$ make install PREFIX=/usr
cd /usr/local/src
PODMAN_VER_TAG="v4.6.1"
wget https://github.com/containers/podman/archive/refs/tags/v4.6.1.tar.gz
tar xzvf v4.6.1.tar.gz
cd podman-4.6.1
make -j $(nproc) BUILDTAGS="selinux seccomp"
make install PREFIX=/usr
如果执行wget https://github.com/containers/podman/archive/refs/tags/v4.6.1.tar.gz,github连接不上可以通过wget https://kgithub.com/containers/podman/archive/refs/tags/v4.6.1.tar.gz下载,但是我试了一下从镜像中下载的好像不行,所以尽量还是从github下载
[root@9f7fa3629178 podman-4.6.1]# make -j $(nproc) BUILDTAGS="selinux seccomp"
fatal: Not a git repository (or any of the parent directories): .git
Podman is being compiled without the systemd build tag. Install libsystemd on Ubuntu or systemd-devel on rpm based distro for journald support.
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \
\
-ldflags ' -X github.com/containers/podman/v4/libpod/define.buildInfo=1694420421 -X github.com/containers/podman/v4/libpod/config._installPrefix=/usr/local -X github.com/containers/podman/v4/libpod/config._etcDir=/etc -X github.com/containers/podman/v4/pkg/systemd/quadlet._binDir=/usr/local/bin -X github.com/containers/common/pkg/config.additionalHelperBinariesDir= ' \
-tags "selinux seccomp" \
-o bin/podman ./cmd/podman
mkdir -p bin
CGO_ENABLED=1 \
go build \
\
-o bin/rootlessport ./cmd/rootlessport
fatal: Not a git repository (or any of the parent directories): .git
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \
\
-ldflags ' -X github.com/containers/podman/v4/libpod/define.buildInfo=1694420421 -X github.com/containers/podman/v4/libpod/config._installPrefix=/usr/local -X github.com/containers/podman/v4/libpod/config._etcDir=/etc -X github.com/containers/podman/v4/pkg/systemd/quadlet._binDir=/usr/local/bin -X github.com/containers/common/pkg/config.additionalHelperBinariesDir= ' \
-tags "selinux seccomp" \
-o bin/quadlet ./cmd/quadlet
hack/markdown-preprocess
if [ ! -x "/bin/go-md2man" ]; then \
make -C test/tools build/go-md2man ; \
fi
mkdir -p docs/build/man
hack/markdown-preprocess
hack/markdown-preprocess
fatal: Not a git repository (or any of the parent directories): .git
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \
\
-ldflags ' -X github.com/containers/podman/v4/libpod/define.buildInfo=1694420440 -X github.com/containers/podman/v4/libpod/config._installPrefix=/usr/local -X github.com/containers/podman/v4/libpod/config._etcDir=/etc -X github.com/containers/podman/v4/pkg/systemd/quadlet._binDir=/usr/local/bin -X github.com/containers/common/pkg/config.additionalHelperBinariesDir= ' \
-tags "remote exclude_graphdriver_btrfs btrfs_noversion exclude_graphdriver_devicemapper containers_image_openpgp" \
-o bin/podman-remote ./cmd/podman
if [ ! -f bin/podmansh ]; then ln -s podman bin/podmansh; fi
[root@9f7fa3629178 podman-4.6.1]# make install PREFIX=/usr
install -d -m 755 /usr/bin
install -m 755 bin/podman /usr/bin/podman
ln -sf podman /usr/bin/podmansh
test -z "" || chcon --verbose --reference=/usr/bin/podman bin/podman
install -d -m 755 /usr/libexec/podman
install -m 755 bin/rootlessport /usr/libexec/podman/rootlessport
test -z "" || chcon --verbose --reference=/usr/libexec/podman/rootlessport bin/rootlessport
install -m 755 bin/quadlet /usr/libexec/podman/quadlet
install -d -m 755 /usr/lib/systemd/system-generators
ln -sfr /usr/libexec/podman/quadlet /usr/lib/systemd/system-generators/podman-system-generator
install -d -m 755 /usr/lib/systemd/user-generators
ln -sfr /usr/libexec/podman/quadlet /usr/lib/systemd/user-generators/podman-user-generator
install -m 755 -d /usr/lib/tmpfiles.d
install -m 644 contrib/tmpfile/podman.conf /usr/lib/tmpfiles.d/podman.conf
install -d -m 755 /usr/bin
install -m 755 bin/podman-remote \
/usr/bin/podman-remote
test "linux" != "windows" || \
install -m 755 bin/win-sshproxy.exe /usr/bin
test "linux" != "windows" || \
install -m 755 bin/gvproxy.exe /usr/bin
test "linux" != "darwin" || \
install -m 755 bin/podman-mac-helper /usr/bin
test -z "" || \
chcon --verbose --reference=/usr/bin/podman-remote \
bin/podman-remote
install -d -m 755 /usr/share/man/man1
install -d -m 755 /usr/share/man/man5
install -m 644 docs/build/man/podman-attach.1 docs/build/man/podman-auto-update.1 docs/build/man/podman-build.1 docs/build/man/podman-commit.1 docs/build/man/podman-completion.1 docs/build/man/podman-container-checkpoint.1 docs/build/man/podman-container-cleanup.1 docs/build/man/podman-container-clone.1 docs/build/man/podman-container-diff.1 docs/build/man/podman-container-exists.1 docs/build/man/podman-container-inspect.1 docs/build/man/podman-container-prune.1 docs/build/man/podman-container-restore.1 docs/build/man/podman-container-runlabel.1 docs/build/man/podman-container.1 docs/build/man/podman-cp.1 docs/build/man/podman-create.1 docs/build/man/podman-diff.1 docs/build/man/podman-events.1 docs/build/man/podman-exec.1 docs/build/man/podman-export.1 docs/build/man/podman-generate-spec.1 docs/build/man/podman-generate-systemd.1 docs/build/man/podman-generate.1 docs/build/man/podman-healthcheck-run.1 docs/build/man/podman-healthcheck.1 docs/build/man/podman-history.1 docs/build/man/podman-image-diff.1 docs/build/man/podman-image-exists.1 docs/build/man/podman-image-inspect.1 docs/build/man/podman-image-mount.1 docs/build/man/podman-image-prune.1 docs/build/man/podman-image-scp.1 docs/build/man/podman-image-sign.1 docs/build/man/podman-image-tree.1 docs/build/man/podman-image-trust.1 docs/build/man/podman-image-unmount.1 docs/build/man/podman-image.1 docs/build/man/podman-images.1 docs/build/man/podman-import.1 docs/build/man/podman-info.1 docs/build/man/podman-init.1 docs/build/man/podman-inspect.1 docs/build/man/podman-kill.1 docs/build/man/podman-kube-apply.1 docs/build/man/podman-kube-down.1 docs/build/man/podman-kube-generate.1 docs/build/man/podman-kube-play.1 docs/build/man/podman-kube.1 docs/build/man/podman-load.1 docs/build/man/podman-login.1 docs/build/man/podman-logout.1 docs/build/man/podman-logs.1 docs/build/man/podman-machine-info.1 docs/build/man/podman-machine-init.1 docs/build/man/podman-machine-inspect.1 docs/build/man/podman-machine-list.1 docs/build/man/podman-machine-os-apply.1 docs/build/man/podman-machine-os.1 docs/build/man/podman-machine-rm.1 docs/build/man/podman-machine-set.1 docs/build/man/podman-machine-ssh.1 docs/build/man/podman-machine-start.1 docs/build/man/podman-machine-stop.1 docs/build/man/podman-machine.1 docs/build/man/podman-manifest-add.1 docs/build/man/podman-manifest-annotate.1 docs/build/man/podman-manifest-create.1 docs/build/man/podman-manifest-exists.1 docs/build/man/podman-manifest-inspect.1 docs/build/man/podman-manifest-push.1 docs/build/man/podman-manifest-remove.1 docs/build/man/podman-manifest-rm.1 docs/build/man/podman-manifest.1 docs/build/man/podman-mount.1 docs/build/man/podman-network-connect.1 docs/build/man/podman-network-create.1 docs/build/man/podman-network-disconnect.1 docs/build/man/podman-network-exists.1 docs/build/man/podman-network-inspect.1 docs/build/man/podman-network-ls.1 docs/build/man/podman-network-prune.1 docs/build/man/podman-network-reload.1 docs/build/man/podman-network-rm.1 docs/build/man/podman-network-update.1 docs/build/man/podman-network.1 docs/build/man/podman-pause.1 docs/build/man/podman-pod-clone.1 docs/build/man/podman-pod-create.1 docs/build/man/podman-pod-exists.1 docs/build/man/podman-pod-inspect.1 docs/build/man/podman-pod-kill.1 docs/build/man/podman-pod-logs.1 docs/build/man/podman-pod-pause.1 docs/build/man/podman-pod-prune.1 docs/build/man/podman-pod-ps.1 docs/build/man/podman-pod-restart.1 docs/build/man/podman-pod-rm.1 docs/build/man/podman-pod-start.1 docs/build/man/podman-pod-stats.1 docs/build/man/podman-pod-stop.1 docs/build/man/podman-pod-top.1 docs/build/man/podman-pod-unpause.1 docs/build/man/podman-pod.1 docs/build/man/podman-port.1 docs/build/man/podman-ps.1 docs/build/man/podman-pull.1 docs/build/man/podman-push.1 docs/build/man/podman-remote.1 docs/build/man/podman-rename.1 docs/build/man/podman-restart.1 docs/build/man/podman-rm.1 docs/build/man/podman-rmi.1 docs/build/man/podman-run.1 docs/build/man/podman-save.1 docs/build/man/podman-search.1 docs/build/man/podman-secret-create.1 docs/build/man/podman-secret-exists.1 docs/build/man/podman-secret-inspect.1 docs/build/man/podman-secret-ls.1 docs/build/man/podman-secret-rm.1 docs/build/man/podman-secret.1 docs/build/man/podman-start.1 docs/build/man/podman-stats.1 docs/build/man/podman-stop.1 docs/build/man/podman-system-connection-add.1 docs/build/man/podman-system-connection-default.1 docs/build/man/podman-system-connection-list.1 docs/build/man/podman-system-connection-remove.1 docs/build/man/podman-system-connection-rename.1 docs/build/man/podman-system-connection.1 docs/build/man/podman-system-df.1 docs/build/man/podman-system-migrate.1 docs/build/man/podman-system-prune.1 docs/build/man/podman-system-renumber.1 docs/build/man/podman-system-reset.1 docs/build/man/podman-system-service.1 docs/build/man/podman-system.1 docs/build/man/podman-tag.1 docs/build/man/podman-top.1 docs/build/man/podman-unmount.1 docs/build/man/podman-unpause.1 docs/build/man/podman-unshare.1 docs/build/man/podman-untag.1 docs/build/man/podman-update.1 docs/build/man/podman-version.1 docs/build/man/podman-volume-create.1 docs/build/man/podman-volume-exists.1 docs/build/man/podman-volume-export.1 docs/build/man/podman-volume-import.1 docs/build/man/podman-volume-inspect.1 docs/build/man/podman-volume-ls.1 docs/build/man/podman-volume-mount.1 docs/build/man/podman-volume-prune.1 docs/build/man/podman-volume-reload.1 docs/build/man/podman-volume-rm.1 docs/build/man/podman-volume-unmount.1 docs/build/man/podman-volume.1 docs/build/man/podman-wait.1 docs/build/man/podman.1 docs/build/man/podmansh.1 /usr/share/man/man1
install -m 644 docs/source/markdown/links/*1 /usr/share/man/man1
install -m 644 docs/build/man/podman-systemd.unit.5 /usr/share/man/man5
install -m 644 docs/source/markdown/links/*5 /usr/share/man/man5
sed -e 's;@@PODMAN@@;/usr/bin/podman;g' contrib/systemd/auto-update/podman-auto-update.service.in >contrib/systemd/auto-update/podman-auto-update.service.tmp.$ \
&& mv -f contrib/systemd/auto-update/podman-auto-update.service.tmp.$ contrib/systemd/auto-update/podman-auto-update.service
sed -e 's;@@PODMAN@@;/usr/bin/podman;g' contrib/systemd/system/podman.service.in >contrib/systemd/system/podman.service.tmp.$ \
&& mv -f contrib/systemd/system/podman.service.tmp.$ contrib/systemd/system/podman.service
sed -e 's;@@PODMAN@@;/usr/bin/podman;g' contrib/systemd/system/podman-restart.service.in >contrib/systemd/system/podman-restart.service.tmp.$ \
&& mv -f contrib/systemd/system/podman-restart.service.tmp.$ contrib/systemd/system/podman-restart.service
sed -e 's;@@PODMAN@@;/usr/bin/podman;g' contrib/systemd/system/podman-kube@.service.in >contrib/systemd/system/podman-kube@.service.tmp.$ \
&& mv -f contrib/systemd/system/podman-kube@.service.tmp.$ contrib/systemd/system/podman-kube@.service
sed -e 's;@@PODMAN@@;/usr/bin/podman;g' contrib/systemd/system/podman-clean-transient.service.in >contrib/systemd/system/podman-clean-transient.service.tmp.$ \
&& mv -f contrib/systemd/system/podman-clean-transient.service.tmp.$ contrib/systemd/system/podman-clean-transient.service
install -m 755 -d /usr/lib/systemd/system /usr/lib/systemd/user
# User services
install -m 644 contrib/systemd/auto-update/podman-auto-update.service /usr/lib/systemd/user/podman-auto-update.service
install -m 644 contrib/systemd/auto-update/podman-auto-update.timer /usr/lib/systemd/user/podman-auto-update.timer
install -m 644 contrib/systemd/system/podman.socket /usr/lib/systemd/user/podman.socket
install -m 644 contrib/systemd/system/podman.service /usr/lib/systemd/user/podman.service
install -m 644 contrib/systemd/system/podman-restart.service /usr/lib/systemd/user/podman-restart.service
install -m 644 contrib/systemd/system/podman-kube@.service /usr/lib/systemd/user/podman-kube@.service
# System services
install -m 644 contrib/systemd/auto-update/podman-auto-update.service /usr/lib/systemd/system/podman-auto-update.service
install -m 644 contrib/systemd/auto-update/podman-auto-update.timer /usr/lib/systemd/system/podman-auto-update.timer
install -m 644 contrib/systemd/system/podman.socket /usr/lib/systemd/system/podman.socket
install -m 644 contrib/systemd/system/podman.service /usr/lib/systemd/system/podman.service
install -m 644 contrib/systemd/system/podman-restart.service /usr/lib/systemd/system/podman-restart.service
install -m 644 contrib/systemd/system/podman-kube@.service /usr/lib/systemd/system/podman-kube@.service
install -m 644 contrib/systemd/system/podman-clean-transient.service /usr/lib/systemd/system/podman-clean-transient.service
rm -f contrib/systemd/auto-update/podman-auto-update.service contrib/systemd/system/podman.service contrib/systemd/system/podman-restart.service contrib/systemd/system/podman-kube@.service contrib/systemd/system/podman-clean-transient.service
直接在centos7.7下安装podman4.6.1还是有问题存在,目前没有找到很好的解决办法,不过可以先在centos7.9下安装podman4.6.1,再copy到centos7.7下