升级 xorg 时出现“dpkg-divert:错误:重命名涉及用不同的文件‘protocol-precise.txt’覆盖‘protocol.txt’”

升级 xorg 时出现“dpkg-divert:错误:重命名涉及用不同的文件‘protocol-precise.txt’覆盖‘protocol.txt’”

下载 Ubuntu 13.04 后就会发生这种情况,由于这个问题我甚至无法下载东西:

root@Viktor-Dator:/home/viktor# sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
xserver-common-lts-raring
The following packages have been kept back:
libboost-dev libboost-filesystem-dev libboost-regex-dev libboost-system-dev
libboost-thread-dev
0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded.
1 not fully installed or removed.
After this operation, 1,646 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 264683 files and directories currently installed.)
Removing xserver-common-lts-raring ...
Removing 'diversion of /usr/lib/xorg/protocol.txt to /usr/lib/xorg/protocol-precise.txt by xserver-common-lts-raring'
dpkg-divert: error: rename involves overwriting `/usr/lib/xorg/protocol.txt' with
different file `/usr/lib/xorg/protocol-precise.txt', not allowed
dpkg: error processing xserver-common-lts-raring (--remove):
subprocess installed post-removal script returned error exit status 2
No apport report written because MaxReports is reached already
Errors were encountered while processing:
xserver-common-lts-raring
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@Viktor-Dator:/home/viktor# 

输出关闭 sudo apt-get check

viktor@Viktor-Dator:~$ sudo apt-get check
[sudo] password for viktor: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
viktor@Viktor-Dator:~$ 

答案1

好的,因为显然不是任何坏的包,我们必须在没有 apt-get 帮助的情况下手动将其删除:

sudo apt-get update
sudo apt-get -s --reinstall install xserver-common
sudo dpkg --purge --force-all xserver-common-lts-raring
sudo apt-get --reinstall install xserver-common
sudo apt-get autoremove

现在您可能想要取消保留已保留的包裹:

sudo dpkg --set-selections < echo "libboost-dev install"
sudo dpkg --set-selections < echo "libboost-filesystem-dev install"
sudo dpkg --set-selections < echo "libboost-regex-dev install"
sudo dpkg --set-selections < echo "libboost-system-dev install"
sudo dpkg --set-selections < echo "libboost-thread-dev install"

进行最后sudo apt-get check验证以确保一切正常。

答案2

首先,您需要清除您的控制台,因此只需尝试此命令即可清除系统中的故障依赖关系。然后您可以再次安装任何插件。

sudo dpkg -r libjack-jackd2-0
sudo apt-get -f install
sudo apt-get update
sudo apt-get upgrade

该命令会删除有问题的文件,尝试修复损坏的依赖关系并更新您的系统。

相关内容