AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 667990
Accepted
xiaojueguan
xiaojueguan
Asked: 2021-09-07 23:43:06 +0800 CST2021-09-07 23:43:06 +0800 CST 2021-09-07 23:43:06 +0800 CST

update-initramfs:/boot/initrd.img-4.15.0-112-generic 失败,为 1

  • 772

说明:

当我运行 dist-upgrade 时,我遇到了以下详细信息的问题

1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = "en_US:",
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LC_TERMINAL = "iTerm2",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Setting up initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-112-generic
W: Possible missing firmware /lib/firmware/ast_dp501_fw.bin for module ast
Error 24 : Write error : cannot write compressed block
E: mkinitramfs failure lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-4.15.0-112-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

任何人都可以解决这个问题吗?

apt io
  • 1 1 个回答
  • 2705 Views

1 个回答

  • Voted
  1. Best Answer
    Peter J. Mello
    2021-09-08T00:18:11+08:002021-09-08T00:18:11+08:00

    隐藏在所有输出中的真正错误消息是Write error : cannot write compressed block,以压倒性优势被发现是可用空间不足的结果,可用于创建新的 initramfs 映像。请记住,您需要为/boot文件夹中的未压缩图像提供足够的空间,然后将其替换为压缩版本,但由于您使用的是 lz4 压缩算法,因此可能不会有很大的大小差异(我猜 < 20%,我)。

    我看到了几种不同的方法来改善你的问题,除了用细齿梳浏览 /boot 目录并寻找你可以安全地重新定位/删除的垃圾之外,这应该是你的第一种方法。

    1. 如果没有足够的额外可用空间来允许生成新的 initrd 文件,那么应该查看您的系统上是否携带任何可以清除的旧内核包,并将它们的 initrd 文件与他们。启动终端仿真器并dpkg --list | grep '^linux-'检查uname -r. 如果您有一些满足该标准并且愿意为了成功完成包更新而放弃它们,只需在sudo dpkg --purge.
    2. 如果您只为您正在运行的内核版本安装了软件包,您可能需要将当前的 initrd 文件从 /boot 目录中重新定位,然后查看是否可以完成软件包更新,这当然会为您提供使用闪亮的新 initramfs,然后您可以安全地删除您重新定位的旧的。这看起来像这样,假设正在使用的 shell 实例的工作目录与 /boot 位于不同的文件系统上(简单的英语:确保首先cd到不同分区上的某个文件夹,或者如果这不可能并且你的 / tmp 文件夹是一个挂载的 tmpfs 分区,然后cd /tmp),然后执行:
    # This'll provide a useful report of the files that get moved incase the package
    # update fails and you need to put them back where you found them
    sudo mv -iv /boot/*initrd "$(pwd)"
    
    # Now time to do a little housekeeping on the package manager and see if
    # the update will complete successfully
    sudo apt autoremove
    sudo apt autoclean
    sudo apt --fix-broken install
    sudo dpkg --configure -a
    

    如果您仍然遇到相同的错误并且您确定可用空间问题已得到解决,那么结论一定是 initramfs-tools 软件包确实存在问题,因为它当前存在于您的系统中,因此请尝试返回它使用以下命令序列恢复到原始状态:

    sudo apt remove initramfs-tools
    sudo apt clean
    sudo apt -y install initramfs-tools
    
    • 5

相关问题

  • 了解 apt 列表输出

  • 尝试安装 debian 软件包 npm,使 apt-get 删除 libssl-dev

  • 如何下载软件包而不是使用 apt-get 命令安装它?

  • /etc/apt/sources.list.d 比 /etc/apt/sources.list 有什么好处

  • 有什么方法可以杀死或结束“磁盘睡眠”中的进程

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve