user5@system:/var/cache/apt/archives$ sudo apt-get remove emacs24
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
emacs24-bin-common emacs24-common emacs24-common-non-dfsg emacs24-el linux-headers-4.4.0-92
linux-headers-4.4.0-92-generic linux-image-4.4.0-92-generic linux-image-extra-4.4.0-92-generic
linux-signed-image-4.4.0-92-generic linux-tools-4.4.0-92 linux-tools-4.4.0-92-generic
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
emacs24
0 upgraded, 0 newly installed, 1 to remove and 84 not upgraded.
1 not fully installed or removed.
After this operation, 17.8 MB disk space will be freed.
Do you want to continue? [Y/n] y
dpkg: error processing package emacs24 (--remove):
package is in a very bad inconsistent state; you should
reinstall it before attempting a removal
Errors were encountered while processing:
emacs24
E: Sub-process /usr/bin/dpkg returned an error code (1)