0

I was trying to install mega using dpkg and now, I have a broken package in my system, and when I run the Synaptic Package Manager and click on "Mark for complete removal" on the package, it gives me a warning box that says this will affect other packages.

enter image description here

The broken package is megasync:

enter image description here

Also, I am seeing this annoying white dash sign in a red circle on the top-right of my screen, and it says:

An error occurred, please run Package Manager from the right-click menu or apt-get in a terminal to see what is wrong. The error message was :'Error:BrokenCount>0'. This usually means that your installed packages have unmet dependencies. ..

Now, how should I go about it and remove the broken package completely from the system without messing up my system?

Edit:

sudo apt update

voidRealm@voidRealm:~$ sudo apt update
Get:1 http://in.archive.ubuntu.com/ubuntu focal InRelease [265 kB]
Hit:2 http://dl.google.com/linux/chrome/deb stable InRelease                                                                          e
Hit:3 https://deb.nodesource.com/node_12.x focal InRelease                                                                            
Hit:4 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease                                                                     
Hit:5 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease                                                                   
Hit:6 http://security.ubuntu.com/ubuntu focal-security InRelease                                                                      
Hit:7 https://brave-browser-apt-release.s3.brave.com stable InRelease                                                                 
Hit:8 http://archive.canonical.com/ubuntu focal InRelease                                                                             
Ign:9 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.0 InRelease                                           
Hit:10 http://ppa.launchpad.net/dawidd0811/neofetch/ubuntu focal InRelease         
Err:11 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.0 Release 
  404  Not Found [IP: 99.86.42.60 443]
Hit:12 http://ppa.launchpad.net/maarten-baert/simplescreenrecorder/ubuntu focal InRelease
Hit:13 http://ppa.launchpad.net/obsproject/obs-studio/ubuntu focal InRelease
Hit:14 http://ppa.launchpad.net/ubuntuhandbook1/apps/ubuntu focal InRelease
Reading package lists... Done                      
E: The repository 'https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.0 Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

sudo-apt upgrade

voidRealm@voidRealm:~$ sudo apt upgrade 
^Citing for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 4557 (synaptic)... 16s

metalhead
  • 184
  • What version and flavor of Ubuntu are you using? Please update your question and add the output of sudo apt update and sudo apt upgrade. The error tells you to run apt-get in a terminal to see what is wrong. So what did you learn when you did that? – Nmath Aug 22 '20 at 17:29
  • I updated my question. I think there's some problem when I run sudo apt upgrade. – metalhead Aug 22 '20 at 17:50
  • The mongodb repository is not found. You have also installed quite a few PPAs. Do you know what they are all for and do you still use the software associated with them? – Nmath Aug 22 '20 at 18:11
  • No, I don't know what they are for, but I use mongodb and it works fine. – metalhead Aug 22 '20 at 18:36
  • What's wrong with mongodb in official Universe repositories? Why would you use a PPA for this software? FYI: not just mongodb but also simplescreenrecorder, obs-studio, and neofetch are all available in Ubuntu repositories, without having to add a PPA. – Nmath Aug 22 '20 at 19:34
  • I've removed all the PPAs that you have mentioned, but I'm not sure about ubuntuhandbook1. Is it safe to remove this? Also, I don't see mongodb PPA here. https://imgur.com/er5QUkN – metalhead Aug 23 '20 at 06:44
  • I have no idea what is ubuntuhandbook, but if it's served by PPA then it is NOT part of Ubuntu. The mongodb PPA is the one you have highlighted that says mongodb... If you use the software you better make backups before uninstall/reinstall – Nmath Aug 23 '20 at 18:00

1 Answers1

0

It's a classic misunderstanding:

To apt, a broken package does NOT mean that it's corrupt or defective. It's merely an incompatible version.

Generally, DON'T try to remove or uninstall "broken" packages. Sometimes you can, but sometimes, doing so will remove other packages. It's that apt dependency chain.

This kind of error usually occurs when folks read advice on the internet about how to get the newest or latest software.

The best way to fix the problem is to undo whatever changes you made: Restore the original Ubuntu repositories and remove the non-Ubuntu sources and PPAs that provided the broken package(s). Then it's usually possible to tell apt to (re-)install the compatible version of the broken package, which solves the problem.

user535733
  • 62,253