【debug】dpkg: error processing archive...Invalid cross-device link

更新系统驱动后,sudo apt install 时出现:

The following packages have unmet dependencies:
 nvidia-dkms-535 : Depends: nvidia-firmware-535-535.183.01 but it is not going to be installed
 nvidia-driver-535 : Depends: libnvidia-compute-535 (= 535.183.01-0ubuntu0.24.04.1) but it is not going to be installed
                     Depends: libnvidia-extra-535 (= 535.183.01-0ubuntu0.24.04.1) but it is not going to be installed
                     Depends: nvidia-compute-utils-535 (= 535.183.01-0ubuntu0.24.04.1) but it is not going to be installed
                     Depends: libnvidia-decode-535 (= 535.183.01-0ubuntu0.24.04.1) but it is not going to be installed
                     Depends: libnvidia-encode-535 (= 535.183.01-0ubuntu0.24.04.1) but it is not going to be installed
                     Depends: nvidia-utils-535 (= 535.183.01-0ubuntu0.24.04.1) but it is not going to be installed
                     Depends: libnvidia-cfg1-535 (= 535.183.01-0ubuntu0.24.04.1) but it is not going to be installed
                     Recommends: libnvidia-compute-535:i386 (= 535.183.01-0ubuntu0.24.04.1) but it is not installable
                     Recommends: libnvidia-decode-535:i386 (= 535.183.01-0ubuntu0.24.04.1) but it is not installable
                     Recommends: libnvidia-encode-535:i386 (= 535.183.01-0ubuntu0.24.04.1) but it is not installable
                     Recommends: libnvidia-fbc1-535:i386 (= 535.183.01-0ubuntu0.24.04.1) but it is not installable
                     Recommends: libnvidia-gl-535:i386 (= 535.183.01-0ubuntu0.24.04.1) but it is not installable
 nvidia-kernel-common-535 : Depends: nvidia-firmware-535-535.183.01 but it is not going to be installed
 xserver-xorg-video-nvidia-535 : Depends: libnvidia-cfg1-535 (= 535.183.01-0ubuntu0.24.04.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

尝试apt --fix-broken install,报错:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libnvidia-cfg1-535 libnvidia-compute-535 libnvidia-decode-535 libnvidia-encode-535 libnvidia-extra-535 nvidia-compute-utils-535
  nvidia-firmware-535-535.183.01 nvidia-utils-535
The following NEW packages will be installed:
  libnvidia-cfg1-535 libnvidia-compute-535 libnvidia-decode-535 libnvidia-encode-535 libnvidia-extra-535 nvidia-compute-utils-535
  nvidia-firmware-535-535.183.01 nvidia-utils-535
0 upgraded, 8 newly installed, 0 to remove and 791 not upgraded.
4 not fully installed or removed.
Need to get 82.5 MB of archives.
After this operation, 250 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-updates/restricted amd64 nvidia-firmware-535-535.183.01 amd64 535.183.01-0ubuntu0.24.04.1 [39.6 MB]
Get:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-updates/restricted amd64 libnvidia-compute-535 amd64 535.183.01-0ubuntu0.24.04.1 [40.3 MB]
Get:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-updates/restricted amd64 libnvidia-extra-535 amd64 535.183.01-0ubuntu0.24.04.1 [71.5 kB]
Get:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-updates/restricted amd64 nvidia-compute-utils-535 amd64 535.183.01-0ubuntu0.24.04.1 [122 kB]
Get:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-updates/restricted amd64 libnvidia-decode-535 amd64 535.183.01-0ubuntu0.24.04.1 [1886 kB]
Get:6 https://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-updates/restricted amd64 libnvidia-encode-535 amd64 535.183.01-0ubuntu0.24.04.1 [97.3 kB]
Get:7 https://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-updates/restricted amd64 nvidia-utils-535 amd64 535.183.01-0ubuntu0.24.04.1 [405 kB]
Get:8 https://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-updates/restricted amd64 libnvidia-cfg1-535 amd64 535.183.01-0ubuntu0.24.04.1 [108 kB]
Fetched 82.5 MB in 18s (4645 kB/s)                                                                                                    
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76, <> line 8.)
debconf: falling back to frontend: Readline
(Reading database ... 101979 files and directories currently installed.)
Preparing to unpack .../0-nvidia-firmware-535-535.183.01_535.183.01-0ubuntu0.24.04.1_amd64.deb ...
Unpacking nvidia-firmware-535-535.183.01 (535.183.01-0ubuntu0.24.04.1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-rrVpFY/0-nvidia-firmware-535-535.183.01_535.183.01-0ubuntu0.24.04.1_amd64.deb (--unpack):
 unable to make backup link of './lib/firmware/nvidia/535.183.01/gsp_ga10x.bin' before installing new version: Invalid cross-device link
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../1-libnvidia-compute-535_535.183.01-0ubuntu0.24.04.1_amd64.deb ...
Unpacking libnvidia-compute-535:amd64 (535.183.01-0ubuntu0.24.04.1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-rrVpFY/1-libnvidia-compute-535_535.183.01-0ubuntu0.24.04.1_amd64.deb (--unpack):
 unable to make backup link of './usr/lib/x86_64-linux-gnu/libcuda.so.535.183.01' before installing new version: Invalid cross-device link
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../2-libnvidia-extra-535_535.183.01-0ubuntu0.24.04.1_amd64.deb ...
Unpacking libnvidia-extra-535:amd64 (535.183.01-0ubuntu0.24.04.1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-rrVpFY/2-libnvidia-extra-535_535.183.01-0ubuntu0.24.04.1_amd64.deb (--unpack):
 unable to make backup link of './usr/lib/x86_64-linux-gnu/libnvidia-allocator.so.535.183.01' before installing new version: Invalid cross-device link
Preparing to unpack .../3-nvidia-compute-utils-535_535.183.01-0ubuntu0.24.04.1_amd64.deb ...
Unpacking nvidia-compute-utils-535 (535.183.01-0ubuntu0.24.04.1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-rrVpFY/3-nvidia-compute-utils-535_535.183.01-0ubuntu0.24.04.1_amd64.deb (--unpack):
 unable to make backup link of './usr/bin/nvidia-cuda-mps-control' before installing new version: Invalid cross-device link
No apport report written because MaxReports is reached already
                                                              dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../4-libnvidia-decode-535_535.183.01-0ubuntu0.24.04.1_amd64.deb ...
Unpacking libnvidia-decode-535:amd64 (535.183.01-0ubuntu0.24.04.1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-rrVpFY/4-libnvidia-decode-535_535.183.01-0ubuntu0.24.04.1_amd64.deb (--unpack):
 unable to make backup link of './usr/lib/x86_64-linux-gnu/libnvcuvid.so.535.183.01' before installing new version: Invalid cross-device link
No apport report written because MaxReports is reached already
                                                              dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../5-libnvidia-encode-535_535.183.01-0ubuntu0.24.04.1_amd64.deb ...
Unpacking libnvidia-encode-535:amd64 (535.183.01-0ubuntu0.24.04.1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-rrVpFY/5-libnvidia-encode-535_535.183.01-0ubuntu0.24.04.1_amd64.deb (--unpack):
 unable to make backup link of './usr/lib/x86_64-linux-gnu/libnvidia-encode.so.535.183.01' before installing new version: Invalid cross-device link
No apport report written because MaxReports is reached already
                                                              Preparing to unpack .../6-nvidia-utils-535_535.183.01-0ubuntu0.24.04.1_amd64.deb ...
Unpacking nvidia-utils-535 (535.183.01-0ubuntu0.24.04.1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-rrVpFY/6-nvidia-utils-535_535.183.01-0ubuntu0.24.04.1_amd64.deb (--unpack):
 unable to make backup link of './usr/bin/nvidia-debugdump' before installing new version: Invalid cross-device link
No apport report written because MaxReports is reached already
                                                              dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../7-libnvidia-cfg1-535_535.183.01-0ubuntu0.24.04.1_amd64.deb ...
Unpacking libnvidia-cfg1-535:amd64 (535.183.01-0ubuntu0.24.04.1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-rrVpFY/7-libnvidia-cfg1-535_535.183.01-0ubuntu0.24.04.1_amd64.deb (--unpack):
 unable to make backup link of './usr/lib/x86_64-linux-gnu/libnvidia-cfg.so.535.183.01' before installing new version: Invalid cross-device link
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 /tmp/apt-dpkg-install-rrVpFY/0-nvidia-firmware-535-535.183.01_535.183.01-0ubuntu0.24.04.1_amd64.deb
 /tmp/apt-dpkg-install-rrVpFY/1-libnvidia-compute-535_535.183.01-0ubuntu0.24.04.1_amd64.deb
 /tmp/apt-dpkg-install-rrVpFY/2-libnvidia-extra-535_535.183.01-0ubuntu0.24.04.1_amd64.deb
 /tmp/apt-dpkg-install-rrVpFY/3-nvidia-compute-utils-535_535.183.01-0ubuntu0.24.04.1_amd64.deb
 /tmp/apt-dpkg-install-rrVpFY/4-libnvidia-decode-535_535.183.01-0ubuntu0.24.04.1_amd64.deb
 /tmp/apt-dpkg-install-rrVpFY/5-libnvidia-encode-535_535.183.01-0ubuntu0.24.04.1_amd64.deb
 /tmp/apt-dpkg-install-rrVpFY/6-nvidia-utils-535_535.183.01-0ubuntu0.24.04.1_amd64.deb
 /tmp/apt-dpkg-install-rrVpFY/7-libnvidia-cfg1-535_535.183.01-0ubuntu0.24.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

按照网上的方法尝试覆盖包、手动一次安装、强制安装,都无用,仍是一样的报错

类似的问题:Unable to install cuda (11.3) inside Ubuntu docker environment - CUDA / CUDA Setup and Installation - NVIDIA Developer Forums

无果,不是cuda指向错误

同样的错误:Unable to docker build on Linux kernel 4.19 · Issue #480 · docker/for-linux (github.com)

提到该报错有可能是 overlayfs 的问题或 dpkg 与 overlayfs 不兼容的问题。

Invalid cross-device link 错误通常在以下情况下发生:

  1. 跨文件系统操作:overlayfs 下的不同层可能被视为不同的文件系统,因此无法跨文件系统创建硬链接或符号链接。
  2. 虚拟化限制:在 Docker 容器或虚拟化环境中,使用 overlayfs 可能会导致文件操作的限制。

解决:

1.禁用 overlayfs 中的 metacopy:

echo N | sudo tee /sys/module/overlay/parameters/metacopy

报错:tee: /sys/module/overlay/parameters/metacopy: Read-only file system N

表示/sys/module/overlay/parameters/metacopy 文件所在的文件系统是只读的,因此无法修改 metacopy 参数。

只得求助外援,从宿主机那边格式化了容器,解决

相关推荐
SEVEN-YEARS2 分钟前
深入理解TensorFlow中的形状处理函数
人工智能·python·tensorflow
世优科技虚拟人5 分钟前
AI、VR与空间计算:教育和文旅领域的数字转型力量
人工智能·vr·空间计算
cloud studio AI应用12 分钟前
腾讯云 AI 代码助手:产品研发过程的思考和方法论
人工智能·云计算·腾讯云
禁默23 分钟前
第六届机器人、智能控制与人工智能国际学术会议(RICAI 2024)
人工智能·机器人·智能控制
Robot25131 分钟前
浅谈,华为切入具身智能赛道
人工智能
只怕自己不够好35 分钟前
OpenCV 图像运算全解析:加法、位运算(与、异或)在图像处理中的奇妙应用
图像处理·人工智能·opencv
果冻人工智能2 小时前
2025 年将颠覆商业的 8 大 AI 应用场景
人工智能·ai员工
代码不行的搬运工2 小时前
神经网络12-Time-Series Transformer (TST)模型
人工智能·神经网络·transformer
石小石Orz2 小时前
Three.js + AI:AI 算法生成 3D 萤火虫飞舞效果~
javascript·人工智能·算法
孤独且没人爱的纸鹤2 小时前
【深度学习】:从人工神经网络的基础原理到循环神经网络的先进技术,跨越智能算法的关键发展阶段及其未来趋势,探索技术进步与应用挑战
人工智能·python·深度学习·机器学习·ai