Some people within DebianScience would like to package again Sage for Debian. An old version of Sage got packaged long time ago by Tim Abbott, but, because of lack of maintainance, it became totally unusable and was removed from Debian. The status pages (master branch, develop branch) give an overview about package versions in Sage and Debian. If you want to help out, pick one of the open tasks or issues below and get going. Or contact us via the mailing list or in #debian-science on

Steps to get an up-to-date Sage standard suite in Debian

Building Sage with Debian packages

We have a git repository (sagemath) to document the steps we currently do to experiment with building Sage against Debian packages. Important elements are the build dependencies of Sage, patches for Sage and a script called "pruner" that uses automake to determine if the necessary packages are installed (see also this mail).

It is recommended to do these steps one by one:

git clone --recursive url/to/sagemath.git

Recursive git clone to also get sage which is included as a git submodule.

sudo mk-build-deps --install debian/control

Install build dependencies that are in unstable (requires Debian unstable).

quilt push -a

Apply patches to Sage.

debian/rules prune

Run the pruner script.

debian/rules build

Build sage and run the test suite (includes pruning if necessary, but not patching).

The output of the pruner tells you in the end which dependencies were not found on the machine. These will be downloaded and built in the build step, before Sage itself is built. In the moment the pruner should output something like the following, and it is for now recommended to use these three packages from Sage.

libgap will not come from debian!
singular will not come from debian!
jmol will not come from debian!
95 system packages will be used 

The following commands clean everything up properly.

debian/rules clean

Clean up after prune and build.

quilt pop -a

Unapply patches.

cd sage && git clean -dfx

Clean sage folder (git does not show untracked files from the built due to .gitignore).

rm -rf ~/.local/lib/python2.7/site-packages/sage*

Remove sage python library that is installed during the build process.

Finally, there are still dependencies that cannot yet be satisfied with packages from unstable. This changes frequently. For now (branch sage-6.5 in the sagemath git repository) the following packages should be installed from git:

Some Debian packages have to be rebuilt to include patches:

With these changes the compilation of Sage 6.5 should finish and one can concentrate on fixing failing doctests.

For compiling a development version of Sage 6.6 (branch master) one should also update the following Debian packages:

Here the compilation currently stops due to an incompatible pari version.

Open tasks


Bug / Link



Packages that need a new maintainer and an upload to Debian:


There is a request for help, see 719330


Can maybe be replaced by a wrapper for GAP.


(Debian pkg: python-pexpect): Debian ships version 2.4, but Sage requires version 2.0 (though one of the necessary patches is already in 2.4). Plotting in the notebook is likely to break with newer versions that are in Debian; and >2.0 is reported to be slow. There is a new upstream version so Sage might update, see this sage bug.



singular 3.1.6 is packaged in debian-science's git and Sage >= 6.2 has also 3.1.6; a package for singular 4.0.1 is in the NEW queue, see 764475.

Sage components that need a new maintainer and an upload to Debian:


the dependencies should be in Debian now (691509, 703541, 703531, 703533, 703534, 703535 and 703536)


Softwares that need to be packaged:


Singular 4 depends on 4ti2; a package is in the NEW queue, see 769997


Singular 4 depends on normaliz; an ITP has been filled to package normaliz 2.12.2, see 776019


Singular 4 depends on surf; an ITP has been filled to package surf-alggeo 1.0.6, see 777132

Packages that are (hopefully) not needed:


The Cephes Mathematical Library is only needed for systems where the libc doesn't provide appropriate mathematical functions (cygwin and FreeBSD) and so is not required for Debian.


is part of the libc



mpir is supposed to be ABI-compatible with gmp. A lot of math packages use gmp and we hope we can have a purely gmp based Sage in Debian. Combining the two will most likely lead to conflicts, using mpir we would need an extra mpir version of many packages.

Other known or suspected issues

Information bits that are no issues

New build system for Sage (the distribution)

this is slightly out of date, also, Sage (the community) is not interested in using packages that another distribution provides.

The Sage library is getting an autotools build system in the course of a Google Summer of Code project. With the new build system, it can be built against system libraries. There are tarballs with the code at (There is also a git repository but the tarballs are recommended). Note that this is work in progress and problems are expected, but we are happy about testers. The transition of this work into Sage is coordinated via a bunch of Sage tickets. We have a Debian package sagelib that currently builds metapackages that help installing the build dependencies of Sage. To test building Sage against Debian packages, one should consult the control file. The dependencies of the metapackage sagelib-builddeps-git still need special treatment and can't be just installed from Debian.

The following Debian packages should be installed from the git repositories:

For the remaining packages where the Debian package is missing or is missing features required by Sage, it is currently most convenient to use the versions from Sage. This is done by configuring with

../configure \
--disable-all \
--enable-{boehm_gc,cython,ecl,flintqs,genus2reduction,maxima,pari,pexpect,pynac,rubiks,sagelib,sagetex,tachyon} \

New build system for Sage (the library)

There is some work in progress trying to make sagelib work on top of any software distribution. we use autotools to sort out dependencies, run time paths and provide standard build/installation routines. unlike the first approach, this is heading towards a fork and will likely not play well with the current upstream development process. Experimental tarballs are available at, there is no public git repo yet.

Old sagemath package

The old, buggy sagemath Debian package source code is available at