1

I have just installed Ubuntu 22.04 and tried to install Sagemath from

https://sagemanifolds.obspm.fr/install_ubuntu.html

with the following commands: sudo apt install sagemath-jupyter

Unfortunately a message with writing I have unmet dependencies appeared:

sudo apt-get install  sagemath 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies: python3-rpy2 : Depends: python3 (< 3.9) but 3.10.6-1~22.04 is to be installed E: Unable to correct problems, you have held broken packages.

The command sudo apt update gives the following message in the end that might be helpful:

W: https://cloud.r-project.org/bin/linux/ubuntu/focal-cran40/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.

My python version is python 3.10.6, yet I have installed an older version of python 3.7 as it is written on the above message. When I tried to install again the same message occured.

Furthermore, I tried to build Sagemath 9.7 from source as in the above site but my laptop stacks at the final command

MAKE="make -j8" make

at some point and I forced to shut it down. Could you please help me?

2 Answers2

0

Try this:

sudo dpkg -l | grep '^.[^i]'

Then for each packages which have something other than ii in the first and second column, or an ..R in the third column, remove them using:

sudo dpkg --remove --force-all package_name
sudo apt-get clean
sudo apt-get update
sudo apt-get --fix-broken install

Hopefully, this should fix the broken package.

rusty
  • 16,917
0

I used sudo aptitude install sagemath

and gave me more than one solution to the unmet dependencies. I kept installing packages with aptitude and finally sagemath is now installed.

Thank you all!