apt-get --fix-broken 安装出现错误

apt-get --fix-broken 安装出现错误

所以今天我尝试安装 xubuntu-desktop,当我安装它时,它给出了一个错误,所以我尝试再次安装它,在我再次安装它后它给出了一个错误

root@pc:~# sudo apt-get install xubuntu-desktop
Reading package lists... Done
Building dependency tree       
Reading state information... Done
xubuntu-desktop is already the newest version (2.225).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 xubuntu-core : Depends: xubuntu-default-settings but it is not going to be installed
 xubuntu-desktop : Depends: xubuntu-default-settings but it is not going to be installed
                   Recommends: xfce4-quicklauncher-plugin but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

如果我运行apt --fix-broken install它也会出错

root@pc:~# sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  xubuntu-default-settings
The following NEW packages will be installed:
  xubuntu-default-settings
0 upgraded, 1 newly installed, 0 to remove and 30 not upgraded.
188 not fully installed or removed.
Need to get 0 B/35.7 kB of archives.
After this operation, 205 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 460197 files and directories currently installed.)
Preparing to unpack .../xubuntu-default-settings_18.04.6_all.deb ...
Unpacking xubuntu-default-settings (18.04.6) ...
dpkg: error processing archive /var/cache/apt/archives/xubuntu-default-settings_18.04.6_all.deb (--unpack):
 trying to overwrite '/etc/skel/.config/libreoffice/4/user/registrymodifications.xcu', which is also in package zorin-os-default-settings 15.6.6
Errors were encountered while processing:
 /var/cache/apt/archives/xubuntu-default-settings_18.04.6_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

如果我尝试卸载它,它也会给出一个错误,说要运行,apt --fix-broken install有人知道如何修复它吗?我使用基于 ubuntu 18.04 的 zorinos

答案1

使用force-overwrite选项dpkg

sudo dpkg -i --force-overwrite /var/cache/apt/archives/xubuntu-default-settings_18.04.6_all.deb
sudo apt install -f

相关内容