当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 2 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : dpkg 错误[自己已经解决] 添加一个修复脚本
帖子发表于 : 2017-09-07 16:24 

注册: 2012-09-02 19:55
帖子: 27
送出感谢: 1
接收感谢: 0 次
代码:
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/33037aa05b042f35277a6c057930c81b


页首
 用户资料  
 
2 楼 
 文章标题 : Re: dpkg 错误[自己已经解决] 添加一个修复脚本
帖子发表于 : 2017-09-07 21:14 
头像

注册: 2007-07-14 20:45
帖子: 1081
送出感谢: 57
接收感谢: 26
我猜你用的是ubuntu 14.04 版本,对吗?


_________________
开源、共享、自由

微信号:xfiles_sky

irc:chat.freenode.net/+6697
/join #ubuntu.com.cn


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 2 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 2 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译