I tried to apt update and apt upgrade , but then this error msg comes up.

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... 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:
 dpkg : Breaks: libapt-pkg5.0 (< 1.7~b) but 1.2.35 is to be installed
E: Broken packages

I searched the internet for 1 hour, but i didnt find any advice how to fix it.

I tried sudo apt-get -f install sudo dpkg --configure -a sudo apt-get update --fix-missing sudo apt-get --fix-broken install

when i try to use sudo apt-get install --reinstall libapt-pkg5.0this comes up:

WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  apt adduser (due to apt) dash dpkg (due to dash) debconf (due to dash) grep install-info (due to grep) gzip init systemd-sysv (due to init)
  init-system-helpers (due to init) perl-base (due to init-system-helpers) login libpam0g (due to login) libpam-runtime (due to login)
  libpam-modules (due to login) mount util-linux (due to mount) shim-signed grub-efi-amd64-signed (due to shim-signed)
  grub2-common (due to shim-signed) mokutil (due to shim-signed) sbsigntool (due to shim-signed)
0 upgraded, 1 newly installed, 1805 to remove and 2 not upgraded.
Need to get 715 kB of archives.
After this operation, 7.831 MB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'

(there are a lot packages up in the msg that are system relevant)

if you need more information, i can give it to you

  • Did you add PPAs or external repositories? Jul 31, 2022 at 9:41
  • yes i added, winehq, unity, nordvpn,
    – ONees
    Jul 31, 2022 at 10:12
  • the problem started after i typed this rm /etc/apt/sources.list.d/mono-official-stable.list
    – ONees
    Jul 31, 2022 at 11:24
  • before apt upgrade, perhaps disable those external repositories, and after an upgrade, either re-enable them – or, if the repositories have different versions for your upgraded system, re-add the newer versions of those external repositories (not adding this as an "answer", but something to try when debugging this issue)
    – michael
    Jul 31, 2022 at 11:25
  • by "disable external repositories", this can be done through the system upgrade gui via checkboxes, just uncheck the repos that aren't important. This just "comments out" the repos in those config files, which you could instead do manually, if you prefer.
    – michael
    Jul 31, 2022 at 11:28


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.