无法升级 Debian 桌面文件实用程序

无法升级 Debian 桌面文件实用程序

我尝试安装几个 BioLinux 软件包 -> 之前的几个软件包都“坏了”。在我运行之后:

apt-get -f install

apt-get upgrade 


apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages have been kept back:
r-cran-mass
The following packages will be upgraded:
desktop-file-utils

WARNING: The following packages cannot be authenticated!
desktop-file-utils
Install these packages without verification [y/N]? y
Reading changelogs... Done
(Reading database ... 
   dpkg: warning: files list file for package `desktop-file-utils' missing, assuming   package has no files currently installed.

Preparing to replace desktop-file-utils 0.15-2 (using .../desktop-file-utils_0.16- 0ubuntu2_amd64.deb) ...
Unpacking replacement desktop-file-utils ...
dpkg: error processing /var/cache/apt/archives/desktop-file-utils_0.16-0ubuntu2_amd64.deb (--unpack):
trying to overwrite '/etc/gnome/defaults.list', which is also in package gnome-session-common 2.30.2-3
 configured to not write apport reports
 Processing triggers for gnome-menus ...
 Processing triggers for man-db ...
 Errors were encountered while processing:
 /var/cache/apt/archives/desktop-file-utils_0.16-0ubuntu2_amd64.deb
 E: Sub-process /usr/bin/dpkg returned an error code (1)

我也尝试过重新安装它,更新全部,升级,再重新安装,但遇到了同样的问题。

有人知道该如何修复吗?(虽然不需要重新安装操作系统)

答案1

不太明白你是怎么陷入这种情况的,但 apt 告诉你它将覆盖,/etc/gnome/defaults.list这只是 gnome 的默认程序列表:

$ head /etc/gnome/defaults.list
[Default Applications]
application/rtf=abiword.desktop
application/x-abiword=abiword.desktop
text/abiword=abiword.desktop
text/richtext=abiword.desktop
text/rtf=abiword.desktop
text/x-abiword=abiword.desktop
text/x-xml-abiword=abiword.desktop
x-content/blank-bd=brasero-nautilus.desktop
x-content/blank-dvd=brasero-nautilus.desktop

您可以使用以下几种方法来“修复”此问题:

  1. 什么也不要做。除非有特殊原因要升级,否则desktop-file-utils您可以保持系统原样。

  2. 删除(重命名)有问题的文件并尝试再次升级。之后您可以随时将其移回:

    mv /etc/gnome/defaults.list /etc/gnome/defaults.list.bak
    apt-get upgrade 
    

    现在,您可以将原始文件与新文件进行比较,并决定保留哪一个:

    diff /etc/gnome/defaults.list /etc/gnome/defaults.list.bak
    

    或者你可以简单地将旧的复制回来:

    mv /etc/gnome/defaults.list.bak /etc/gnome/defaults.list
    
  3. 您可以强制apt-get命令覆盖文件

    apt-get -o Dpkg::Options::="--force-overwrite" upgrade
    

相关内容