8

I'm following instructions from here (see Ubuntu section). It says me to do

sudo add-apt-repository ppa:staticfloat/juliareleases
sudo add-apt-repository ppa:staticfloat/julia-deps
sudo apt-get update

But then the command

sudo apt-get install julia

Gives me

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 julia : Depends: libcholmod1.7.1 but it is not installable or
              libcholmod2.1.2 but it is not installable or
              libcholmod3.0.6 but it is not installable
     Depends: libumfpack5.4.0 but it is not installable or
              libumfpack5.6.2 but it is not installable or
              libumfpack5.7.1 but it is not installable
E: Unable to correct problems, you have held broken packages.

I am using Xubuntu 16.10.

Can you please help me to understand what is going on and how to solve it?

  • For the record, Julia is available in official Ubuntu repositories, there's no need to add external PPA unless you rely on the newest version of the language – Sergiy Kolodyazhnyy May 22 '18 at 9:39
4

For future users: get the newer version/a working link from https://julialang.org/downloads/

# go to your user folder
cd ~
# get julia
wget https://julialang-s3.julialang.org/bin/linux/x64/1.3/julia-1.3.0-linux-x86_64.tar.gz
# extract the file (eXtract File as options)
tar xf julia-1.3.0-linux-x86_64.tar.gz
# Create a shortcut (a soft link) that's places in a globally accessible folder
sudo ln -s ~/julia-1.3.0/bin/julia /usr/local/bin/julia

Now you can run julia anywhere.

| improve this answer | |
1

It seems like you have broken packages. To fix the problem, you might want to try entering this into the terminal:

sudo sh -c "apt-get update;apt-get dist-upgrade;apt-get autoremove;apt-get autoclean"

Also enter this into the terminal:

sudo apt --fix-broken install

This should fix up your broken packages. Now try installing Julia again.

| improve this answer | |
-1

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.

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 i.e. julia in the terminal as shown below

x@xpc:~$ julia
This is where the magic happens and you get this:

julia>

The instructions can be used for any version of Julia in Ubuntu.

Reference

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.