How force remove when post-installation script always fail
You may need to manually remove the package using:
sudo dpkg --purge --force-all package
Replace package
with the name of the package.
Do note: its recommended to report a bug if the package is not yours or is unknown to you what the script does.
dpkg : how to ignore error in post/pre scripts
Well, personally I have no idea about this either. If --force-all
doesn't work, I would simply edit /var/lib/dpkg/info/blablabla.postrm
to get it right. You're removing the package so won't be worried about the script which will be soon removed, will you?
Removing broken packages in Ubuntu
I faced this problem with a broken package, rvm. I tried many things like sudo apt install -f
and sudo dpkg --purge --force-all rvm
but nothing worked. Finally I managed to find a blog post that explains how to remove broken packages on Debian/Ubuntu.
Here are the steps.
Find your package in
/var/lib/dpkg/info
, for example using:ls -l /var/lib/dpkg/info | grep <package>
Move the package folder to another location, like suggested in the blog post I mentioned before.
sudo mv /var/lib/dpkg/info/<package>.* /tmp/
Run the following command:
sudo dpkg --remove --force-remove-reinstreq <package>
So as an example I solved my problem by executing the following commands in a terminal:
sudo mv /var/lib/dpkg/info/rvm.* /tmp/
sudo dpkg --remove --force-remove-reinstreq rvm
`dpkg --configure -a` hangs
This is a confirmed bug.
https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1621336
A workaround is listed:
https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1621336/comments/4
Adding the workaround from Axel Kämpfe since the links seems to be broken:
- Start a rootshell with "sudo -i"
- Run
echo "bash -c 'service snapd.boot-ok start'" | at now + 4 min
- Then run
apt install snapd
(if it argues about canceled dpkg processes use thedpkg --configure -a
. Then wait for at least 4 minutes. The hanging should gone then.
Good luck! :)
/Patrik
How can kill all the processes triggered by hotkey with some smart way?
From the extended context you provided the first thing that comes to my mind is using a PID-file and a companion command.
Something like this:
# cr.sh
ffmpeg ... &
# note down pid
echo $! >/tmp/cr.pid
# cr-stop.sh
kill $(cat /tmp/cr.pid)
then you should be able to use cr-stop.sh
to stop ffmpeg.
Related Topics
Linux Allocates Memory at Specific Physical Address
Problem in Restoring Floating Toolbar for Qmainwindow
Sublimetext3 Build on The Server Over Ssh
Kernel Preemption While Holding Spinlock
Restart Service from Cgi Script
Find All Instances of Word Occurring in a File
How to Open Include File 'Io.Mac' Assembly
Setting an Acpi Field in Linux
Different Show Between "Cat" and "Vim"
How to Create a Folder with a Folder Name Containing Spaces in Linux
Cmake: How to Suppress "Entering Directory" Messages
Can't Run Dmidecode on Docker Container
Eclipse-Mars on Linux: Black Background Color in Tooltip's
Which Tool Has Replaced Gatttool in Bluez5