I have installed a set of Linux packages from a directory of .deb files. I then wanted to uninstall them, but trying to guess the package names was hard – even harder was wading through the sheer amount of files to remove them! Linux has this weird thing where you can installed from anyrandomname.deb file, but you have to remove by package name.
A bit of Googling and some short script work got me this:
#!/bin/bash for f in *.deb; do pak="$(dpkg-deb -f "$f" Package)"; # echo $pak $pak sudo apt-get remove $pak ; done
Every deb file is listed, examined and the packages listed then uninstalled by package name. While there may be more elegant ways, this seems to work!