# \[ANN\] jvc.sh - yet another shell installer for Julia

**URL:** <https://discourse.julialang.org/t/ann-jvc-sh-yet-another-shell-installer-for-julia/60306>\
**Category:** Package Announcements\
**Tags:** installation\
**Created:** [April 30, 2021, 12:05pm UTC](https://discourse.julialang.org/t/ann-jvc-sh-yet-another-shell-installer-for-julia/60306 "2021-04-30T12:05:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![songxianxu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/songxianxu/32/24588_2.png) [@songxianxu](https://discourse.julialang.org/u/songxianxu)\
**Post date:** [April 30, 2021, 12:05pm UTC](https://discourse.julialang.org/t/ann-jvc-sh-yet-another-shell-installer-for-julia/60306/1 "2021-04-30T12:05:00Z")

</div>

Hi all,

I have written an ugly (at least at the current stage) but probably(?) useful shell script [jvc.sh](https://github.com/songxianxu/jvc) for Julia installation and version management.

Perhaps you can consider [jvc.sh](https://github.com/songxianxu/jvc) as a heavy version of [jill.sh](https://github.com/abelsiqueira/jill) or something similar to [jill.py](https://github.com/johnnychen94/jill.py) but in shell. If you are already a user of [jill.py](https://github.com/johnnychen94/jill.py), this script might not be really useful for you since it only supports Linux and MacOS.

There are a few motivations:

1. I want to reduce dependency as much as possible (e.g., I might not prefer to install a python script using pip first to install Julia)
2. Julia is evolving rather fast and I guess most people are eager to try the new version. (e.g., 1.6.1 is released merely 1 month later after 1.6.0)
3. I would also like to have a fast version switching locally to check possible different behaviors. (e.g., I do have some experience where packages fail to work after a patch..)
4. It turns out that perhaps I would like to have something similar to [nvm-sh](https://github.com/nvm-sh/nvm).
5. [IonCLI.jl](https://github.com/Roger-luo/IonCLI.jl) would probably be a better option in the future if the binary size can be reduced. Also the original motivation is on package management. See [[ANN] IonCLI: your package manager and more in terminal](https://discourse.julialang.org/t/ann-ioncli-your-package-manager-and-more-in-terminal/44946)

**Install JVC and configure your paths:**

1. `git clone` to your preferred path (e.g.～/.jvc)  
`git clone https://github.com/songxianxu/jvc ~/.jvc`
2. In your shell config file, e.g., `.bashrc` or `.zshrc`, add the following environment variables  
`export PATH=$PATH:~/.jvc:~/.local/bin/jvc/`  
The second path `~/.local/bin/jvc/` is the where jvc search julia symlink, feel free to change it, however, you would also need to change it in `.jvcrc` accordingly. (I would try to avoid modifying other’s rc files)

If you want to change the julia tarball download folder or installation folder, you can change the environment variables in `.jvcrc`. Mac users can uncomment the section for Mac in `.jvcrc`

**Note:** frankly speaking, `.jvcrc` should not even exist in the first place as it is just some environment variables. It is used to store and modify UPSTREAM\_NAME locally. I am thinking of get rid of the `.jvcrc` file in the future.

Explanation of these environment variables:

- `JULIA_DOWNLOAD_DIR`: where julia tarball is downloaded
- `JULIA_INSTALL_DIR`: where julia is installed
- `JULIA_SYMLINK_DIR`: where julia symlink is stored
- `UPSTREAM_NAME`: name of upstream, no manually invention required. Can be adjust using `jvc upstream`

## Basic usage

**Install Julia**

```julia-auto
jvc install # default install current stable verision (Now 1.6.1)
jvc install 1 # will install the stable major version 1 which is 1.6.1 
jvc install 1.5 # will install 1.5.4
jvc install 1.5.4
jvc install 1.6.0 
jvc install 1.6.0-rc1
jvc install lts # 1.0.5
jvc install rc # 1.6.0-rc3
jvc install nightly
jvc nightly
jvc installed # list all installed julia version by checking JULIA_INSTALL_DIR

```

 ![jvc_install](https://global.discourse-cdn.com/julialang/original/3X/4/b/4b6b4f6b2d781f50e55ca1d4704aabc29df6eb38.png)

**Download tarball only**  
`jvc download [version]` # Similar logic to install

**Load/unload symlink for specific version**  
`jvc load 1.5.3` to make `julia-1.5.3` available  
`jvc unload 1.5.3` to remove `julia-1.5.3` unavailable (this is not to uninstall julia 1.5.3, just remove the symlink)  
`jvc loaded` show all loaded version  
`jvc purge` unload all loaded version in case you have loaded too many:). `julia` symlink will still remain.

\*\*Switch julia symlink \*\*  
`jvc switch 1.5.3` to make `julia` symlink use julia 1.5.3

**Show status of julia installation and loaded**  
`jvc status`  
Show installed version, loaded version, downloaded version and upstream

 ![jvc_st](https://global.discourse-cdn.com/julialang/original/3X/0/2/0206fb2ac0c4baec5a5b1bc1059908d5df357d67.png)

**Search for a version**  
`jvc search [version]`

**Query all available version exist**

```julia-auto
jvc avail/available 
jvc avail all #including rc and beta

```

 ![jvc_avail](https://global.discourse-cdn.com/julialang/original/3X/b/e/be8bc647b87e5e5889bce45242ea854d398d0f44.png)

**Uninstall Julia**  
`jvc remove`

 ![jvc_remove](https://global.discourse-cdn.com/julialang/original/3X/9/1/914d0b82b87bd4c13fdd62b942c731a11087a1c0.png)  
No version info is needed. A list of installed version will be shown and you will need to manually key in the version to uninstall (for safety).

**Julia version migration (keep track of Project.toml and Manifest.toml）**  
`jvc migrate 1.5 to 1.6`  
This will simply cp the ` Project.toml` 和 `Manifest.toml` in the corresponding version environment folders`

**Change the upstream for downloading**  
`jvc upstream`  
Perhaps you will want to change the upstream for fast downloading.  
The information is stored in `upstream.conf`.

**Side notes**

- It is the first time for me to write such a lengthy shell script and there are too many places I should improve on but yet I have not started to work towards on. I have referred from [nvm-sh](https://github.com/nvm-sh/nvm) and [jill.sh](https://github.com/abelsiqueira/jill) during the work.
- Initially, I would like to call it `jvm` but it probably coincides with java virtual machine?
- Suggestions are welcome and hopefully someone can kick me out of the comfort zone (simply because it is working now..but some of the utilities are not sustainable as far as I can see).
- The MacOS compatibility still requires further testing as I do not have a MacOS device.
- Many thanks @JohnnyChen94 for useful feedback and discussions.

Some related projects:

- [jill.sh](https://discourse.julialang.org/t/ann-julia-installer-4-linux-light/6978)
- [jill.py](https://discourse.julialang.org/t/ann-jill-py-a-simple-and-stupid-cross-platform-julia-installer/34845)
- [nvm-sh](https://github.com/nvm-sh/nvm)
- [IonCLI.jl](https://github.com/Roger-luo/IonCLI.jl)

---

<div class="post-metadata">

**Author:** ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Post date:** [April 30, 2021, 5:14pm UTC](https://discourse.julialang.org/t/ann-jvc-sh-yet-another-shell-installer-for-julia/60306/2 "2021-04-30T17:14:08Z")

</div>

Another related tool is [asdf](https://asdf-vm.com/#/). It has a Julia [plugin](https://github.com/rkyleg/asdf-julia) and provides a CLI that looks similar to the one you adopted in jvc. A difference w.r.t `jvc` is that eing a generic tool (that supports installation and update of many software), `asdf` does not provide Julia-specific commands like `jvc migrate`.

> **[GitHub - rkyleg/asdf-julia](https://github.com/rkyleg/asdf-julia)**
>
> Contribute to rkyleg/asdf-julia development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![songxianxu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/songxianxu/32/24588_2.png) [@songxianxu](https://discourse.julialang.org/u/songxianxu)\
**Post date:** [May 2, 2021, 12:43pm UTC](https://discourse.julialang.org/t/ann-jvc-sh-yet-another-shell-installer-for-julia/60306/3 "2021-05-02T12:43:09Z")

</div>

Thanks for the reminder. I wasn’t aware of it when I started to write this installer but I was reminded by others later on and also in [JuliaCN](https://discourse.juliacn.com/t/topic/5018/6) where I first announce it.

[asdf](https://asdf-vm.com/#/) should be able to satisfy most of the needs such as installation and version management. For me, I might want to have some extra features such as changing the upstreams and possibly some other features which are more Julia specify…Also I was trying to get rid of github dependent version checking due to some funny reasons. 🙂
