Skip to content

Instantly share code, notes, and snippets.

@icsaas
Created March 31, 2014 01:35
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save icsaas/9883466 to your computer and use it in GitHub Desktop.
Save icsaas/9883466 to your computer and use it in GitHub Desktop.
dpkg: warning: files list file for package `*****' missing, assuming package has no files currently installed
#!/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"
@PranavBhattarai
Copy link

I have a similar condition like this in Ubuntu 19.04 and u can see in this link: https://pastebin.com/WUjTnkL9

The main question is, does this apply to my question too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment