zoukankan      html  css  js  c++  java
  • 错误files list file for package 'xxx' missing; assuming package has no files currently installed的解决方法

    apt-get install或apt-get purge时报错“files list file for package 'xxx' missing; assuming package has no files currently installed”,其中xxx是具体的包名。

    方法1:
    sudo apt-get update
    sudo apt-get install --reinstall xxx


    方法2:
    vim fix.sh

    输入以下shell脚本:

    复制代码
    #!/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"
    复制代码

    运行sh fix.sh

  • 相关阅读:
    积木游戏
    斐波那契公倍数
    莫比乌斯反演,狄利克雷卷积,杜教筛
    CF932E Team Work
    【算法学习/数据结构】李超树
    【算法笔记/数学内容】博弈论-从入土到入土
    瞎几把写的cspj题解
    【算法笔记】数位dp
    【算法笔记】树形dp
    攻防世界-WEB相关writeup-3
  • 原文地址:https://www.cnblogs.com/live41/p/14237228.html
Copyright © 2011-2022 走看看