2

I made the mistake of installing texlive-2016 from a [PPA]{https://launchpad.net/~jonathonf/+archive/ubuntu/texlive-2016}. I had the default texlive installation for 14.04 installed and tried to install texlive 2016 in its place. The install failed, at which point I tried frantically to remove texlive-2016. I am unable to remove context from the newer distribution.

dmortens@syllable:~$ sudo dpkg -P context
(Reading database ... 648524 files and directories currently installed.)
Removing context (2016.05.17.20160523-1~ubuntu14.04.1york0) ...
unknown option: format
dpkg: error processing package context (--purge):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 context

I have also tried sudo apt-get remove context, sudo apt-get -f install, sudo dpkg --remove --force-remove-reinstreq context, and a number of other suggestions. I'm not sure what to make of the unknown option: format message. How do I force the removal of this package? It is preventing me from adding or removing any other packages.

dmort27
  • 21
  • See if http://askubuntu.com/a/310/15003 helps. – edwinksl Aug 24 '16 at 16:04
  • Use ppa-purge instead of apt-add-repository --remove – Anwar Aug 24 '16 at 16:07
  • @edwinksl and @Anwar, I seem to be unable to install ppa-purge because of my broken installation. I believe what I really need to be able to do is remove context and potentially other broken packages. – dmort27 Aug 24 '16 at 18:45

2 Answers2

2

It looks like postrm script of the package is broken. A workaround that helped me is to edit /var/lib/dpkg/info/context.postrm, namely replace

case "$1" in
    remove|disappear)
        dhit_call_update_texmf_config format

with

case "$1" in
    remove|disappear)
        dhit_call_update_texmf_config

Then you'll be able to fix your system with apt-get -f install.

0

Did you try with the procedure provided by TUG's page?

If you're re-installing after a previous attempt, be sure to completely remove your failed installation. By default, this would be in these two directories (on Unix-like systems):

$ rm -rf /usr/local/texlive/2016
$ rm -rf ~/.texlive2016

More information can be found here.


Also, you'd like to remove the PPA. Instructions provided here.

  • Thanks, Filippo. I did follow those instructions for removing the PPA, previously, to no avail. At your suggestion, I also removed an existing texlive installed according to the TUG instructions, also to no effect. – dmort27 Aug 24 '16 at 18:38