如何修復不允許我安裝或更新任何內容的錯誤代碼?

如何修復不允許我安裝或更新任何內容的錯誤代碼?

這是每次我嘗試更新或安裝任何內容時顯示的訊息:

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 未配置到該新版本。一般來說,對像 Gnome 這樣作為系統組成部分的東西使用 PPA 並不是一個好主意,但我離題了。您應該修復 /etc/apt/sources.list 和 /etc/apt/sources.list.d

相關內容