yum install空间不足

本文记录了一次在开发机上使用yum安装ceph-devel时遇到的磁盘空间不足错误,并详细描述了解决过程。从清理yum缓存到检查磁盘空间,最终通过删除/var/log/下的日志文件释放空间,成功解决了问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

本地要编一个 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/ 下面的日志,果然删掉了之后,就释放了很多空间,这个文件就解决了。
在这里插入图片描述

### YUM Install 命令执行失败的解决方案 当遇到 `yum install` 执行失败的情况时,可能由多种原因引起。以下是几种常见情况及其对应的处理方法: #### 修改YUM配置文件 对于某些情况下,插件可能会干扰正常的包管理操作。可以通过编辑 `/etc/yum.conf` 文件来禁用这些插件: ```bash sudo vi /etc/yum.conf ``` 将其中的 `plugins=1` 改为 `plugins=0`[^1]。 #### 安装EPEL仓库支持 如果目标软件依赖于额外的第三方库,则需确保已安装 EPEL (Extra Packages for Enterprise Linux) 仓库。这一步骤通常通过如下命令完成: ```bash sudo yum install epel-release ``` 然而,在特定情形下会遭遇找不到匹配项的问题。此时应确认网络连接正常并尝试更新本地缓存后再重试上述指令;另外也可以考虑更换国内镜像源以提高下载成功率[^2]。 #### 更换至阿里云镜像源 针对部分用户反馈因官方源速度慢或不稳定而导致无法成功获取所需资源的现象,建议切换到更稳定的国内镜像站点如阿里云提供的服务。具体做法是在终端里输入以下命令添加新的仓库地址: ```bash sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo ``` 此方式不仅限于 Docker 的安装过程同样适用于其他类型的程序部署需求[^3]。 #### 检查磁盘可用空间 有时因为根分区剩余容量过少也会阻碍新软件包的加入。特别是采用 XFS 类型作为默认格式化选项的操作系统版本更为明显。为了防止此类状况发生,应当定期监控各逻辑卷组下的实际占用量,并适时调整分配策略。一旦发现不足之处可借助工具函数来进行在线扩容作业: ```bash sudo xfs_growfs /dev/mapper/centos-root ``` 该命令能够自动识别未使用的物理区块并将它们纳入现有文件系统的管辖范围之内从而释放更多活动区间供后续操作调用[^4]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值