q303651446 2024-07-28 01:43 采纳率: 0%
浏览 22

无法在CentOS7安装docker

问题遇到的现象和发生背景

CENTOS7修改下载镜像地址,安装docker。命令及提示如下:
Last login: Sat Jul 27 12:56:30 2024
[root@localhost ~]# yum install -y yum-utils device-mapper-persistent-data lvm2
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"

One of the configured repositories failed (未知),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Run the command with the repository temporarily disabled
        yum --disablerepo=<repoid> ...

 4. Disable the repository permanently, so yum won't use it by default. Yum
    will then just ignore the repository until you permanently enable it
    again or use --enablerepo for temporary usage:

        yum-config-manager --disable <repoid>
    or
        subscription-manager repos --disable=<repoid>

 5. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: extras/7/x86_64
[root@localhost ~]# sudo yum clean all \

sudo yum makecache
已加载插件:fastestmirror
错误:清理命令参数不正确:'sudo'
简单用法:

clean [headers|packages|metadata|dbcache|plugins|expire-cache|all]

删除缓存数据
[root@localhost ~]# sudo yum clean all
已加载插件:fastestmirror
正在清理软件源: base extras updates
Cleaning up list of fastest mirrors
[root@localhost ~]# sudo yum makecache
已加载插件:fastestmirror
Determining fastest mirrors
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 403 - Forbidden
正在尝试其它镜像。
To address this issue please refer to the below wiki article

https://wiki.centos.org/yum-errors

If above article doesn't help to resolve this issue please use https://bugs.centos.org/.

One of the configured repositories failed (CentOS-7 - Base - Aliyun),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Run the command with the repository temporarily disabled
        yum --disablerepo=base ...

 4. Disable the repository permanently, so yum won't use it by default. Yum
    will then just ignore the repository until you permanently enable it
    again or use --enablerepo for temporary usage:

        yum-config-manager --disable base
    or
        subscription-manager repos --disable=base

 5. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=base.skip_if_unavailable=true

failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 403 - Forbidden
[root@localhost ~]# yum install -y yum-utils device-mapper-persistent-data lvm2
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 403 - Forbidden
正在尝试其它镜像。
To address this issue please refer to the below wiki article

https://wiki.centos.org/yum-errors

If above article doesn't help to resolve this issue please use https://bugs.centos.org/.

One of the configured repositories failed (CentOS-7 - Base - Aliyun),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Run the command with the repository temporarily disabled
        yum --disablerepo=base ...

 4. Disable the repository permanently, so yum won't use it by default. Yum
    will then just ignore the repository until you permanently enable it
    again or use --enablerepo for temporary usage:

        yum-config-manager --disable base
    or
        subscription-manager repos --disable=base

 5. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=base.skip_if_unavailable=true

failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 403 - Forbidden
[root@localhost ~]# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.rep
-bash: yum-config-manager: 未找到命令
[root@localhost ~]# yum install docker-ce
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 403 - Forbidden
正在尝试其它镜像。
To address this issue please refer to the below wiki article

https://wiki.centos.org/yum-errors

If above article doesn't help to resolve this issue please use https://bugs.centos.org/.

One of the configured repositories failed (CentOS-7 - Base - Aliyun),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Run the command with the repository temporarily disabled
        yum --disablerepo=base ...

 4. Disable the repository permanently, so yum won't use it by default. Yum
    will then just ignore the repository until you permanently enable it
    again or use --enablerepo for temporary usage:

        yum-config-manager --disable base
    or
        subscription-manager repos --disable=base

 5. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=base.skip_if_unavailable=true

failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 403 - Forbidden
[root@localhost ~]# systemctl start docker
Failed to start docker.service: Unit not found.
[root@localhost ~]# docker version
-bash: docker: 未找到命令
[root@localhost ~]#

img

操作环境、软件版本等信息

VM下安装Centos7,

我想要达到的结果

在CENTOS中安装HomeAssistant

  • 写回答

2条回答 默认 最新

  • 专家-司宇[在线] 2024-07-28 08:40
    关注

    引自免费微信小程序:皆我百晓生

    你的问题涉及到在CentOS 7上安装docker以及Home Assistant。首先,你需要解决你的yum问题,然后才能进一步安装其他应用。根据你给出的信息,似乎是在使用阿里云的镜像时遇到了问题。以下是一些可能的解决方案:

    解决yum问题

    1. 检查网络连接:确保你的服务器可以连接到互联网和阿里云的镜像服务器。
    2. 清除yum缓存:运行命令 sudo yum clean allsudo yum makecache
    3. 更换yum源:可能是当前使用的yum源出现了问题,你可以尝试更换其他的yum源,比如使用官方的CentOS源。

    安装Docker

    在解决了yum问题之后,你可以尝试安装Docker。运行以下命令:

    sudo yum update
    sudo yum install docker-ce
    sudo systemctl start docker
    

    如果你希望docker在系统启动时自动运行,可以运行 sudo systemctl enable docker

    安装Home Assistant

    安装完Docker之后,你可以在Docker中安装Home Assistant。首先,从Docker Hub下载Home Assistant的镜像:

    docker pull homeassistant/home-assistant
    

    然后,运行Home Assistant的容器:

    docker run -d --name=homeassistant -p 8123:8123 -v /your/path/to/config:/config homeassistant/home-assistant
    

    注意替换/your/path/to/config为你的Home Assistant配置文件的路径。默认的端口是8123,你可以根据需要更改。

    希望这些信息对你有所帮助!如果你还有其他问题,欢迎继续提问。

    评论 编辑记录

报告相同问题?

问题事件

  • 创建了问题 7月28日

悬赏问题

  • ¥15 结构功能耦合指标计算
  • ¥50 AI大模型精调(百度千帆、飞浆)
  • ¥15 非科班怎么跑代码?如何导数据和调参
  • ¥15 福州市的全人群死因监测点死亡原因报表
  • ¥15 Altair EDEM中生成一个颗粒,并且各个方向没有初始速度
  • ¥15 系统2008r2 装机配置推荐一下
  • ¥15 悬赏Python-playwright部署在centos7上
  • ¥15 psoc creator软件有没有人能远程安装啊
  • ¥15 快速扫描算法求解Eikonal方程咨询
  • ¥15 校内二手商品转让网站