如何修复 apt-get 更新 wireshark 时损坏的问题

如何修复 apt-get 更新 wireshark 时损坏的问题

几个月前更新后,Wireshark 无法更新。我学会了取消选中它,但今天忘了。更新程序已下载所有更新。我尝试更新时收到以下错误消息。当我尝试使用 apt-get remove 和 apt-get purge 来摆脱 Wireshark 时,我可能犯了一个错误。

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  libwireshark-data
The following NEW packages will be installed:
  libwireshark-data
0 upgraded, 1 newly installed, 0 to remove and 24 not upgraded.
1 not fully installed or removed.
Need to get 0 B/848 kB of archives.
After this operation, 5,292 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 233363 files and directories currently installed.)
Preparing to unpack .../libwireshark-data_1.99.6+git20150422121542~afb70bba-0ubuntu1~trusty1~ppa0_all.deb ...
Unpacking libwireshark-data (1.99.6+git20150422121542~afb70bba-0ubuntu1~trusty1~ppa0) ...
dpkg: error processing archive /var/cache/apt/archives/libwireshark-data_1.99.6+git20150422121542~afb70bba-0ubuntu1~trusty1~ppa0_all.deb (--unpack):
 trying to overwrite '/usr/share/wireshark/dtds/pocsettings.dtd', which is also in package wireshark-common 1.99.0+git20140730111853~82bb8008-0ubuntu1~trusty1~ppa0
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/libwireshark-data_1.99.6+git20150422121542~afb70bba-0ubuntu1~trusty1~ppa0_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
programmer@fireimager:~$ sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of libwireshark0:amd64:
 libwireshark0:amd64 depends on libwireshark-data (>= 1.99.6+git20150422121542~afb70bba-0ubuntu1~trusty1~ppa0); however:
  Package libwireshark-data is not installed.

dpkg: error processing package libwireshark0:amd64 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libwireshark0:amd64

这也失败了。

apt-get -f install

我该如何修复 apt-get DB?

编辑

根据 Terrance 的评论,我再次搜索并发现:

sudo dpkg --remove --force-remove-reinstreq wireshark
sudo dpkg --remove -force --force-remove-reinstreqgrep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* wireshark

我运行了第一个命令但第二个命令似乎格式不正确。

/usr/share/wireshark我发现这些文件和目录(partial是空的)时。

libwireshark-data_1.99.6+git20150422121542~afb70bba-0ubuntu1~trusty1~ppa0_all.deb  
libwireshark-data_1.99.6+git20150424075214~b284de81-0ubuntu1~trusty1~ppa0_all.deb  
lock  
partial

/usr/share/wireshark有几个目录和文件。

没有 Wireshark 我也可以过得很好。

编辑

apt-cache policy libwireshark-data

libwireshark-data:
  Installed: 1.99.6+git20150430165916~3bf0d14a-0ubuntu1~trusty1~ppa0
  Candidate: 1.99.6+git20150430165916~3bf0d14a-0ubuntu1~trusty1~ppa0
  Version table:
 *** 1.99.6+git20150430165916~3bf0d14a-0ubuntu1~trusty1~ppa0 0
    500 http://ppa.launchpad.net/dreibh/ppa/ubuntu/ trusty/main amd64 Packages
    100 /var/lib/dpkg/status
 1.10.6-1 0
    500 http://apt-cache policy wireshark-common/ubuntu/ trusty/universe amd64 Packages

apt-cache policy wireshark-common

wireshark-common:
  Installed: 1.99.6+git20150430165916~3bf0d14a-0ubuntu1~trusty1~ppa0
  Candidate: 1.99.6+git20150430165916~3bf0d14a-0ubuntu1~trusty1~ppa0
  Version table:
 *** 1.99.6+git20150430165916~3bf0d14a-0ubuntu1~trusty1~ppa0 0
    500 http://ppa.launchpad.net/dreibh/ppa/ubuntu/ trusty/main amd64 Packages
    100 /var/lib/dpkg/status
 1.10.6-1 0
    500 http://us.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages

答案1

我认为以下步骤无法解决问题。两个包,wireshark-commonlibwireshark-data尝试创建相同的文件。请联系托马斯·德雷布霍尔茨


我们还是尝试一下吧。

可能会aptitude提出不同的冲突解决方案。查看所有建议并选择最佳方案。我无法预见问题。你得靠自己。

  1. 安装两个工具:

    sudo apt-get install ppa-purge
    sudo apt-get install aptitude
    

    以下步骤可能会aptitude提出不同的冲突解决方案。查看所有建议并选择最佳方案。我无法预见问题。您只能依靠自己。

  2. 家政:

    sudo aptitude clean
    
  3. 临时删除 PPA ppa:dreibh/ppa

    sudo ppa-purge ppa:dreibh/ppa
    
  4. 删除 wireshark:

    sudo aptitude remove wireshark
    
  5. 再次添加 PPA:

    sudo apt-add-repository ppa:dreibh/ppa
    
  6. 安装wireshark

    sudo aptitude install wireshark
    

答案2

pocsettings.dtd因此,libwireshark-data 和 libwireshark-common 软件包中至少包含一个文件。尝试从以下位置删除该文件名:

/var/lib/dpkg/info/libwireshark-common.list

所以它不知道该冲突并会安装新版本。

答案3

在终端中尝试这个:

rm -fr  /var/cache/apt/archives/libwireshark-data_1.99.6+git20150422121542~afb70bba-0ubuntu1~trusty1~ppa0_all.deb
apt-get clean
apt-get update
dpkg --purge libwireshark-data
dpkg --purge wireshark*
apt-get install -f

它必须有助于清理你的 apt-get,并安装新的软件包

相关内容