如何修复未安装的 amdgpu 和 amdgpu-dkms 包?

如何修复未安装的 amdgpu 和 amdgpu-dkms 包?

我正在尝试安装 amdgpu 包但出现一堆错误:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  dctrl-tools dh-dkms libcfitsio9 libgdal31 libmpdec3 libnginx-mod-http-geoip libnginx-mod-http-image-filter libnginx-mod-http-xslt-filter libnginx-mod-mail libnginx-mod-stream libnginx-mod-stream-geoip
  libpoppler123 libprotobuf23 libpython3.10 libpython3.10-dev libpython3.10-minimal libpython3.10-stdlib libtiff5 libzxingcore1 linux-headers-6.1.0-kali5-common linux-kbuild-6.1 nginx-common nginx-core
  python-pastedeploy-tpl python3-commonmark python3-speaklater python3.10 python3.10-dev python3.10-minimal ruby3.0 ruby3.0-dev ruby3.0-doc
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  amdgpu amdgpu-dkms
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/9,848 kB of archives.
After this operation, 428 MB of additional disk space will be used.
Selecting previously unselected package amdgpu-dkms.
(Reading database ... 503090 files and directories currently installed.)
Preparing to unpack .../amdgpu-dkms_1%3a5.18.13.50403-1538762.22.04_all.deb ...
Unpacking amdgpu-dkms (1:5.18.13.50403-1538762.22.04) ...
Selecting previously unselected package amdgpu.
Preparing to unpack .../amdgpu_1%3a5.4.50403-1538762.22.04_amd64.deb ...
Unpacking amdgpu (1:5.4.50403-1538762.22.04) ...
Setting up amdgpu-dkms (1:5.18.13.50403-1538762.22.04) ...
Loading new amdgpu-5.18.13-1538762.22.04 DKMS files...
Building for 6.0.0-kali6-amd64
Building for architecture amd64
Building initial module for 6.0.0-kali6-amd64
Error! Bad return status for module build on kernel: 6.0.0-kali6-amd64 (amd64)
Consult /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/make.log for more information.
dpkg: error processing package amdgpu-dkms (--configure):
 installed amdgpu-dkms package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of amdgpu:
 amdgpu depends on amdgpu-dkms; however:
  Package amdgpu-dkms is not configured yet.

dpkg: error processing package amdgpu (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 amdgpu-dkms
 amdgpu
E: Sub-process /usr/bin/dpkg returned an error code (1)

无论如何,我尝试重新安装它们,但没有用。apt purge 或 apt upgrade 之后都没有用。我有点迷茫了。我读了/var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/make.log日志,看起来问题在于它试图安装6.0.1-kali5-amd64而不是 的软件包6.0.0-kali6-amd64。但我不知道如何修复它。在我更新系统后,这种情况开始发生。新内核一直抛出“内核恐慌 - 不同步”,所以我卸载了它。看起来 apt 认为旧内核仍然安装着。如果这有帮助的话,以下是日志:

DKMS make.log for amdgpu-5.18.13-1538762.22.04 for kernel 6.0.0-kali6-amd64 (amd64)
Thu Apr  6 09:08:53 PM CEST 2023
make: Entering directory '/usr/src/linux-headers-6.0.0-kali6-amd64'
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/scheduler/sched_main.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_tt.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/main.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdgpu/amdgpu_drv.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/symbols.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_common.o
In file included from /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdgpu/amdgpu.h:69,
                 from /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/backport/include/kcl/kcl_amdgpu_drm_fb_helper.h:35,
                 from /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/backport/backport.h:84,
                 from <command-line>:
/var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdgpu/amdgpu_mode.h:308:32: error: field ‘base’ has incomplete type
  308 |         struct drm_framebuffer base;
      |                                ^~~~
In file included from /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/backport/backport.h:85:
/var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/backport/include/kcl/kcl_amdgpu_drm_gem_framebuffer_helper.h: In function ‘kcl_drm_gem_fb_set_obj’:
/var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/backport/include/kcl/kcl_amdgpu_drm_gem_framebuffer_helper.h:12:19: error: invalid use of undefined type ‘struct drm_framebuffer’
   12 |                 fb->obj[index] = obj;
      |                   ^~
make[2]: *** [/usr/src/linux-headers-6.0.0-kali6-common/scripts/Makefile.build:254: /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdgpu/amdgpu_drv.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.0.0-kali6-common/scripts/Makefile.build:470: /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdgpu] Error 2
make[1]: *** Waiting for unfinished jobs....
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/scheduler/sched_fence.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_kernel_params.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_bo.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/dma-buf/dma-resv.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/scheduler/sched_entity.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_backlight.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_ioctl.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_bo_util.o
  LD [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/scheduler/amd-sched.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_bo_vm.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_kthread.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_io.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_perf_event.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_seq_file.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_suspend.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_pci.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_mm.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_module.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_execbuf_util.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_memory.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_range_manager.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_sched.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_fence.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_resource.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_fence_array.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_pool.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_reservation.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_cache.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_auth.o
/var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_pool.c: In function ‘ttm_pool_mgr_init’:
/var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_pool.c:726:16: error: too few arguments to function ‘register_shrinker’
  726 |         return register_shrinker(&mm_shrinker);
      |                ^~~~~~~~~~~~~~~~~
In file included from /usr/src/linux-headers-6.0.0-kali6-common/include/linux/mm.h:20,
                 from /usr/src/linux-headers-6.0.0-kali6-common/include/linux/scatterlist.h:8,
                 from /usr/src/linux-headers-6.0.0-kali6-common/include/linux/dma-mapping.h:10,
                 from /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/include/kcl/kcl_dma_mapping.h:5,
                 from /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/backport/backport.h:9,
                 from <command-line>:
/usr/src/linux-headers-6.0.0-kali6-common/include/linux/shrinker.h:99:27: note: declared here
   99 | extern int __printf(2, 3) register_shrinker(struct shrinker *shrinker,
      |                           ^~~~~~~~~~~~~~~~~
/var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_pool.c:727:1: error: control reaches end of non-void function [-Werror=return-type]
  727 | }
      | ^
cc1: some warnings being treated as errors
make[2]: *** [/usr/src/linux-headers-6.0.0-kali6-common/scripts/Makefile.build:254: /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_pool.o] Error 1
make[2]: *** Waiting for unfinished jobs....
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_fb.o
make[1]: *** [/usr/src/linux-headers-6.0.0-kali6-common/scripts/Makefile.build:470: /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm] Error 2
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_print.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_fbmem.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_crtc.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_connector.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_atomic_helper.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_device_cgroup.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_mn.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_modes.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_time.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_ftrace.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_acpi_table.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_page_alloc.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_numa.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_fs_read_write.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_aperture.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_drv.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_simple_kms_helper.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_bitmap.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_vmscan.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_dma_fence_chain.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_mce_amd.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_workqueue.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_cpumask.o
/var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_cpumask.c:6:1: warning: "/*" within comment [-Wcomment]
    6 | /**
      |  
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_dsc_helper.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_debugfs_inode.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_sysfs_emit.o
  LD [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/amdkcl.o
make: *** [/usr/src/linux-headers-6.0.0-kali6-common/Makefile:1876: /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build] Error 2
make: Leaving directory '/usr/src/linux-headers-6.0.0-kali6-amd64'

先感谢您

相关内容