【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 参数。

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

相关推荐
边缘计算社区24 分钟前
首个!艾灵参编的工业边缘计算国家标准正式发布
大数据·人工智能·边缘计算
游客52035 分钟前
opencv中的各种滤波器简介
图像处理·人工智能·python·opencv·计算机视觉
一位小说男主35 分钟前
编码器与解码器:从‘乱码’到‘通话’
人工智能·深度学习
深圳南柯电子1 小时前
深圳南柯电子|电子设备EMC测试整改:常见问题与解决方案
人工智能
Kai HVZ1 小时前
《OpenCV计算机视觉》--介绍及基础操作
人工智能·opencv·计算机视觉
biter00881 小时前
opencv(15) OpenCV背景减除器(Background Subtractors)学习
人工智能·opencv·学习
吃个糖糖1 小时前
35 Opencv 亚像素角点检测
人工智能·opencv·计算机视觉
IT古董2 小时前
【漫话机器学习系列】017.大O算法(Big-O Notation)
人工智能·机器学习
凯哥是个大帅比2 小时前
人工智能ACA(五)--深度学习基础
人工智能·深度学习
m0_748232922 小时前
DALL-M:基于大语言模型的上下文感知临床数据增强方法 ,补充
人工智能·语言模型·自然语言处理