"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."

"Mission: Creating a viable free open source alternative to Magma, Maple, Mathematica and Matlab."


Installation Instructions

For most recent versions of Ubuntu, you can install with a PPA using the following commands in a terminal:

apt-add-repository -y ppa:aims/sagemath
apt-get update
apt-get install sagemath-upstream-binary

Download binaries from their website

Go to the website

and pick up a mirror to download. Choose 'Download for Linux', then

For example, for a 32-bit processor running Ubuntu 10.4, you'd select sage-4.4.4-linux-32bit-ubuntu_10.04_lts-i686-Linux.tar.lzma where 4.4.4 is the latest Sage version at the time of writing.

Installing reduces to unpacking into /opt (or any other location of your choice), and putting a link to the sage executable in /usr/local/bin:

sudo su
cd /opt
tar --lzma -xvf /path_to_sage_package/sage-?.?.?-linux-ubuntu-...lzma
ln -s /opt/sage.?-?-?.../sage /usr/local/bin/sage

Compile from source

You can compile sage from source. Though it's actually very easy, it may take a long time (1 hour on high end hardware, 14 days on a cell phone).

The first step is to install the required packages:

sudo apt-get upgrade && sudo apt-get install build-essential m4 gfortran

And you may also need the following for some extra features

sudo apt-get install imagemagick texlive dvipng

Then you can compile the code with:


You can now use sage from that directory or move it into /opt:

sudo su
cd /opt
cp -r /path_to_sage .
ln -s /opt/sage.?-?-?.../sage /usr/local/bin/sage

You should check their own documentation if you find any trouble:

Create an icon in the panel

You can add to the panel an icon for starting the sage server. Just select "add new element to the panel", "add new applet" or however it's called in your system, then choose for a new "Launcher" or "Launcher for external applications".

In the configuration dialog for the launcher, make sure you select "open in a terminal" and choose "sage -notebook" for the command in GNOME or XFCE. In KDE, choose "sage" for the command and "-notebook" for command line options.

You can use "SAGE" for the name and the following for the icon:


where "sage-directory..." is the directory where you installed sage.

Getting Started With Sage

Open a terminal and type sage and press enter. The sage command line interface should start up. Wait for the sage prompt to come up. It would looks thus:


This may take up to a minute depending on your hardware.

The first time you use Sage you will be asked to set a password to secure your work.

Choice of Sage Interface: Command Line Or GUI

You have a choice of using Sage either from the command line or from a GUI. The official GUI is called the notebook. In order to use the notebook interface to sage use the sage prompt to type:


This will open the Firefox web browser showing the notebook.

To start work with the notebook click on the link New Worksheet.

The rest involves typing your sage commands into the input box and clicking the evaluate button that lies below it.

You might also use the program Cantor or TeXmacs as an interface, though they're not as popular as the notebook:

Help and Documentation

A beginner would probably start with the Tutorial at

Further Reading

At the web page you would, by and by, want to look at the Installation Guide and the Reference Manual besides a whole host of documentation at .


Hao Wen: 2009-12-01

While Sage is truly a powerful software, it still lacks some key features as of today (Dec. 1, 2009). Good news it is under development.

Plotting doesn't have a good label function. Axis can not be fine tuned as Matlab.

Pablo Angulo: 2010-06-15

Hao, that's perfectly possible, and it's been so for a long time. Sage uses matplotlib for most graphics and you can even add labels in latex. Feel free to email sage-support for these kind of questions.

Christian: 2011-10-4

On Lucid I had to add the libgfortran library:

apt-get install libgfortran3 get rid of this sage error: ImportError: cannot open shared object file: No such file or directory.


SAGE (last edited 2013-07-20 18:05:34 by localhost)