Score:1

Ubuntu 21: sudo apt install failed, causing by gcc-11-base unmet dependencies on libgfortran5 :(

cn flag

My sudo apt install encountered problem when trying to install OpenCV. It fails on package libgfortran5, which OpenCV and libopencv-dev needs. The output is

The following packages have unmet dependencies:

libgfortran5 : Depends: gcc-11-base (= 11-20210417-1ubuntu1) but 11.1.0-1ubuntu1~21.04 is to be installed

E: Unable to correct problems, you have held broken packages.

I tried to downgrade gcc-11-base to 11-20210417-1ubuntu1 with command sudo apt-get install gcc-11-base=11-20210417-1ubuntu1, but it will remove 2.6G of stuff, which I believe will crash the system. So, I didn't say yes to "You are about to do something potentially harmful."

Please let me know if you have encountered this issue before. Thanks a lot!

Logistics:

  1. System: Ubuntu Desktop 21.04
  2. Hardware: Raspberry Pi 4B (8Gb men) aarch64
  3. Python: version 3.8.7 correctly installed (default)
  4. I might have messed around with /etc/apt/sources.list since I needed to add some random repository to install python3.8 (according to some tutorials) [I highly suspect that this is causing the problem.]

Thanks a lot,

Terry

.

To answer community suggestions:

Thank you guys for your prompt suggestions.

  1. I installed the Ubuntu 21.04 Desktop from this link https://ubuntu.com/download/raspberry-pi

  2. Yes, I understand that this is a arm system, which x86 packages will fail on any raspberry pi. I simply want to install opencv on pi, the command I ran to do so is "sudo apt install libopencv-dev python3-opencv" as suggested here https://linuxize.com/post/how-to-install-opencv-on-ubuntu-20-04/

  3. I tried that post, and it didn't solve the issue unfortunately (that's why I wrote this post). I don't have any hold packages. Aptitude did successfully install I think, but cv2 module cannot be found when I ran python

  4. In my /etc/apt/sources.list, I have the following links. I highly think these are mal-configured. Any idea of fixing it? Thanks a lot!

deb http://us.archive.ubuntu.com/ubuntu/ hirsute main
deb http://us.archive.ubuntu.com/ubuntu/ hirsute universe
deb http://ports.ubuntu.com/ubuntu-ports/ hirsute main universe multiverse

Also, when I installed python, I ran this command sudo add-apt-repository ppa:deadsnakes/ppa. Maybe this causes the issue?

guiverc avatar
cn flag
Ubuntu 21? No such release. Ubuntu uses the *year* format for *snap* only releases, but you start with a `sudo apt install` which doesn't work on *year* format products. Please clarify your release.
guiverc avatar
cn flag
If you look at https://packages.ubuntu.com/hirsute/libgfortran5 you'll note you have/are trying to install *i386/amd64* packages it appears on what you say is an *arm64* system. Do you understand what the *architecture* means? Correct your sources!
guiverc avatar
cn flag
Does this answer your question? [Unable to correct problems, you have held broken packages](https://askubuntu.com/questions/223237/unable-to-correct-problems-you-have-held-broken-packages)
Organic Marble avatar
us flag
Please provide details of exactly what you did to the software sources. The staff mind-reader is on break.
Terry W avatar
cn flag
Please see my edited post, for I provide more info to your suggestions there. Thanks a lot! I really hope I can get this(OpenCV) working.
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.