raspbian apt-get problems

1886 단어

files list file for package 'XXX' is missing final newline


nano newline-fixer.py
import os  
  
dpkg_path = '/var/lib/dpkg/info/'  
paths = os.listdir(dpkg_path)  
for path in paths:  
    path = dpkg_path + path  
    f = open(path, 'a+')  
    data = f.read()  
    if len(data) > 1 and data[-1:] != '
': f.write('
') print 'added newline character to:', path f.close()

sudo python newline-fixer.py

files list file for package '**' missing


nano filelistmissingfixer
#!/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"

chmod 755 filelistmissingfixer sudo sh filelistmissingfixer 역할은 모든 패키지를 재장착하는 데 오래 걸립니다

Alternative

sudo mv /var/lib/dpkg/info /var/lib/dpkg/info_old
sudo mkdir /var/lib/dpkg/info

대량의 Missing류 Warning이 발생하지만 설치는 정상적입니다

좋은 웹페이지 즐겨찾기