CentOS7下yum升级被PackageKit锁定(docker1)

Posted security-guard

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS7下yum升级被PackageKit锁定(docker1)相关的知识,希望对你有一定的参考价值。

新安装centos7后,第一次升级出现下面的错误

Another app is currently holding the yum lock; waiting for it to exit...
  另一个应用程序是:PackageKit
    内存:113 M RSS (535 MB VSZ)
    已启动: Sat Mar 14 11:45:39 2020 - 05:16之前
    状态  :睡眠中,进程ID:3178
PackageKit是一个离线更新服务,基本没啥用途,应该永久禁用。
centos7下,打开:
etc/yum/pluginconf.d/langpacks.conf
将第一行:enable=1改为enable=0
保存后再执行yum安装就不会被锁定了

一:docker安装脚本:
#!/bin/bash
echo "11111"
yum install -y yum-utils device-mapper-persistent-data lvm2
echo "22222"
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
echo "33333"
yum makecache fast
yum -y install docker-ce
echo "44444"
systemctl enable docker
systemctl start docker
echo "55555"
docker version
echo "66666"
docker run hello-world
问题2:运行docker run hello-world报错
Unable to find image hello-world:latest locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
See docker run --help.

 

/etc/docker/daemon.json更换镜像https://registry.docker-cn.comhttp://hub-mirror.c.163.com
{
"registry-mirrors":["http://hub-mirror.c.163.com"]
}

执行docker run hello-world打印日志如下 ,打印成功Hello from Docker!

[root@localhost ~]# docker run hello-world
Unable to find image hello-world:latest locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete 
Digest: sha256:f9dfddf63636d84ef479d645ab5885156ae030f611a56f3a7ac7f2fdd86d7e4e
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

[root@localhost ~]# 

 

docker可以正常使用

以上是关于CentOS7下yum升级被PackageKit锁定(docker1)的主要内容,如果未能解决你的问题,请参考以下文章

CentOS7升级版本

Tomcat实战案例:升级CentOS7.9下yum安装的Tomcat运行的java环境(JDK)

解决Centos7 yum 出现could not retrieve mirrorlist 错误

解决yum 不能更新问题 :yum 报错Loaded plugins: fastestmirror, refresh-packagekit, security

docker探索-CentOS7中配置Docker的yum源并升级安装docker1.13

fedora15 软件升级错误