dpkg 错误[自己已经解决] 添加一个修复脚本

Xenial Xerus (长期支持)
回复
loveofmaria
帖子: 31
注册时间: 2012-09-02 19:55
送出感谢: 1 次
接收感谢: 0

dpkg 错误[自己已经解决] 添加一个修复脚本

#1

帖子 loveofmaria » 2017-09-07 16:24

代码: 全选

dpkg: warning: files list file for package 'vlc-plugin-samba' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'example-content' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'ureadahead' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'session-shortcuts' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'python3' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'geoclue' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'update-notifier-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpulsedsp:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libio-pty-perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libwinpr-handle0.1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'x11-xkb-utils' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gvfs-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libdrm-amdgpu1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libwind0-heimdal:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gsfonts' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libevdev2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'hunspell-en-za' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libhttp-cookies-perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'python3-cffi-backend' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gir1.2-rb-3.0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libqt5organizer5:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'fonts-tlwg-laksaman-ttf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gnome-calculator' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libreoffice-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libencode-locale-perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'python3-lxml' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libnm-glib4:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgcrypt20:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libperlio-gzip-perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'bpython' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libwebrtc-audio-processing-0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libreoffice-impress' missing; assuming package has no files currently installed
自己查了下资料,基本上都是说要 reinstall 提示错误的包
我自己写了个python脚本,自动安装,但是完成后还是这样,搞了一下午了,求帮助!
修复脚本

代码: 全选

#!/bin/bash
set -e

# Clean out /var/cache/apt/archives
apt-get clean
# Fill it with all the .debs we need
apt-get --reinstall -dy install $(dpkg --get-selections | grep '[[:space:]]install' | cut -f1)

DIR=$(mktemp -d -t info-XXXXXX)
for deb in /var/cache/apt/archives/*.deb
do
    # Move to working directory
    cd "$DIR"
    # Create DEBIAN directory
    mkdir -p DEBIAN
    # Extract control files
    dpkg-deb -e "$deb"
    # Extract file list, fixing up the leading ./ and turning / into /.
    dpkg-deb -c "$deb" | awk '{print $NF}' | cut -c2- | sed -e 's/^\/$/\/./' > DEBIAN/list
    # Figure out binary package name
    DEB=$(basename "$deb" | cut -d_ -f1)
    # Copy each control file into place
    cd DEBIAN
    for file in *
    do
        cp -a "$file" /var/lib/dpkg/info/"$DEB"."$file"
    done
    # Clean up
    cd ..
    rm -rf DEBIAN
done
rmdir "$DIR"
脚本的转载地址:https://gist.github.com/jeffersfp/33037 ... 057930c81b
头像
九天星
帖子: 1317
注册时间: 2007-07-14 20:45
送出感谢: 67 次
接收感谢: 37 次

Re: dpkg 错误[自己已经解决] 添加一个修复脚本

#2

帖子 九天星 » 2017-09-07 21:14

我猜你用的是ubuntu 14.04 版本,对吗?
开源、共享、自由

微信号非公众号:xfiles_sky

用手机点击这里有奇迹发生,其他无效
回复

回到 “Ubuntu 16.04 LTS”