Ask Your Question

Installing Sagemath 8.4 on WSL Ubuntu 18.04

asked 2018-11-23 22:16:07 +0200

rijndaelxyz gravatar image

updated 2018-11-24 01:05:49 +0200

slelievre gravatar image

I've been having troubles doing this. I tried to download sources install the necessary deps and compile it from source, but make errored and I'd prefer installing sagemath otherwise too. sudo apt-get install sagemath seems like a good way to install it, however the latest version I get by doing sudo apt-get install sagemath on WSL 18.04 is sagemath 8.1-7ubuntu1. I also tried to do sudo apt-get install sagemath=8.4, but I received the following error:

E: Version '8.4' for 'sagemath' was not found.

How do I install the latest sagemath on Ubuntu 18.04 with apt-get install command?

edit retag flag offensive close merge delete


You may try to dist-upgrade WSL's Ubuntu to 18.10 : maybe this version has a more recent Sagemath...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2018-11-23 23:41:56 +0200 )edit

I think that might indeed be the root cause for this, but 18.04 is LTS and upgrading to 18.10 seems to be very unnecessary to install Sage8.4. Who maintains the linux packages?

rijndaelxyz gravatar imagerijndaelxyz ( 2018-11-23 23:54:27 +0200 )edit

We are in the process of updating the sagemath package for Debian, probably 8.4 or 8.5, or possibly something later depending on how it all shakes out. Once sagemath in Debian is updated it will probably also be updated in a future Ubuntu release. But the old sagemath package in Ubuntu is somewhat unmaintained. I also have no idea how well it actually works in WSL.

Iguananaut gravatar imageIguananaut ( 2018-11-26 12:05:38 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-11-24 01:00:18 +0200

slelievre gravatar image

updated 2018-11-24 01:08:01 +0200

The version of SageMath packaged for Ubuntu 18.04 is SageMath 8.1, see

Besides apt-get install sagemath and building from source, there are more options, including:

  • install using Conda: see Conda page on the SageMath wiki,
  • install a pre-compiled binary for Ubuntu 18.04: visit the SageMath download page for Linux, select your favourite mirror (or use the torrent if you can), and download the binary distribution for Ubuntu 18.04, i.e. the file sage-8.4-Ubuntu_18.04-x86_64.tar.bz2. No need to run make, this should be ready to use. You might need a few prerequisites, such as apt-get install gfortran.

If you want the latest version, install a binary from the SageMath download page, or build from source, or use Conda, or use Docker. For more choices, visit the Distribution page on the SageMath wiki.

edit flag offensive delete link more


Downloading sage-8.4-Ubuntu_18.04-x86_64.tar.bz2 and running sage directly through wsl gives a warning on every startup: /mnt/c/SageMath/local/lib/python2.7/site-packages/psutil/ RuntimeWarning: 'sin' and 'sout' swap memory stats couldn't be determined and were set to 0 ([Errno 2] No such file or directory: '/proc/vmstat') warnings.warn(msg, RuntimeWarning) I remember on my previous machine I somehow used sage with wsl without seeing this error.

rijndaelxyz gravatar imagerijndaelxyz ( 2018-11-24 02:10:13 +0200 )edit

Also, in terms of performance would you recommend running sage in docker or in wsl or on windows with Erik's setup?

rijndaelxyz gravatar imagerijndaelxyz ( 2018-11-24 02:23:38 +0200 )edit

@slelievre : Sage does not work on conda on Windows. There are not Windows packages for Sage or its dependencies on conda (in particular: I need to add a channel for cygwin binaries for conda...)

To clarify, it might work when using conda under WSL but I've never tested that...

Iguananaut gravatar imageIguananaut ( 2018-11-26 12:04:06 +0200 )edit

@rijndaelxyz What do you mean by "in terms of performance"? What specifically are your areas of concern there? For most usage it is fine, but if you need to compile your own specialized BLAS or something like that it's better to build from source currently (in fact, if high performance is a concern it's probably better to use the Docker image, but only in specialized cases).

Iguananaut gravatar imageIguananaut ( 2018-11-26 12:07:59 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2018-11-23 22:16:07 +0200

Seen: 7,208 times

Last updated: Nov 24 '18