When the {pre,post}-{installation,removal} script of a package throws errors, sometimes you won't be able to finish installing or remove the package. This can come about either due to a bug in the package (or sometimes another package), in which case you should try to identify the problem and report the bug, or because you've been mucking about inside /usr
, in which case, well, don't.
The workaround is to either do what it takes to satisfy the package script, or comment out the offending command in the package script. The package script you're having trouble with is located in /var/lib/dpkg/info/emacs23-lucid.postinst
. The particular command that's failing is /usr/lib/emacsen-common/emacs-install ${FLAVOR}
.
The first thing you should try is to fix the underlying problem. Here three files under /usr/share/emacs23
are missing. They should be symbolic links to the corresponding files under /usr/share/emacs
. If they are broken symbolic links, try removing them; if the files under /usr/share/emacs23
don't exist but the files under /usr/share/emacs
do, try creating the symbolic links.
If you don't manage to fix the problem, either
- comment out the offending line: edit the package script, add a
#
at the beginning of the problematic line(s);
- or ignore the error: add
|| true
at the end of the problematic command, or remove set -e
near the beginning of the file.
Beyond removing and reinstalling the emacs23-lucid
package, you may need to reinstall other packages to put your system into a sane state, in particular the dictionaries-common
package which provides the three troublesome .el
files.
That is the proper way, there is no better way available.
Files created into your home dir, or other files created during normal package working, as i.e. log files, do not get removed, and there is no easy way to do so, if the preremove and postremove script do not do so themself. Obviously the problem is not in the removing, but in the individuation of such files.
The fact that the service you talk about keep on starting on boot is strange, it is perhaps present in another package? What dpkg -l | grep nginx
returns?
Best Answer
Okular depended on some or all of the packages your removed. That's why it was removed too. When you install a program, its dependencies must be installed at the same time, if you remove a dependency, the parent program is removed too.
Source: https://help.ubuntu.com/community/InstallingSoftware