Programming‎ > ‎



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