Installing Julia v0.5 on Ubuntu 16.04 while v0.6 is installed
I use v0.6, but certain packages do not function with v0.6 (such as Interact.jl). How can I install v0.5? I am running Ubuntu 16.04.
Firstly, you should really read the post that Reza Afzalan linked. It gives you everything you need to know about how to install. If you prefer a list:
julia5
and julia6
. You can store the symlinks in a directory like /usr/local/bin
. julia5
. Pkg.add
. First we have to download the latest Julia version from https://julialang.org/downloads/
I used the “Generic Linux Binaries for x86” version. The choice between x86 and ARM depends on the processor of your machine. Also choose between 32 bit and 64 bit versions based on the operating system and processor you have on your machine.
After download, you will get a compressed tar.gz archive having name similar to “julia-0.6.2-linux-x86_64.tar.gz”. As the “julia-0.6.2-linux-x86_64.tar.gz” name suggests that I downloaded the Julia version 0.6.2 which is latest at the time of writing this.
The names may differ. Adapt the names accordingly.
Remember these are binaries, these don't need to be installed as they can be directly used from the directory they are extracted.
I am assuming that the downloaded file is in your ~/Downloads directory of Ubuntu.
Open the terminal and navigate to the directory where the downloaded tar.gz file is stored, in present case the Downloads directory.
The terminal when just opened will show:
x@xpc:~$
where x
should be replaced by your username and xpc
should be replaced by your computer name.
Navigate to the Downloads directory using cd Downloads
and then press Enter to get following terminal:
x@xpc:~/Downloads $
Extract the tar.gz file using the command
tar -zxvf julia-0.6.2-linux-x86_64.tar.gz
Now a directory with extracted contents will be generated in the same parent directory as of the compressed archive with a name similar to julia-xxxxxxxxxx
where xxxxxxxxxx
may be a combination of alphabets and numerals.
This is the final directory you need to run the latest Julia version, no installation is needed.
To run Julia, you can directly run using the julia file in location julia-xxxxxxxxxx/bin/julia
as discussed below.
Navigate to the bin directory in the extracted directory using
cd /Downloads/julia-xxxxxxxxxx/bin
The terminal will now be like:
x@xpc:~/Downloads/julia-xxxxxxxxxx/bin $
Now run the command ./julia
to run julia on the terminal as shown below.
The terminal will now change to julia as presented below. I know the representation is little different here as this is all I can manage to copy from the terminal to present it to you.
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: https://docs.julialang.org
_ _ _| |_ __ _ | Type “?help” for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.6.2 (2017-12-13 18:08 UTC)
_/ |__’_|_|_|__’_| | Official http://julialang.org/ release
|__/ | x86_64-pc-linux-gnu
julia> But the problem is that I have to navigate to the directory every time to run Julia.
Many people have discussed on the internet about defining the path and alias through very complex procedures and as I am not a hardcore computer geek, it was really difficult for me to understand.
I came to know about making a soft link.
So I decided to make a soft link to the Julia to run it directly from anywhere with a short command without navigating to the directory containing it.
I always try to do things neatly, so I decided to keep the extracted directory named julia-xxxxxxxxxx
in the /opt directory of my system as most of my important programs reside in that.
You need root permissions to copy a file into the /opt directory, so I used the command sudo su
and then provided password to get the super user privileges:
x@xpc:~$ sudo su
[sudo] password for x:
root@xpc:/home/x#
Now navigate to the directory presently containing the extracted directory:
root@xpc:/home/x# cd /Downloads/
root@xpc:/home/x/Downloads#
Copy the directory using:
root@xpc:/home/x/Downloads# cp -r julia-xxxxxxxxxx /opt
After the directory is copied to the destination, now we will make the soft link in a directory which is in the system path so that the soft-link can be called from any location to run Julia.
To find out the directories in the system PATH use echo $PATH
, you will get a list of paths of directories separated by colon( :
) such as /usr/local/bin
. You can use any of them. I used /usr/local/bin
for the soft link.
Navigate to the chosen folder.
root@xpc:/home/x# cd /usr/local/bin
The terminal will become
root@xpc:/home/x/usr/local/bin#
Create the soft link using
root@xpc:/home/x/usr/local/bin# sudo ln -s /opt/julia-xxxxxxxxxx/bin/julia julia
Now return to the normal user terminal using the keyboard combination Ctrl+D at the empty terminal root@xpc:/home/x/usr/local/bin#
.
The terminal prompt will become:
x@xpc:~$
Type the newly made soft link ie julia in the terminal as shown below
x@xpc:~$ julia
This is where the magic happens and you get this:
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: https://docs.julialang.org
_ _ _| |_ __ _ | Type “?help” for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.6.2 (2017-12-13 18:08 UTC)
_/ |__’_|_|_|__’_| | Official http://julialang.org/ release
|__/ | x86_64-pc-linux-gnu
julia>
The instructions can be used for any version of Julia in Ubuntu.
It's very easy, here's how to install it on Linux in 8 steps:
1- go to Julia downloads page
2- Choose you version (32bit or 64bit) from Generic Linux Binaries , and then download it.
3- extract .tar.gz file in home or any place you would like to install Julia on it.
4- run > gksudo gedit /etc/environment
on your terminal to setup envirnment path.
5- edit file :/Path_To_extracted_File/bin
in my case it was like this: " :/home/okasha/julia-d386e40c17/bin
"
6- Save edits and close the file.
7- Restart your machine.
8- Open your terminal again and run > julia -version
you shoud get " julia version 0.6.2
" for Example according to your installed julia version.
Run > julia
to open julia session.
Reference
链接地址: http://www.djcxy.com/p/78078.html上一篇: Homebrew没有将gcc 5.3链接到/ usr / local / bin / gcc(OS X 10.11.4 El Capitan)