dpkg:警告:包“x"的文件列表文件丢失;假设软件包当前没有安装在 Ubuntu 16.04 中的文件 [英] Dpkg: warning: files list file for package 'x'missing; assuming package has no files currently installed in Ubuntu 16.04

查看:31
本文介绍了dpkg:警告:包“x"的文件列表文件丢失;假设软件包当前没有安装在 Ubuntu 16.04 中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 lubunut 桌面环境中使用 Ubuntu 16.04.我在执行 apt-get upgrade 时遇到以下问题超过 3 天.我不知道问题是什么意思以及如何解决.

I am using Ubuntu 16.04 with lubunut desktop environment. I had the following problem for more than 3 days when I do apt-get upgrade. I don't know what is problem means and how to solve.

注意:我尝试升级 Linux-header-4.4.66 前 3 天,但显示错误.我删除了它.现在,我回到 Linux-header-4.4.64,它之前运行良好.

Note: 3 days before I try upgrade Linux-header-4.4.66, but it showed an error. I deleted it. Now, I'm back to Linux-header-4.4.64, which worked fine before.

Error on sudo apt-get dist-upgrade (only last 15 line of 500+ line error):

dpkg: warning: files list file for package 'libxcb-xkb1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libvorbis-dev:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libavahi-core7:amd64' missing; assuming package has no files currently installed
(Reading database ... 37151 files and directories currently installed.)
Preparing to unpack .../libgtk-3-bin_3.18.9-1ubuntu3.2_amd64.deb ...
Adding 'diversion of /usr/sbin/update-icon-caches to /usr/sbin/update-icon-caches.gtk2 by libgtk-3-bin'
dpkg-divert: error: rename involves overwriting '/usr/sbin/update-icon-caches.gtk2' with
  different file '/usr/sbin/update-icon-caches', not allowed
dpkg: error processing archive /var/cache/apt/archives/libgtk-3-bin_3.18.9-1ubuntu3.2_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/libgtk-3-bin_3.18.9-1ubuntu3.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

推荐答案

我昨晚解决了这个问题.如果你懂中文,你可以在我的博客上阅读这个解决方案.我会在这里用我糟糕的英语详细说明.

I solved this problem at last night. If you know Chinese, you can read this solution on my blog. I'll detail it here with my poor English.

  • 在您的桌面或您想要的任何位置创建三个文件.

  • Create three files in you desktop or anywhere you want.

fix.sh
txt
fixit.py

  • 在这些文件中添加内容

  • Add contents in these files

    1. fix.sh:只是一个空文件.

    txt:将您的日志复制到此文件中,并使用\n"分隔每一行.就像这样:

    txt: Copy your log into this file with '\n' to separate each line. Just like this:

    dpkg: warning: files list file for package 'libxcb-xkb1:amd64' missing; assuming package has no files currently installed 
    dpkg: warning: files list file for package 'libvorbis-dev:amd64' missing; assuming package has no files currently installed
    

  • fixit.py:用以下内容填充文件.

  • fixit.py: fill the file with the following contents.

    #!/usr/bin/env python
        # -*- coding: utf-8 -*-
        __author__ = 'Fitzeng'
        import re
        def main():
            fix = open('fix.sh', 'w+')
            for line in open("txt"):
                pkg = re.match(re.compile('''dpkg: warning: files list file for package '(.+)' '''), line)
                if pkg:
                    cmd = "sudo apt-get install --reinstall " + pkg.group(1)
                    fix.write(cmd + '\n')
        if __name__ == "__main__":
            main()
    

  • 执行这些文件.

  • Execute these file.

    chmod 777 *
    python fixit.py
    ./fix.sh
    

  • 好的,问题解决了.实际上,您会发现您也可以重新安装这些软件包.因此,您可以通过多种方式修复它.

    OK, problem solved. Actually, you'll find you could alternately just reinstall these packages. So, you can fix it in many ways.

    这篇关于dpkg:警告:包“x"的文件列表文件丢失;假设软件包当前没有安装在 Ubuntu 16.04 中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆