Installing Sage 4.7 on CentOS 5

I recently upgraded my desktop workstation from an old 32-bit version of Gentoo to 64-bit CentOS 5.  I downloaded and installed the latest version of Sage, and the process went smoothly.
If you find this post helpful, please check out the Sage Beginner’s Guide at Packt Publishing.  Since I don’t use Sage every day, I actually refer to my own book on a regular basis!


Since CentOS is designed to be binary compatible with Red Hat Enterprise Linux, the correct binary to download is


Uncompress the file with tar xfz <filename>  The result is a huge directory (3.1Gb) with a self-contained version of Sage that can be run right where you uncompressed it.  As root, I moved the directory to /opt, changed ownership to root, and changed the name to sage-4.7.2.  I then edited the script /opt/sage-4.7.2/sage so that the variable SAGE_ROOT contains the correct path:


Run sage once as root to set the paths correctly.

User Access

To make it easier to run Sage,  I created a symbolic link to the Sage run script in /usr/bin/:

cd /usr/bin
ln -s /opt/sage-4.7.2/sage sage

Since this directory is on every user’s default path, a user can now start Sage by simply typing sage in a terminal.

Notebook Interface

When you first start Sage you will get a comnand-line interface in a terminal, which is very similar to iPython.  If you want to use a more graphical interface, type notebook() at the Sage command prompt:

Launching Sage Notebook

You will have to create an admin password, as shown above.  Follow the advice and create a secure password.  If a new browser tab or window doesn’t automatically open, open one manually and paste http://localhost:8000 into the address field.  You are now logged in as a user called admin, so I suggest creating a separate user account for yourself (for the same reason that you should only use the root account for system administration on a Linux system).  From the links at the top of the screen choose Settings->Manage Users->Add User.  After entering a user name, you will be given a temporary password.  Copy the temporary password, log out, and log in with your new user name and temporary password.  I suggest that you go to Settings and change your password to something easier to remember.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.