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

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

Start with Debian unstable with experimental sources enabled. It is nice to do this in a chroot with schroot (>=1.6.10-2 to avoid the workaround to enable Python multiprocessing).

To set up your system for working with our repo:

for d in deb deb-src; do \
    echo "$d sid-sage/"; done \
  | sudo tee /etc/apt/sources.list.d/deb-sci-sage.list

Add our unstable-sage repo for patched dependencies. This is optional; if you prefer you can build these yourself from the instructions in the table below.

gpg2 --recv-keys 0xD1188AF4A1398A5FCC3F576654B3F967097676A0

Get the repo key.

gpg2 --export 0xD1188AF4A1398A5FCC3F576654B3F967097676A0 | sudo apt-key add -

Install the repo key.

printf "Package: *\nPin: release n=sid-sage\nPin-Priority: 100\n" \
  | sudo tee /etc/apt/preferences.d/deb-sci-sage
sudo apt-get update

Pin our repo at a low priority so it doesn't mess with the rest of your system. OTOH, if you really really want this repo's packages, to make sure you get the latest and greatest efforts of the Debian Sage packaging team above all else (including maybe our patched dependency packages messing up your system) then you can set the Pin-Priority to a high number like 800.

git clone --recursive

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

To build the package, run:

debian/rules build-dep reset

Install build dependencies, and force-reset patches and the upstream sage submodule. Note: also removes ~/.sage/local and ~/.local/share/sagemath

debian/rules prune build

Run the pruner script, build sage and run the test suite.

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. Currently (Mid-August 2016) the pruner should output something like the following.

ipywidgets will not come from debian!
jmol will not come from debian!
notebook will not come from debian!
planarity will not come from debian!
sagenb_export will not come from debian!
widgetsnbextension will not come from debian!
144 system packages will be used

See debian/README.Debian for any workarounds you might have to apply, such as patching local system files.

Open tasks

Packages in our development APT repository:

Up-to-date information about the packages in the repo can be found on the status pages. (master branch, develop branch)


Bug / Link

Reason for being in the repository



polybori has been renamed to brial and upstream has not yet fully migrated.



A RFS has been submitted (838679).



Debian maintainer needs to apply this upstream patch



Sage uses development versions of libfplll.


Sage 7.3 uses former version 4.8.3 of GAP.



Sage 7.3 uses current version 4.8.3 of libGAP; a RFS has been submitted (833621).



linbox 1.4 is required for the new versions of fflas-ffpak and givaro in uinstable. This should be uploaded soon after some polishing. One of the pending tasks is to disable optimisation so we don't get "Illegal instruction" errors (except that SSE2 is OK for amd64).



Sage uses ECL as Common Lisp compiler, Maxima in Debian uses GCL and should be patched to support both.



Debian maintainer needs to apply this proposed upstream patch - basically accepted but needs unit tests



Sage uses PARI 2.8


Must be re-built against our version of PARI.


Must be re-built against our version of PARI


The current sagenb package ships a bunch of javascript libraries. It should use at least these Debian packages instead: mathjax, tinymce, jquery, jqueryui, codemirror



singular 3.1.7 is packaged in our git and APT repo, because that is what Sage 7.3 is using; Singular 4.0.3 is now in Debian but unfortunately its API is restructured from 3.1.7; we are waiting for Sage to migrate.)



jupyter-sphinx-theme Build-Depends on nbsphinx; a RFS has been submitted (838870).

Other packages:


Bug / Link



Need to be packaged:



ipywidgets depends on jupyter-sphinx-theme; an ITP has been submitted (838798)



An ITP has been submitted (838684)






An ITP has been submitted (838683)

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


There is a request for help, see 719330

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.

Uploading patched packages

We've set up a mini-dinstall APT repo to upload our patched Debian packages to, so that we can build sage against these. This is a temporary measure to make everything work more quickly, and these patched packages are unlikely to be added to Debian officially.

To upload, you must be a member of the debian-science group on alioth. Then, you should add this to your ~/

method = scp
fqdn =
incoming = /home/groups/debian-science/htdocs/apt/mini-dinstall/incoming/
post_upload_command = ssh /home/groups/debian-science/mini-dinstall

mini-dinstall is pretty forgiving and you should be able to overwrite any existing version in this repo or even downgrade versions. However, you must set the distribution in debian/changelog to sid-sage or unstable-sage, otherwise your package will get rejected. Alternatively, do the build without changing debian/changelog, then afterwards edit the .changes file to say Distribution: sid-sage, then debsign it and upload.

Please include the .orig tarball in your upload, which helps our status pages report more accurately. To do this, you can give --changes-option=-sa to dpkg-buildpackage, or if you forget to do this then you can run changestool $XXX.changes includeallsources after the build, then debsign it and upload.

To remove a package: