Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to install Rust on Linux without admin privileges?

Tags:

linux

rust

version: 1.0.0 beta 5

I have gotten as as far as running the install.sh script with the argument "--prefix=$HOME/local" (installing to my home directory)

and this works fine, but ldconfig (part of the install.sh process) fails because of lack of root privileges, and then rustc is unable to find the libraries

rustc: error while loading shared libraries: librustc_driver-4e7c5e5c.so: cannot open shared object file: No such file or directory
like image 266
talloaktrees Avatar asked May 14 '15 02:05

talloaktrees


People also ask

Can I run Rust on Linux?

Build and run a Rust project locally To build the project locally, go to the root directory and run cargo build . This build runs rustc for you, using attributes from the Cargo. toml file. After the project is built, run the Rust project using the command cargo run .

How do I install Rust for all users?

The official way to install Rust system-wide in a manner that is only updatable by an authorized administrator is to use the official standalone installer. To install rust this way, you download the installer, extract it in a directory, and then run sudo ./install .


1 Answers

If you specify a different prefix, you need to set the LD_LIBRARY_PATH environment variable. This is a colon-separated list (like PATH) which is typically not set. You’ll want something like this in your shell config:

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:~/local/lib"
like image 173
Chris Morgan Avatar answered Sep 24 '22 00:09

Chris Morgan