1、先修改apt源为阿里源加速
备份原文件:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
修改源配置:
vim sources.list
删除里面全部内容后,粘贴阿里源:
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
更新源信息
sudo apt update
sudo apt upgrade
2、Ubuntu安装Podman分两种情况,一种是Ubuntu版本高于20.10,则可以直接使用apt安装,命令如下:
apt install podman
3、低版本Ubuntu安装podman
3.1、先安装依赖
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
3.2、添加Podman仓库
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_18.04/Release.key | sudo gpg --dearmor -o /usr/share/keyrings/libcontainers-archive-keyring.gpg
echo 'deb [signed-by=/usr/share/keyrings/libcontainers-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_18.04/ /' | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
3.3、 安装Podman
sudo apt update
sudo apt install podman
3.4、验证安装结果
podman --version
4、更名podman为docker,这样就能使用docker来代替podman执行
alias docker=podman
5、安装podman-compse
pip3 install https://github.com/containers/podman-compose/archive/main.tar.gz