best and easy way to install SageMath in W11
Hi as I got kernel connection problem see pb SageMath kernel connection , I change my way to install SageMath, using Linux Firefox instead of W11 Firefox . and then no kernel pb connection yet !.
moreover my W11 SageMath shortcut is also working ! ;-)
follow these steps:
in PowerShell cmd run as administrator: install WSL2
wsl --install -d Ubuntu-22.04
restart the computer
launch Ubuntu apps an in the Ubuntu cmd shell :
1 sudo apt update
2 sudo apt upgrade
4 sudo apt-get install bc binutils bzip2 ca-certificates cliquer cmake curl ecl eclib-tools fflas-ffpack flintqs g++ gcc gengetopt gfan gfortran glpk-utils gmp-ecm lcalc libatomic-ops-dev libboost-dev libbraiding-dev libbrial-dev libbrial-groebner-dev libbz2-dev libcdd-dev libcdd-tools libcliquer-dev libcurl4-openssl-dev libec-dev libecm-dev libffi-dev libflint-arb-dev libflint-dev libfplll-dev libfreetype6-dev libgc-dev libgd-dev libgf2x-dev libgiac-dev libgivaro-dev libglpk-dev libgmp-dev libgsl-dev libhomfly-dev libiml-dev liblfunction-dev liblinbox-dev liblrcalc-dev liblzma-dev libm4ri-dev libm4rie-dev libmpc-dev libmpfi-dev libmpfr-dev libncurses5-dev libntl-dev libopenblas-dev libpari-dev libpcre3-dev libplanarity-dev libppl-dev libprimesieve-dev libpython3-dev libqhull-dev libreadline-dev librw-dev libsingular4-dev libsqlite3-dev libssl-dev libsuitesparse-dev libsymmetrica2-dev libz-dev libzmq3-dev libzn-poly-dev m4 make nauty ninja-build openssl palp pari-doc pari-elldata pari-galdata pari-galpol pari-gp2c pari-seadata patch perl pkg-config planarity ppl-dev python3 python3-distutils python3-venv r-base-dev r-cran-lattice singular singular-doc sqlite3 sympow tachyon tar tox xcas xz-utils
6 wget http://www.mirrorservice.org/sites/www.sagemath.org/src/sage-9.7.tar.gz
7 tar xvf sage-9.7.tar.gz
9 nano ~/.bashrc
#write this line in it
alias sage=~/sage-9.7/sage
10 source ~/.bashrc
11 cd sage-9.7
12 ./configure
13 sudo apt-get update
15 sudo apt-get upgrade
23 ./configure ./config.status --recheck && ./config.status
24 cd sage-9.7/
25 make -j32
26 nano sage_nb.sh
#write these 3 lines below and adapt to your user name
#!/bin/bash
cd '/mnt/c/Documents and Settings/user/Mes documents/IPYNBpc'
/home/ortollj/sage-9.7/sage --notebook jupyter
27 chmod ug+x sage_nb.sh
69 sudo apt install x11-apps
#test graphics app
70 xeyes &
71 xcalc
72 sudo apt install octave
73 octave --gui &
#quit all apps above
81 sudo snap install firefox
83 sudo apt-get update
84 sudo apt-get upgrade
# test
86 ./sage_nb.sh
I got errors in executing Julia script !, so test octave graphics simply with :
x = linspace(0,1,10)
y = x.^2
plot(x,y);
install-ubuntu-on-wsl2-on-windows-11-with-gui-support
you can also use SageMath without using Jupyter notebook, the plots now work in Ubuntu WSL W11.
attention!, I had forgotten an important step in my cmd summary to configure Ubuntu. but it is in 4. Configure Ubuntu from the link above
and put in it:
if one omit this detail we get the error !! :
when after
sudo apt install snapd
see also Debian/Ubuntu package installation for complete pkg installation