4

While installing any packages using the Sudo command I am facing the undermentioned error everytime.

For instance, if I am installing vim using the command $ sudo apt install vim I am getting the following output

Reading package lists... Done
Building dependency tree       
Reading state information... Done
vim is already the newest version (2:8.1.2269-1ubuntu5.3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up amdgpu-dkms (1:5.6.0.15-1098277) ...
Removing old amdgpu-5.6.0.15-1098277 DKMS files...

------------------------------
Deleting module version: 5.6.0.15-1098277
completely from the DKMS tree.
------------------------------
Done.
Loading new amdgpu-5.6.0.15-1098277 DKMS files...
Building for 5.11.0-37-generic
Building for architecture x86_64
Building initial module for 5.11.0-37-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/amdgpu-dkms.0.c
rash'
Error! Bad return status for module build on kernel: 5.11.0-37-generic (x86_64)
Consult /var/lib/dkms/amdgpu/5.6.0.15-1098277/build/make.log for more informatio
n.
dpkg: error processing package amdgpu-dkms (--configure):
 installed amdgpu-dkms package post-installation script subprocess returned erro
r exit status 10
dpkg: dependency problems prevent configuration of amdgpu:
 amdgpu depends on amdgpu-dkms (= 1:5.6.0.15-1098277); however:
  Package amdgpu-dkms is not configured yet.

dpkg: error processing package amdgpu (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
 amdgpu-dkms
 amdgpu
E: Sub-process /usr/bin/dpkg returned an error code (1)


I had tried to auto clean using $ sudo apt-get autoclean but it didn't work.

I also tried to force delete the amdgpu package using $ sudo apt-get --force-yes remove amdgpu-5.6.0.15-1098277

I got the following output

Reading package lists... Done
Building dependency tree       
Reading state information... Done
W: --force-yes is deprecated, use one of the options starting with --allow instead.
E: Unable to locate package amdgpu-5.6.0.15-1098277
E: Couldn't find any package by glob 'amdgpu-5.6.0.15-1098277'
E: Couldn't find any package by regex 'amdgpu-5.6.0.15-1098277'

Here is the output of the $ sudo apt-get update which was run prior to the installation :-

Ign:1 file:/var/opt/amdgpu-pro-local ./ InRelease
Get:2 file:/var/opt/amdgpu-pro-local ./ Release [816 B]
Get:2 file:/var/opt/amdgpu-pro-local ./ Release [816 B]
Get:3 file:/var/opt/amdgpu-pro-local ./ Release.gpg           
Ign:3 file:/var/opt/amdgpu-pro-local ./ Release.gpg      
Hit:4 http://archive.ubuntu.com/ubuntu focal InRelease   
Get:5 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Hit:7 http://dl.google.com/linux/chrome/deb stable InRelease
Get:8 http://archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1,256 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal-updates/main i386 Packages [544 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [283 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [864 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal-updates/universe i386 Packages [641 kB]
Get:14 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [361 kB]
Get:15 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [944 B]
Get:16 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [10.4 kB]
Get:17 http://archive.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [29.0 kB]
Get:18 http://archive.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [62.5 kB]
Get:19 http://archive.ubuntu.com/ubuntu focal-security/multiverse amd64 DEP-11 Metadata [2,464 B]
Fetched 4,383 kB in 3s (1,293 kB/s)                      
Reading package lists... Done
Building dependency tree       
Reading state information... Done
6 packages can be upgraded. Run 'apt list --upgradable' to see them.

While upgrading using $ sudo apt upgrade I am again facing the same problem and it is returning the following output:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  libnss-systemd libpam-systemd libsystemd0 systemd systemd-sysv
  systemd-timesyncd
6 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 4,400 kB of archives.
After this operation, 5,120 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libnss-systemd amd64 245.4-4ubuntu3.13 [95.8 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 systemd-timesyncd amd64 245.4-4ubuntu3.13 [28.1 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 systemd-sysv amd64 245.4-4ubuntu3.13 [10.3 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libpam-systemd amd64 245.4-4ubuntu3.13 [186 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 systemd amd64 245.4-4ubuntu3.13 [3,809 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libsystemd0 amd64 245.4-4ubuntu3.13 [270 kB]
Fetched 4,400 kB in 2s (1,831 kB/s)   
(Reading database ... 194179 files and directories currently installed.)
Preparing to unpack .../0-libnss-systemd_245.4-4ubuntu3.13_amd64.deb ...
Unpacking libnss-systemd:amd64 (245.4-4ubuntu3.13) over (245.4-4ubuntu3.11) ...
Preparing to unpack .../1-systemd-timesyncd_245.4-4ubuntu3.13_amd64.deb ...
Unpacking systemd-timesyncd (245.4-4ubuntu3.13) over (245.4-4ubuntu3.11) ...
Preparing to unpack .../2-systemd-sysv_245.4-4ubuntu3.13_amd64.deb ...
Unpacking systemd-sysv (245.4-4ubuntu3.13) over (245.4-4ubuntu3.11) ...
Preparing to unpack .../3-libpam-systemd_245.4-4ubuntu3.13_amd64.deb ...
Unpacking libpam-systemd:amd64 (245.4-4ubuntu3.13) over (245.4-4ubuntu3.11) ...
Preparing to unpack .../4-systemd_245.4-4ubuntu3.13_amd64.deb ...
Unpacking systemd (245.4-4ubuntu3.13) over (245.4-4ubuntu3.11) ...
Preparing to unpack .../5-libsystemd0_245.4-4ubuntu3.13_amd64.deb ...
Unpacking libsystemd0:amd64 (245.4-4ubuntu3.13) over (245.4-4ubuntu3.11) ...
Setting up libsystemd0:amd64 (245.4-4ubuntu3.13) ...
Setting up amdgpu-dkms (1:5.6.0.15-1098277) ...
Removing old amdgpu-5.6.0.15-1098277 DKMS files...

------------------------------
Deleting module version: 5.6.0.15-1098277
completely from the DKMS tree.
------------------------------
Done.
Loading new amdgpu-5.6.0.15-1098277 DKMS files...
Building for 5.11.0-37-generic
Building for architecture x86_64
Building initial module for 5.11.0-37-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/amdgpu-dkms.0.c
rash'
Error! Bad return status for module build on kernel: 5.11.0-37-generic (x86_64)
Consult /var/lib/dkms/amdgpu/5.6.0.15-1098277/build/make.log for more informatio
n.
dpkg: error processing package amdgpu-dkms (--configure):
 installed amdgpu-dkms package post-installation script subprocess returned erro
r exit status 10
dpkg: dependency problems prevent configuration of amdgpu:
 amdgpu depends on amdgpu-dkms (= 1:5.6.0.15-1098277); however:
  Package amdgpu-dkms is not configured yet.

dpkg: error processing package amdgpu (--configure):
 dependency problems - leaving unconfigured
Setting up systemd (245.4-4ubuntu3.13) ...
No apport report written because the error message indicates its a followup erro
r from a previous failure.
                          Installing new version of config file /etc/dhcp/dhclie
nt-enter-hooks.d/resolved ...
Setting up systemd-timesyncd (245.4-4ubuntu3.13) ...
Setting up systemd-sysv (245.4-4ubuntu3.13) ...
Setting up libnss-systemd:amd64 (245.4-4ubuntu3.13) ...
Setting up libpam-systemd:amd64 (245.4-4ubuntu3.13) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for dbus (1.12.16-2ubuntu2.1) ...
Errors were encountered while processing:
 amdgpu-dkms
 amdgpu
E: Sub-process /usr/bin/dpkg returned an error code (1)

How to fix the issue ?

0

1 Answer 1

4

amdgpu and amdgpu-dkms are the problematic packages here because they are either not fully installed or corrupted.

Follow the below steps to fix this issue:

  1. Purge the problematic packages:

    sudo dpkg -P amdgpu && sudo dpkg -P amdgpu-dkms 
    

    More likely this will work! But sometimes it returns the same error.

  2. In that case, you must manually delete it by running the following:

    sudo mv /var/lib/dpkg/info/amdgpu* /tmp
    

    This will move all the components of the package you listed to the /tmp directory. You can later remove them if you want.

  3. Then run these commands to update the software cache:

    sudo apt update 
    sudo apt upgrade -y
    

Feel free to ask me any questions in the comments.
Good Luck!

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.