Installing CRI-O

Thanaphat Nuangjumnong
1 min readJun 16, 2020

To install CRI-O, you can use your distribution’s package manager:

CentOS 7:

curl -L -o /etc/yum.custom.repo.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_7/devel:kubic:libcontainers:stable.repo

curl -L -o /etc/yum.custom.repo.d/devel:kubic:libcontainers:stable:cri-o:1.16.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:1.16/CentOS_7/devel:kubic:libcontainers:stable:cri-o:1.16.repo

[devel_kubic_libcontainers_stable]

name=Stable Releases of Upstream github.com/containers packages (CentOS_7)

type=rpm-md

baseurl=https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_7/

gpgcheck=1

gpgkey=https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_7/repodata/repomd.xml.key

enabled=1

## Install & remove

yum remove cri-o
yum install cri-o

## Clear old-version

systemctl stop kubelet
crictl ps -a |awk {‘print $1’}|xargs -I{} crictl stop {}
crictl ps -a |awk {‘print $1’}|xargs -I{} crictl rm {}
df -h|grep -E “containers|kubelet”|awk {‘print $NF’}|xargs -I{} umount {}
ps -eaf|grep runc|grep -v grep|awk {‘print $2’}|xargs kill -15
ps -eaf|grep runc|grep -v grep|awk {‘print $2’}|xargs kill -9
rm -rf /var/lib/kubelet/pods/*
iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X

ipvsadm — clear
systemctl stop crio

## Restart

systemctl daemon-reload
systemctl start crio

Ref. https://kubernetes.io/docs/setup/production-environment/container-runtimes/

--

--