【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 错误通常在以下情况下发生:
- 跨文件系统操作:overlayfs 下的不同层可能被视为不同的文件系统,因此无法跨文件系统创建硬链接或符号链接。
- 虚拟化限制:在 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 参数。
只得求助外援,从宿主机那边格式化了容器,解决