# Force conda full reinstall tljh

**URL:** <https://discourse.jupyter.org/t/force-conda-full-reinstall-tljh/15045>\
**Category:** The Littlest JupyterHub\
**Tags:** jupyterhub, how-to, help-wanted\
**Created:** [July 22, 2022, 3:57pm UTC](https://discourse.jupyter.org/t/force-conda-full-reinstall-tljh/15045 "2022-07-22T15:57:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![grassoste](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/grassoste/32/7582_2.png) [@grassoste](https://discourse.jupyter.org/u/grassoste)\
**Post date:** [July 22, 2022, 3:57pm UTC](https://discourse.jupyter.org/t/force-conda-full-reinstall-tljh/15045/1 "2022-07-22T15:57:43Z")

</div>

Hi Community, I am new to The Littlest Jupyter Hub (tljh) and while playing around, I accidentally removed, as admin (smart!), the conda executable from the bin folder. So when a user tries to run conda it returns:

```auto
$ conda
bash: /opt/tljh/user/bin/conda: No such file or directory

```

And as admin consequently:

```auto
# conda
conda: command not found

```

I tried to reinstall conda ontop of it using the `-u` option and providing `/opt/tljh/user/` as path, but I was unsuccessful, despite the prior installation is recognized.

```auto
# bash Anaconda3-2022.05-Linux-x86_64.sh -u
[/root/anaconda3] >>> /opt/tljh/user/
PREFIX=/opt/tljh/user
Unpacking payload ...
Collecting package metadata (current_repodata.json): done                                                                                                                                                                                                                                      
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: - 
Found conflicts! Looking for incompatible packages.
[...]
Your installed version is: 2.27

```

In fact after this command a conda.exe appears (?) but no `bin/conda`

Any idea how to fix this without having to reinstall tljh (which would not be an option)?

I can install it in a new directory (e.g. the default one `root/anaconda3`) and it works for the admin, but then the other users still get the error because it looks for a different directory.

```auto
$ conda
bash: /opt/tljh/user/bin/conda: No such file or directory

```

---

<div class="post-metadata">

**Author:** ![bollwyvl](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/bollwyvl/32/904_2.png) [@bollwyvl](https://discourse.jupyter.org/u/bollwyvl)\
**Post date:** [July 22, 2022, 4:08pm UTC](https://discourse.jupyter.org/t/force-conda-full-reinstall-tljh/15045/2 "2022-07-22T16:08:48Z")

</div>

[constructor](https://github.com/conda/constructor)-built installers like that one accept a `-f` (force) flag which will overwrite anything it finds.

Combined with with `-b`(atch) and `-p`(ath), it works unattended, which is great for scripting.

```bash
bash Installer.sh -fbp /path/you/want

```

As an aside: running `conda` as `root` is basically never the right play: I typically ensure the path exists, and is owned by less-privileged user, and then run _as_ the user, as there is always the chance for arbitrary code execution during package install. If you only want a privileged user to see it later, you can `chown` it after the fact.

---

<div class="post-metadata">

**Author:** ![grassoste](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/grassoste/32/7582_2.png) [@grassoste](https://discourse.jupyter.org/u/grassoste)\
**Post date:** [July 22, 2022, 10:58pm UTC](https://discourse.jupyter.org/t/force-conda-full-reinstall-tljh/15045/3 "2022-07-22T22:58:28Z")

</div>

I tried with the `-fbp` options but the result did not change significantly, and it seems to fail.  
Here the output: [PREFIX=/opt/tljh/user](https://rentry.co/zrkfie)  
It seems like it cannot resolve conflicts despite the forcing and still generates a conda.exe (?), despite being the linux installer.

P.S. Yeah I don’t really know why I did it, or what I was thinking while doing it… I am not familiar with tljh but this was a stupid idea, period.

---

<div class="post-metadata">

**Author:** ![bollwyvl](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/bollwyvl/32/904_2.png) [@bollwyvl](https://discourse.jupyter.org/u/bollwyvl)\
**Post date:** [July 22, 2022, 11:14pm UTC](https://discourse.jupyter.org/t/force-conda-full-reinstall-tljh/15045/4 "2022-07-22T23:14:52Z")

</div>

you could theoretically try unpacking the conda tarball and copying stuff into place… you should be able to tell what version you expect by looking in the package cache `$PREFIX/pkg`.

if you can’t get that to work i can’t recommend much more than backing up the old user install, and starting over: in `$PREFIX/conda-meta/history`, there is a full list of everything that was ever installed/re-installed.
