yum install空间不足

时间:2022-07-22
本文章向大家介绍yum install空间不足,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

本地要编一个 ceph-exporter,需要 ceph 的相关库,于是在开发机上 yum install librados2-devel,报错了,因为第一次遇到所以记录一下解决的思路。具体报错的信息如下。

➜  / yum install ceph-devel
已加载插件:fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
base                                                                      | 3.6 kB  00:00:00


 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

下载目录 /var/cache/yum/x86_64/7/centosplus 空间不足
    * 空闲   0
    * 需要 100 k

因为平时在开发机会做各种测试,所以装了很多莫名其妙的东西,也不及时清理掉,尤其是 Docker 的镜像,因为我们对接的业务同学打出来的镜像都非常大,所以对硬盘是非常巨大的挑战…yum install 的报错一看就知道是磁盘空间不足了,于是考虑一下 yum 命令会 cache 很多东西,所以试了一下 yum clean all,但是清理掉一些 cache 之后,空间还是不够。 具体看一下 df 吧。根目录没有空间了,通过 yum clean 用作不大,所以首先就考虑了 /var/log/ 下面的日志,果然删掉了之后,就释放了很多空间,这个文件就解决了。