CentOS 8 离线安装 podman 解决方法

【CentOS 8 离线安装 podman 解决方法】CentOS 8 系统中如果没有安装Podman的话 , 想要离线安装会比较麻烦 , 因为podman依赖的包比较多 , 从网上一个一个下载会很繁琐 , 也容易出错 。这里介绍一种曲线救国的方式来离线安装 。
首先分享下我刚获取的离线安装包 , 下载 , 解压后 , 直接安装所有rpm 就可以了 。链接:https://pan.baidu.com/s/1AKrGVDNln1zSNpsD74HQrg提取码:6666
[root@node13 podmanpackage]# podman -vpodman version 3.3.1之所以叫曲线救国 , 多少是有点儿原因的:离线安装包的制作方法 , 很简单 , 就是用一台能够联网的centos8 机器 , 然后执行下面的命令yum install --downloadonly --downloaddir=/opt/podmanpackage/ podman就会把所有的包下载到 /opt/podmanpackage/ 这个目录下 , 然后把这个目录下的所有rpm 打包到离线的机器上进行安装 , 就可以了 , 是不是有点儿曲线救国的意思 。
下面是操作日志:
[root@node13 podmanpackage]# yum install --downloadonly --downloaddir=/opt/podmanpackage/ podmanCentOS-8.5.2111 - Base - mirrors.aliyun.com192 kB/s | 4.6 MB00:24CentOS-8.5.2111 - Extras - mirrors.aliyun.com38 kB/s |10 kB00:00CentOS-8.5.2111 - AppStream - mirrors.aliyun.com132 kB/s | 8.4 MB01:05Dependencies resolved.============================================================================================================================================================================================= PackageArchitectureVersionRepositorySize=============================================================================================================================================================================================Installing: podmanx86_643.3.1-9.module_el8.5.0+988+b1f0b741AppStream12 MInstalling dependencies: conmonx86_642:2.0.29-1.module_el8.5.0+890+6b136101AppStream52 k containernetworking-pluginsx86_641.0.0-1.module_el8.5.0+890+6b136101AppStream19 M containers-commonnoarch2:1-2.module_el8.5.0+890+6b136101AppStream79 k criux86_643.15-3.module_el8.5.0+890+6b136101AppStream518 k fuse-overlayfsx86_641.7.1-1.module_el8.5.0+890+6b136101AppStream73 k fuse3x86_643.2.1-12.el8base50 k fuse3-libsx86_643.2.1-12.el8base94 k libnetx86_641.1.6-15.el8AppStream67 k libslirpx86_644.4.0-1.module_el8.5.0+890+6b136101AppStream70 k podman-catatonitx86_643.3.1-9.module_el8.5.0+988+b1f0b741AppStream340 k runcx86_641.0.2-1.module_el8.5.0+911+f19012f9AppStream3.1 M slirp4netnsx86_641.1.8-1.module_el8.5.0+890+6b136101AppStream51 kEnabling module streams: container-toolsrhel8Transaction Summary=============================================================================================================================================================================================Install13 PackagesTotal download size: 36 MInstalled size: 124 MYUM will only download packages for the transaction.Is this ok [y/N]: yDownloading Packages:(1/13): fuse3-3.2.1-12.el8.x86_64.rpm77 kB/s |50 kB00:00(2/13): conmon-2.0.29-1.module_el8.5.0+890+6b136101.x86_64.rpm57 kB/s |52 kB00:00(3/13): fuse3-libs-3.2.1-12.el8.x86_64.rpm67 kB/s |94 kB00:01(4/13): containers-common-1-2.module_el8.5.0+890+6b136101.noarch.rpm67 kB/s |79 kB00:01(5/13): fuse-overlayfs-1.7.1-1.module_el8.5.0+890+6b136101.x86_64.rpm74 kB/s |73 kB00:00(6/13): libnet-1.1.6-15.el8.x86_64.rpm88 kB/s |67 kB00:00(7/13): libslirp-4.4.0-1.module_el8.5.0+890+6b136101.x86_64.rpm96 kB/s |70 kB00:00(8/13): criu-3.15-3.module_el8.5.0+890+6b136101.x86_64.rpm91 kB/s | 518 kB00:05(9/13): podman-catatonit-3.3.1-9.module_el8.5.0+988+b1f0b741.x86_64.rpm101 kB/s | 340 kB00:03(10/13): runc-1.0.2-1.module_el8.5.0+911+f19012f9.x86_64.rpm98 kB/s | 3.1 MB00:32(11/13): slirp4netns-1.1.8-1.module_el8.5.0+890+6b136101.x86_64.rpm62 kB/s |51 kB00:00(12/13): podman-3.3.1-9.module_el8.5.0+988+b1f0b741.x86_64.rpm97 kB/s |12 MB02:07(13/13): containernetworking-plugins-1.0.0-1.module_el8.5.0+890+6b136101.x86_64.rpm95 kB/s |19 MB03:25---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Total177 kB/s |36 MB03:26Complete!The downloaded packages were saved in cache until the next successful transaction.You can remove cached packages by executing 'yum clean packages'.[root@node13 podmanpackage]# lltotal 36536-rw-r--r--. 1 root root53667 Nov 14 08:47 conmon-2.0.29-1.module_el8.5.0+890+6b136101.x86_64.rpm-rw-r--r--. 1 root root 20038039 Nov 14 08:50 containernetworking-plugins-1.0.0-1.module_el8.5.0+890+6b136101.x86_64.rpm-rw-r--r--. 1 root root80919 Nov 14 08:47 containers-common-1-2.module_el8.5.0+890+6b136101.noarch.rpm-rw-r--r--. 1 root root530199 Nov 14 08:47 criu-3.15-3.module_el8.5.0+890+6b136101.x86_64.rpm-rw-r--r--. 1 root root51396 Nov 14 08:47 fuse3-3.2.1-12.el8.x86_64.rpm-rw-r--r--. 1 root root96540 Nov 14 08:47 fuse3-libs-3.2.1-12.el8.x86_64.rpm-rw-r--r--. 1 root root74287 Nov 14 08:47 fuse-overlayfs-1.7.1-1.module_el8.5.0+890+6b136101.x86_64.rpm-rw-r--r--. 1 root root68632 Nov 14 08:47 libnet-1.1.6-15.el8.x86_64.rpm-rw-r--r--. 1 root root71995 Nov 14 08:47 libslirp-4.4.0-1.module_el8.5.0+890+6b136101.x86_64.rpm-rw-r--r--. 1 root root 12692155 Nov 14 08:49 podman-3.3.1-9.module_el8.5.0+988+b1f0b741.x86_64.rpm-rw-r--r--. 1 root root348543 Nov 14 08:47 podman-catatonit-3.3.1-9.module_el8.5.0+988+b1f0b741.x86_64.rpm-rw-r--r--. 1 root root3227247 Nov 14 08:48 runc-1.0.2-1.module_el8.5.0+911+f19012f9.x86_64.rpm-rw-r--r--. 1 root root52427 Nov 14 08:48 slirp4netns-1.1.8-1.module_el8.5.0+890+6b136101.x86_64.rpm[root@node13 podmanpackage]# vim /etc/resolv.conf[root@node13 podmanpackage]# vim /etc/sysconfig/network-scripts/ifcfg-ens33[root@node13 podmanpackage]# systemctl restart NetworkManager[root@node13 podmanpackage]# ping www.baidu.comping: www.baidu.com: Name or service not known[root@node13 podmanpackage]# rpm -ivh *.rpmwarning: conmon-2.0.29-1.module_el8.5.0+890+6b136101.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEYVerifying...################################# [100%]Preparing...################################# [100%]Updating / installing...1:libslirp-4.4.0-1.module_el8.5.0+8################################# [8%]2:slirp4netns-1.1.8-1.module_el8.5.################################# [ 15%]3:libnet-1.1.6-15.el8################################# [ 23%]4:criu-3.15-3.module_el8.5.0+890+6b################################# [ 31%]5:runc-1.0.2-1.module_el8.5.0+911+f################################# [ 38%]6:fuse3-libs-3.2.1-12.el8################################# [ 46%]7:fuse3-3.2.1-12.el8################################# [ 54%]8:fuse-overlayfs-1.7.1-1.module_el8################################# [ 62%]9:containers-common-2:1-2.module_el################################# [ 69%]10:containernetworking-plugins-1.0.0################################# [ 77%]11:conmon-2:2.0.29-1.module_el8.5.0+################################# [ 85%]12:podman-catatonit-3.3.1-9.module_e################################# [ 92%]13:podman-3.3.1-9.module_el8.5.0+988################################# [100%][root@node13 podmanpackage]# podman -vpodman version 3.3.1[root@node13 ~]# cd /opt/podmanpackage/[root@node13 podmanpackage]# lltotal 36536-rw-r--r--. 1 root root53667 Nov 14 08:47 conmon-2.0.29-1.module_el8.5.0+890+6b136101.x86_64.rpm-rw-r--r--. 1 root root 20038039 Nov 14 08:50 containernetworking-plugins-1.0.0-1.module_el8.5.0+890+6b136101.x86_64.rpm-rw-r--r--. 1 root root80919 Nov 14 08:47 containers-common-1-2.module_el8.5.0+890+6b136101.noarch.rpm-rw-r--r--. 1 root root530199 Nov 14 08:47 criu-3.15-3.module_el8.5.0+890+6b136101.x86_64.rpm-rw-r--r--. 1 root root51396 Nov 14 08:47 fuse3-3.2.1-12.el8.x86_64.rpm-rw-r--r--. 1 root root96540 Nov 14 08:47 fuse3-libs-3.2.1-12.el8.x86_64.rpm-rw-r--r--. 1 root root74287 Nov 14 08:47 fuse-overlayfs-1.7.1-1.module_el8.5.0+890+6b136101.x86_64.rpm-rw-r--r--. 1 root root68632 Nov 14 08:47 libnet-1.1.6-15.el8.x86_64.rpm-rw-r--r--. 1 root root71995 Nov 14 08:47 libslirp-4.4.0-1.module_el8.5.0+890+6b136101.x86_64.rpm-rw-r--r--. 1 root root 12692155 Nov 14 08:49 podman-3.3.1-9.module_el8.5.0+988+b1f0b741.x86_64.rpm-rw-r--r--. 1 root root348543 Nov 14 08:47 podman-catatonit-3.3.1-9.module_el8.5.0+988+b1f0b741.x86_64.rpm-rw-r--r--. 1 root root3227247 Nov 14 08:48 runc-1.0.2-1.module_el8.5.0+911+f19012f9.x86_64.rpm-rw-r--r--. 1 root root52427 Nov 14 08:48 slirp4netns-1.1.8-1.module_el8.5.0+890+6b136101.x86_64.rpm[root@node13 opt]# tar -czf podman_3.3.1_x86_64.rpmpackage.tgz podmanpackage[root@node13 opt]# sz podman_3.3.1_x86_64.rpmpackage.tgz

经验总结扩展阅读