Linux - Ubuntu gpg: can‘t connect to the agent: IPC connect call failed

添加Podman PPA并安装Podman;

在Ubuntu上开始安装Podman的简单方法是使用Kubic项目.Kubic项目提供了适用于Ubuntu 18.04、19.04、19.10和20.04的软件包。您可以按如下所示轻松地将此软件包添加到Ubuntu发行版中

. /etc/os-release
sudo sh -c "echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key | sudo apt-key add -
sudo apt-get update -qq
sudo apt-get -qq -y install podman
sudo mkdir -p /etc/containers
echo -e "[registries.search]\nregistries = ['docker.io', 'quay.io']" | sudo tee /etc/containers/registries.conf
root@N-20HEPF15JN1Q:/home/ubuntu# podman info
Error: error getting registries: unable to parse the registries.conf file: error loading registries configuration "/etc/containers/registries.conf": Near line 1 (last key parsed 'registries.search'): expected a top-level item to end with a newline, comment, or EOF, but got 'n' instead

注意: echo -e "[registries.search]\nregistries = ['docker.io', 'quay.io']" | sudo tee /etc/containers/registries.conf 

[registries.search] 后面的‘n’应该是'\n',许多网上互相抄的博客,不知道是不是都没有亲自操作过,写错了还不知道呢。。。

在红帽上找到了正确的命令,才执行成功了;https://www.redhat.com/sysadmin/podman-windows-wsl2

确认我们的podman是否已成功安装

podman info

 然而。。。

root@N-20HEPF15JN1Q:/home/ubuntu# . /etc/os-release
root@N-20HEPF15JN1Q:/home/ubuntu# sudo sh -c "echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
root@N-20HEPF15JN1Q:/home/ubuntu#
root@N-20HEPF15JN1Q:/home/ubuntu#
root@N-20HEPF15JN1Q:/home/ubuntu# curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key | sudo apt-key add -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1094  100  1094    0     0    976      0  0:00:01  0:00:01 --:--:--   977
gpg: can't connect to the agent: IPC connect call failed

发现报错:

gpg: can't connect to the agent: IPC connect call failed  // gpg:无法连接到代理:IPC连接调用失败

在网上谷歌了半天,先是启动 gpg agent: gpg-agent –daemon ,然而无效。

 

陆陆续续查了很多修改方法,最后下面这个方法奏效了(注意获取root权限):

sudo apt remove gpg

sudo apt install gnupg1
posted @ 2022-01-27 18:35  zhangdaopin  阅读(112)  评论(0编辑  收藏  举报