Score:3

Restore `/usr/bin/latex` on ubuntu

np flag

I wanted to uninstall texlive on ubuntu and used apt remove texlive but some program still found /usr/bin/latex so I removed that by hand (rm). When I reinstalled texlive with apt install texlive the /usr/bin/latex file was not restored.

us flag
`app remove texlive` is not supposed to do anything. Did you mean `apt remove texlive`?
Felix B. avatar
np flag
@ArchismanPanigrahi yes, thank you
eesiraed avatar
vn flag
Don't `rm` stuff in `/usr/bin` or you might break your system. Use `dpkg -S` to find the package that owns a file and remove that package.
Score:6
hr flag

You can find out which installed package the file the you deleted belongs to using

dpkg -S /usr/bin/latex

Then reinstall that package (it's probably texlive-latex-base)

sudo apt install --reinstall texlive-latex-base
Score:3
us flag

It may be a good idea to install texlive-full, so that all available LaTeX packages are installed as well (you won't get missing something.sty errors, and wouldn't have to manually find how to fix them).

The following command should reinstall any missing files.

sudo apt install --reinstall texlive-full
Felix B. avatar
np flag
I tried `sudo apt install --reinstall texlive`, `ls: cannot access '/usr/bin/latex': No such file or directory`
Felix B. avatar
np flag
I want to avoid the additional ~5GB of `texlive-full`. I mean who installs *all* python packages whenever they install python? That seems like a weird practice. The ones I actually need will pile up soon enough
cn flag
@FelixB. when you use Ubuntu distribution packages for Tex Live (instead of the native `tlmgr` package manager) then you cannot (easily) install individual additonal LaTeX packages. There are a number of predefined package collections that you can install but it can take a bit of trouble to find out which collection you need for a specific LaTeX package. Therefore it is easier to just install `texlive-full` and be done with it, 5GB is not so much these days with terrabytes of disk space and fast internet (and some packages are not in a separate collection, only in `texlive-full`).
Felix B. avatar
np flag
@Marijn okay fair enough. I am usually using miktex and this is ubuntu inside wsl which I did not want to clutter up immediately for some cross platform testing. I guess one should use `tlmgr` instead then
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.