使用未知选项删除损坏的PPA包

我犯了从[PPA] { https://launchpad.net/~jonathonf/+archive/ubuntu/texlive-2016 }安装texlive-2016的错误。 我安装了14.04的默认texlive安装,并尝试在其位置安装texlive 2016。 安装失败,此时我疯狂地尝试删除texlive-2016。 我无法从较新的发行版中删除context

 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 

我也尝试了sudo apt-get remove contextsudo apt-get -f installsudo dpkg --remove --force-remove-reinstreq context ,以及其他一些建议。 我不知道该怎么做unknown option: format消息。 如何强行拆除此包裹? 它阻止我添加或删除任何其他包。

看起来包的postrm脚本坏了。 帮助我的一个解决方法是编辑/var/lib/dpkg/info/context.postrm ,即替换

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

 case "$1" in remove|disappear) dhit_call_update_texmf_config 

然后,您将能够使用apt-get -f install修复系统。

您是否尝试过TUG页面提供的程序?

如果您在上次尝试后重新安装,请务必完全删除失败的安装。 默认情况下,这将在这两个目录中(在类Unix系统上):

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

更多信息可以在这里找到。


此外,您还想删除PPA。 这里提供的说明。