Skip to content

Instantly share code, notes, and snippets.

@jeffersfp
Forked from icsaas/fix.sh
Created September 14, 2016 19:14
Show Gist options
  • Select an option

  • Save jeffersfp/33037aa05b042f35277a6c057930c81b to your computer and use it in GitHub Desktop.

Select an option

Save jeffersfp/33037aa05b042f35277a6c057930c81b 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
Copy Markdown

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?

@bitbd83
Copy link
Copy Markdown

bitbd83 commented Dec 11, 2019

openssl issue. I am also tired to fixing this. I mean this issue creates after change openssl to compile a code. After than can't revert to original.

@XuCpeng
Copy link
Copy Markdown

XuCpeng commented Dec 24, 2019

Solved my problem perfectly thanks a lot

@GitMyk26
Copy link
Copy Markdown

Yep- solved mine - thanks much!

@Johnny-quattro
Copy link
Copy Markdown

This script came in very useful with a troublesome client running Raspbian, so I'd like to say thanks very much.

@raphaelhespanhol
Copy link
Copy Markdown

Wow.. it's saved my Ubuntu machine, thanks for sharing.

@Idc7REX
Copy link
Copy Markdown

Idc7REX commented Aug 16, 2023

hi, i am new to the hacking world. i keep running into similar error please can anyone help me out?

@M0NDsuChTiG
Copy link
Copy Markdown

Thank you this script helped me.

@rubensalbukrk
Copy link
Copy Markdown

thanks, solved my problem and my linux mint 21.3

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