Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to use asdf as system global? #577

Closed
niksfirefly opened this issue Oct 7, 2019 · 7 comments
Closed

Is there a way to use asdf as system global? #577

niksfirefly opened this issue Oct 7, 2019 · 7 comments

Comments

@niksfirefly
Copy link

I wonder Is there a way to use asdf as global for every user?
to not duplicate plugins and save disks space.

@niksfirefly niksfirefly changed the title Is there a way to use asdf as global? Is there a way to use asdf as system global? Oct 7, 2019
@vic
Copy link
Contributor

vic commented Oct 7, 2019

Yes! ASDF is pretty much agnostic to where it is installed. Just clone asdf at any shared location, say /opt/asdf and make sure all users have permissions for reading and executing binaries installed there. Have their shell profile source the asdf.sh environment and violá.

I'd recommend having a single user manage installed tool versions, since asdf has no restriction on what a plugin-install command can do, and what permissions files are created with. So, I guess the best would be, install things for other users and make sure everyone can read and execute.

@niksfirefly
Copy link
Author

unfortunately plugins go to $HOME/.asdf dir
instead /opt/asdf

@niksfirefly
Copy link
Author

export ASDF_DATA_DIR=/opt/asdf
make the trick, so far so good

@gfsheppard
Copy link

Make sure to export ASDF_DATA_DIR before calling the scripts in.bashrc.

export ASDF_DATA_DIR=/opt/asdf
. /opt/asdf/asdf.sh
. /opt/asdf/completions/asdf.bash

Says so here, but I missed it, and it kept looking at my local installation.

@chavenor
Copy link

export ASDF_DATA_DIR=/opt/asdf
. /opt/asdf/asdf.sh
. /opt/asdf/completions/asdf.bash

Is this before installing via git or after?

@elcritch
Copy link

elcritch commented Feb 6, 2023

export ASDF_DATA_DIR=/opt/asdf
. /opt/asdf/asdf.sh
. /opt/asdf/completions/asdf.bash

Is this before installing via git or after?

It should be after, but it probably doesn't matter.

Note for others, you may want to copy the $HOME/.tool-versions file to other users to set their default versions.

@donnydongchen
Copy link

We may also need to add export ASDF_DIR=/opt/asdf to the shell profile. It complained if I didn't do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants