如何修复不允许我安装或更新任何内容的错误代码?

如何修复不允许我安装或更新任何内容的错误代码?

这是我每次尝试更新或安装任何内容时显示的消息:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libvdpau1
The following NEW packages will be installed:
  libvdpau1
0 upgraded, 1 newly installed, 0 to remove and 24 not upgraded.
298 not fully installed or removed.
Need to get 0 B/25.6 kB of archives.
After this operation, 109 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 162877 files and directories currently installed.)
Preparing to unpack .../libvdpau1_1.3-1ubuntu2_amd64.deb ...
Unpacking libvdpau1:amd64 (1.3-1ubuntu2) ...
dpkg: error processing archive /var/cache/apt/archives/libvdpau1_1.3-1ubuntu2_am
d64.deb (--unpack):
 trying to overwrite shared '/etc/vdpau_wrapper.cfg', which is different from ot
her instances of package libvdpau1:amd64
Errors were encountered while processing:
 /var/cache/apt/archives/libvdpau1_1.3-1ubuntu2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
```output of ls -la /etc/apt/sources.list.d/

答案1

尝试这个:

sudo apt clean
sudo apt update
sudo apt install --reinstall libvdpau1
sudo apt --fix-broken install

解释:

  1. apt clean- 清理下载包缓存;这将导致再次下载包文件。
  2. apt update- 更新存储软件包列表的数据库
  3. apt install --reinstall libvdpau1libvdpau1重新安装似乎导致问题的软件包
  4. apt --fix-broken install- 尝试纠正损坏的依赖关系

答案2

我会尝试以下操作:

sudo dpkg --configure -a

另外,我会暂时删除 libvdpau1,并尝试使用“dpkg --configure”和“apt --fix-broken”使一切正常运行。您可能希望使用以下命令将其删除:

sudo dpkg -r --force-depends libvdpau1

这是为了防止删除其他任何内容。请注意,如果有依赖 libvdpau1 的软件包,但您的软件包系统已经处于损坏状态,这将暂时使您的软件包系统处于损坏状态。

一旦一切正常,请尝试重新安装它。

Gnome PPA 缺少发布文件的错误似乎与您当前的问题无关。这可能是由于在更新到较新版本(Focal)后激活了 PPA,并且 PPA 未配置为该新版本。一般来说,使用 PPA 作为系统不可或缺的一部分(如 Gnome)并不是一个好主意,但我离题了。您应该修复 /etc/apt/sources.list 和 /etc/apt/sources.list.d

相关内容