Score:1

Unmet dependencies in Sagemath installation at Ubuntu 22.04 : python3-pyr2 : Depends: python3 (< 3.9) but 3.10.6-1~22.04 is to be installed

om flag

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?

guiverc avatar
cn flag
A quick scan of https://packages.ubuntu.com/jammy/sagemath-jupyter and I don't see the requirements you've pasted, as following links I get to no restriction of python3 eg. https://packages.ubuntu.com/jammy/sagemath that isn't met by https://packages.ubuntu.com/jammy/python3 thus I'd suggest reading all the messages you didn't provide for us. We're limited to reading only what you paste, and from what you pasted I don't see an issue (*assuming you've not corrupted your sources*)
precise avatar
br flag
Having `synaptic` package manager in your system is handy when you encounter problems like these. Try the commands as described in this article: https://www.makeuseof.com/how-to-find-and-fix-broken-packages-on-linux/#how-to-find-and-fix-broken-packages
precise avatar
br flag
Ask for more help if needed.
guiverc avatar
cn flag
If you check my first comment, `sagemath-jupyter` has no such requirement for `python3-rpy2` thus the message you're getting relates to either badly added sources (read your `sudo apt update` messages) or other packages you've installed. The package `python3-rpy2` is not found in Ubuntu repositories, thus is not required for any Ubuntu package like `sagemath-jupyter` found in Ubuntu repositories (*if requirements don't exist, it won't build*). Your error relates to details you've not pasted. You could explore using `apt-cache policy python3-rpy2` to see where you got it, but it's not Ubuntu
guiverc avatar
cn flag
FYI: If you look at the *jammy* package found in Ubuntu (22.04) repositories ; you see https://packages.ubuntu.com/jammy/python3-rpy2 which requires "*python3 (>= 3~)*" and not what your messages show...
Score:0
om flag

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!

Score:0
br flag

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.

precise avatar
br flag
@LoukasDouros please update your question with the output of `sudo dpkg -l | grep '^.[^i]'` .
Loukas Douros avatar
om flag
There is no such a row with anything but ii or ..R in the 3rd column
precise avatar
br flag
@LoukasDouros DId you get no output at all?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.