Skip to content

Commit 61e554b

Browse files
bcummingalbestro
andauthored
add guide for uninstalling uenv CLI (#291)
Also remove the old "how to install uenv yourself" guide, because it is not something we recommend at all now. --------- Co-authored-by: Alberto Invernizzi <9337627+albestro@users.noreply.github.com>
1 parent fdcd327 commit 61e554b

File tree

2 files changed

+109
-26
lines changed

2 files changed

+109
-26
lines changed

docs/software/uenv/index.md

Lines changed: 98 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ By default, the modules are not activated when a uenv is started, and need to be
368368
cmake version 3.30.5
369369
```
370370

371+
[](){#ref-uenv-error-v9modules}
371372
??? warning "bash: module: command not found"
372373

373374
Version 9.0.0 of uenv, installed on October 22 2025, has a bug that removes the module command on Santis and Clariden.
@@ -532,32 +533,6 @@ it is possible to override the default uenv by passing a different `--uenv` and
532533

533534
* Note how the second call has access to `mpicc`, provided by `prgenv-gnu`.
534535

535-
[](){#ref-uenv-installation}
536-
## Installing the uenv tool
537-
538-
The command line tool can be installed from source, if you are working on a cluster that does not have uenv installed, or if you need to test a new version.
539-
540-
!!! note
541-
uenv is installed already on CSCS clusters, so installation is not required.
542-
543-
Only follow these steps if you are advised to test out a new version (e.g. if it has a fix for an issues that you are encountering).
544-
545-
```bash
546-
git clone https://github.com/eth-cscs/uenv2.git
547-
cd uenv2
548-
549-
./install-alps-local.sh # (1)!
550-
551-
# update bashrc
552-
echo "export PATH=\$HOME/.local/\$(uname -m)/bin:\$PATH" >> $HOME/.bashrc
553-
echo "unset -f uenv" >> $HOME/.bashrc
554-
```
555-
556-
1. Run installation script. This will install uenv in `$HOME/.local/$(uname -m)/bin/`.
557-
558-
!!! warning
559-
Before uenv can be used, you need to log out then back in again and type `which uenv` to verify that uenv has been installed in your `$HOME` path.
560-
561536
[](){#ref-uenv-labels}
562537
## uenv labels
563538

@@ -701,3 +676,100 @@ $ myenv
701676
```
702677

703678
The benefit of this approach is that you can create multiple environments, whereas modifying `.bashrc` will lock you into using the same environment every time you log in.
679+
680+
[](){#ref-uenv-uninstall}
681+
## Uninstalling the uenv tool
682+
683+
It is strongly recommended to use the version of uenv installed on the system, instead of installing your own version from source.
684+
This guide walks through the process of detecting if you have an old version installed, and removing it.
685+
686+
!!! note
687+
In the past CSCS has recommended installing a more recent version of uenv to help fix issues for some users.
688+
Some users still have old self-installed versions installed in `HOME`, so they are missing out on new uenv features, and possibly seeing errors on systems with the most recent `v9.0.0` uenv installed.
689+
690+
!!! warning "error caused by incompatible uenv version"
691+
If trying to use `uenv run` or `uenv start`, and you see an error message like the following:
692+
693+
```
694+
error: unable to exec '/capstor/scratch/cscs/wombat/.uenv-images/images/61d1f21881a6....squashfs:/user-environment':
695+
No such file or directory (errno=2)
696+
```
697+
698+
Then you are probably using an old version of uenv that is not compatible with the version of `squashfs-mount` installed on the system.
699+
700+
### Detecting which version of uenv is installed
701+
702+
First, log into the target cluster, and enter `type uenv` and inspect the output.
703+
704+
The system version of `uenv` is installed in `/usr/bin`, so if you see the following you do not need to make any changes:
705+
706+
```console
707+
$ type uenv
708+
uenv is /usr/bin/uenv
709+
```
710+
711+
Version 5 of uenv used a bash function called `uenv`, which will give output that looks like this:
712+
713+
```console
714+
$ type uenv
715+
uenv is a function
716+
uenv ()
717+
{
718+
local _last_exitcode=$?;
719+
function uenv_usage ()
720+
{
721+
...
722+
```
723+
724+
If you have installed version 6, 7, 8 or 9, it will be in a different location, for example:
725+
726+
```console
727+
$ type uenv
728+
uenv is /users/voldemort/.local/bin/uenv
729+
```
730+
731+
??? question "why not use `which uenv`?"
732+
The `which uenv` command searches the directories listed in the `PATH` environment variable for the `uenv` executable, and ignores bash functions.
733+
If there is a `uenv` bash function is set, then it will be take precedence over the `uenv` executable found using `which uenv`.
734+
735+
### Removing version 6 or later
736+
737+
To remove uenv version 6, 7, 8 or 9, delete the executable, then force bash to forget the old command.
738+
739+
```console
740+
# remove your self-installed executable
741+
$ rm $(which uenv)
742+
743+
# forget the old uenv command
744+
$ hash -r
745+
746+
# type and which should point to the same executable in /usr/bin
747+
$ type uenv
748+
uenv is /usr/bin/uenv
749+
$ which uenv
750+
/usr/bin/uenv
751+
```
752+
753+
### Removing version 5
754+
755+
To remove version 5, look in your `.bashrc` file for a line like the following and remove or comment it out:
756+
757+
```bash
758+
# configure the user-environment (uenv) utility
759+
source /users/voldemort/.local/bin/activate-uenv
760+
```
761+
762+
Log out and back in again, then issue the following command to force bash to forget the old uenv command:
763+
```console
764+
# forget the old uenv command
765+
$ hash -r
766+
767+
# type and which should point to the same executable in /usr/bin
768+
$ type uenv
769+
uenv is /usr/bin/uenv
770+
$ which uenv
771+
/usr/bin/uenv
772+
```
773+
774+
775+

docs/software/uenv/release-notes.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,17 @@ This [version](https://github.com/eth-cscs/uenv2/releases/tag/v9.0.0) will repla
2929
- a bug where the `--only-meta` flag was ignored on `image pull`.
3030
- add hints to error message when uenv is not found.
3131

32+
[](){#ref-uenv-release-notes-v9.0.0-issues}
33+
### Known issues
34+
35+
!!! warning "user-installed uenv stopped working"
36+
This version introduced changes to the `squashfs-mount` tool used by `uenv start` and `uenv -run` that are incompatible with older versions of uenv.
37+
If you see errors that contain `error: unable to exec '...': No such file or directory (errno=2)`, follow the guide for [uninstalling user-installed uenv][ref-uenv-uninstall].
38+
39+
!!! warning "bash: module: command not found"
40+
This is a known issue with version 9.0.0 that will be fixed in 9.0.1.
41+
See the [uenv modules][ref-uenv-error-v9modules] docs for a workaround.
42+
3243
[](){#ref-uenv-release-notes-v8.1.0}
3344
## v8.1.0
3445

0 commit comments

Comments
 (0)