Score:1

remove miktex from terminal

br flag

I have installed MiKTeX on Ubuntu 20.04.2.

Unfortunately, I have upgraded MiKTeX and now Ubuntu is not booting; I would like to uninstall MiKTeX now. In this discussion, instructions are given Remove MikTex from Ubuntu 18.04.2, however, I cannot access the console, hence I would need also to "Reset the TeX installation" (point 2 and 3 of the answer) by using commands in the terminal. Could somebody help me? Please consider that I am an Ubuntu neophyte. Thank you in advance.

N0rbert avatar
zw flag
How exactly did you installed MiKTeX?
Riuska avatar
br flag
I followed the instructions here: https://miktex.org/howto/install-miktex-unx Anyway, the installation went fine, I also edited my latex document. The point is that I did not use a basic configuration but I upgraded (upgrade option at the end of the page).
Riuska avatar
br flag
Thank you, I am not sure it worked properly as I can still only access the terminal of UBUNTU. I will update the comment once I managed to boot it normally.
Riuska avatar
br flag
Miktex was correctly removed. Thank you.
Score:0
zw flag

You have to boot to recovery mode from GRUB, then choose

network    Enable Networking

and then

root       Drop to root shell

and finally execute the following commands in root shell to remove MikTex:

mv /etc/apt/sources.list.d/miktex.list /etc/apt/sources.list.d/miktex.list.save
apt-get update
apt-get autopurge miktex

rm -rfv /usr/libexec/miktex
rm -rfv /var/lib/miktex-texmf
rm -rfv /var/cache/miktex-texmf
rm -rfv /var/log/miktex
rm -rfv /usr/local/share/miktex-texmf
rm -v /etc/fonts/conf.d/09-miktex.conf

apt-get install tree
cd /usr/local/bin
rm -v $(tree | grep miktex | awk '{print $2}')
rm -v *latex

and to fix the system using same root shell:

apt-get dist-upgrade
apt-get install -f
dpkg --configure -a

and then reboot to normal system.

Also please note that usage of TeXLive from official Ubuntu repositories is more comfortable and reproducible than using MikTex from third-party site.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.