E: 子进程 /usr/bin/dpkg 返回错误代码 (1) 以及其他错误

E: 子进程 /usr/bin/dpkg 返回错误代码 (1) 以及其他错误

当我尝试更新 OpenGL(另一天的问题,但如果你能在这方面提供帮助,我将不胜感激)时,我开始遇到以下问题所以我做了:

root@Friithian:/home/gunqqer# apt autoremove  
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 libdrm-dev : Depends: libdrm-amdgpu1 (= 2.4.89+git1712180630.831036~oibaf~x) but 2.4.83-1~16.04.1 is installed
 libgl1-mesa-dri : Depends: libdrm-amdgpu1 (>= 2.4.89+git1712180630.831036~oibaf~x) but 2.4.83-1~16.04.1 is installed
 libgl1-mesa-dri:i386 : Depends: libdrm-amdgpu1:i386 (>= 2.4.89+git1712180630.831036~oibaf~x) but 2.4.83-1~16.04.1 is installed
 mesa-va-drivers : Depends: libdrm-amdgpu1 (>= 2.4.89+git1712180630.831036~oibaf~x) but 2.4.83-1~16.04.1 is installed
 mesa-vdpau-drivers : Depends: libdrm-amdgpu1 (>= 2.4.89+git1712180630.831036~oibaf~x) but 2.4.83-1~16.04.1 is installed
E: Unmet dependencies. Try using -f.

于是我就这么做了

root@Friithian:/home/gunqqer# apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
  libdrm-common
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  libdrm-amdgpu1 libdrm-amdgpu1:i386
The following packages will be upgraded:
  libdrm-amdgpu1 libdrm-amdgpu1:i386
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
15 not fully installed or removed.
Need to get 0 B/60.1 kB of archives.
After this operation, 16.4 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 232943 files and directories currently installed.)
Preparing to unpack .../libdrm-amdgpu1_2.4.89+git1712180630.831036~oibaf~x_amd64.deb ...
De-configuring libdrm-amdgpu1:i386 (2.4.83-1~16.04.1) ...
Unpacking libdrm-amdgpu1:amd64 (2.4.89+git1712180630.831036~oibaf~x) over (2.4.83-1~16.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/libdrm-amdgpu1_2.4.89+git1712180630.831036~oibaf~x_amd64.deb (--unpack):
 trying to overwrite '/usr/share/libdrm/amdgpu.ids', which is also in package libdrm-common 2.4.83-1~16.04.1
Preparing to unpack .../libdrm-amdgpu1_2.4.89+git1712180630.831036~oibaf~x_i386.deb ...
De-configuring libdrm-amdgpu1:amd64 (2.4.83-1~16.04.1) ...
Unpacking libdrm-amdgpu1:i386 (2.4.89+git1712180630.831036~oibaf~x) over (2.4.83-1~16.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/libdrm-amdgpu1_2.4.89+git1712180630.831036~oibaf~x_i386.deb (--unpack):
 trying to overwrite '/usr/share/libdrm/amdgpu.ids', which is also in package libdrm-common 2.4.83-1~16.04.1
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Errors were encountered while processing:
 /var/cache/apt/archives/libdrm-amdgpu1_2.4.89+git1712180630.831036~oibaf~x_amd64.deb
 /var/cache/apt/archives/libdrm-amdgpu1_2.4.89+git1712180630.831036~oibaf~x_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

所以,我不知道该怎么做才能解决这个问题。如果您需要我运行命令并告诉您结果,我可以。

答案1

这是由默认dpkg覆盖状态引起的。未经您的许可,dpkg 不会覆盖共享文件夹。解决方法:

Ctrl++AltT 执行:

sudo apt-get -o Dpkg::Options::="--force-overwrite" -f install

希望能帮助到你...

相关内容