How to install SageMaths on ubuntu

how i got to install sage on ubuntu..

Sage is a free open-source mathematics software system licensed under the GPL. It combines the power of many existing open-source packages into a common Python-based interface.
you can read more about sage here
unfortunately sage is not available in the Ubuntu repositories and in-fact any repositories as a .deb package. ( at the time of writing this). did you say compiling? dont even go there i tried building it. and failed woefully. fortunately i found a nice and easy to install it on Ubuntu. there is a binary package already compiled for Ubuntu. which makes installation on Ubuntu quite easy and straight forward.

first we download the ubuntu binary here the guide is based on version 3.1.4 so i just did


the above link seem to be broken. although i have not tried it. but this link should work

Ubuntu 8.0.4
wget -c

Ubuntu 8.10
wget -c

once downloaded . i untar it (extracted the archive)
in my case

tar xzvf sage-3.1.4-ubuntu32-intel-XEON-x86-i686-Linux.tar.gz

then i moved it to /usr/local/src/

sudo mv sage-3.1.4-ubuntu32-intel-XEON-x86-i686-Linux /usr/local/src

then i copied the sage script in to /usr/local/bin

sudo cp /usr/local/src/sage-3.1.4-ubuntu32-intel-XEON-x86-i686-Linux/sage /usr/local/bin

then i edited SAGE_ROOT in /usr/local/bin/sage to point to /usr/local/src/sage-3.1.4-ubuntu32-intel-XEON-x86-i686-Linux

gksu gedit /usr/local/bin/sage

modified it to look like this

# Set SAGE_ROOT to the location of the sage install.

i modified the sage root directory permission settings
sudo chmod -R 755 /usr/local/src/sage-3.1.4-ubuntu32-intel-XEON-x86-i686-Linux

now run you can run it


to get a webbased ui
run notebook()

hope someone finds this useful

This content is published under the Attribution-Noncommercial-Share Alike 3.0 Unported license.

This entry was posted in Education, FOSS & Mathematical Science, Ubuntu and tagged , , . Bookmark the permalink.
  • Michael Abshoff


    could you report the build failure so we can fix it?



  • M. Nielsen

    Thanks from a Ubuntu-loving math professor!

  • Roguiez, X.

    Thank you for this helpfull information, it works perfectly


  • Bigbrovar

    @ M. Nielsen, Roguiez, X. am glad it worked for you.

  • Roguiez, X.

    Hi again,

    I’ve loaded the source package and build with make into my personnal directory /home/xav/sage3.3
    Then I’ve try it, sage works

    After I move all the binaries and the structure as describe above.

    Only : “sudo sage” works
    The command : “sage” doesn’t work, I must change the access right on the local directory .sage with “sudo chmod -R 775 ~/.sage” and “sudo chown -R xavier ~/.sage”. Is it normal ?
    And now it works…