Apt dist-upgrade failed - dpkg error

(base) zhanghui@zhanghui-orin:/home1/zhanghui$ sudo apt update
[sudo] password for zhanghui:
Hit:1 Index of /ubuntu-ports focal InRelease
Hit:2 https://repo.download.nvidia.cn/jetson/common r34.1 InRelease
Hit:3 https://repo.download.nvidia.cn/jetson/t234 r34.1 InRelease
Hit:4 Index of /ubuntu-ports focal-updates InRelease
Hit:5 Index of /ubuntu-ports focal-backports InRelease
Hit:6 Index of /ubuntu-ports focal-security InRelease
Reading package lists… Done
Building dependency tree
Reading state information… Done
All packages are up to date.

(base) zhanghui@zhanghui-orin:/home1/zhanghui$ sudo apt dist-upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
You might want to run ‘apt --fix-broken install’ to correct these.
The following packages have unmet dependencies:
cuda-libraries-dev-11-4 : Depends: cuda-profiler-api-11-4 (>= 11.4.239) but it is not installed
E: Unmet dependencies. Try ‘apt --fix-broken install’ with no packages (or specify a solution).
(base) zhanghui@zhanghui-orin:/home1/zhanghui$ sudo apt --fix-broken install
Reading package lists… Done
Building dependency tree
Reading state information… Done
Correcting dependencies… Done
The following packages were automatically installed and are no longer required:
apt-clone archdetect-deb bogl-bterm busybox-static cryptsetup-bin cuda-nvprof-11-4 dctrl-tools dpkg-repack gdal-data gir1.2-timezonemap-1.0 gir1.2-xkl-1.0
grub-common libarmadillo9 libarpack2 libavcodec-dev libavformat-dev libavresample-dev libavresample4 libavutil-dev libcfitsio8 libcharls2 libdap25
libdapclient6v5 libdc1394-22-dev libdebian-installer4 libepsilon1 libexif-dev libfreexl1 libfwupdplugin1 libfyba0 libgdal26 libgdcm-dev libgdcm3.0
libgeos-3.8.0 libgeos-c1v5 libgeotiff5 libgl2ps1.4 libgphoto2-dev libhdf4-0-alt libhdf5-openmpi-103 libilmbase-dev libjbig-dev libkmlbase1 libkmldom1
libkmlengine1 liblept5 libminizip1 libnetcdf-c++4 libnetcdf15 libodbc1 libogdi4.1 libopencv-calib3d4.2 libopencv-contrib4.2 libopencv-dnn4.2
libopencv-features2d4.2 libopencv-flann4.2 libopencv-highgui4.2 libopencv-imgcodecs4.2 libopencv-imgproc4.2 libopencv-ml4.2 libopencv-objdetect4.2
libopencv-photo4.2 libopencv-shape4.2 libopencv-stitching4.2 libopencv-superres4.2 libopencv-video4.2 libopencv-videoio4.2 libopencv-videostab4.2
libopencv-viz4.2 libopencv4.2-java libopencv4.2-jni libopenexr-dev libpq5 libproj15 libqhull7 libraw1394-dev libsocket++1 libspatialite7 libsuperlu5
libswresample-dev libswscale-dev libtbb-dev libtesseract4 libtiff-dev libtiffxx5 libtimezonemap-data libtimezonemap1 liburiparser1 libvtk6.3 libxerces-c3.2
nsight-systems-linux-tegra-public-2021.5.4.20-6e27cb6 odbcinst odbcinst1debian2 os-prober proj-data python3-icu python3-pam rdate tasksel tasksel-data
Use ‘sudo apt autoremove’ to remove them.
The following additional packages will be installed:
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
50 not fully installed or removed.
Need to get 0 B/18.6 kB of archives.
After this operation, 90.1 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
debconf: delaying package configuration, since apt-utils is not installed
(Reading database … 171166 files and directories currently installed.)
Preparing to unpack …/cuda-profiler-api-11-4_11.4.239-1_arm64.deb …
Unpacking cuda-profiler-api-11-4 (11.4.239-1) …
dpkg: error processing archive /var/cache/apt/archives/cuda-profiler-api-11-4_11.4.239-1_arm64.deb (–unpack):
trying to overwrite ‘/usr/local/cuda-11.4/targets/aarch64-linux/include/cudaProfiler.h’, which is also in package cuda-nvprof-11-4 11.4.166-1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Hi zhang_hui,

Please try below command:

sudo apt-get install -y cuda-toolkit-11-4
sudo apt update
sudo apt dist-upgrade

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.