1

I am new using ubuntu 18.04 and run into problem when doing daily upgrade.

Here is what I got when I ran: sudo apt upgrade

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: linux-image-4.15.0-111-generic : Depends: linux-modules-4.15.0-111-generic but it is not going to be installed E: Broken packages

Thank you in advance for help

mchid
  • 43,546
  • 8
  • 97
  • 150
JIm Liu
  • 21
  • 2
  • 1
    Usually, in a situation like this, you can run sudo apt update and then sudo apt -f install (make sure to review the changes before you accept the changes). Review the changes to make sure the system will not uninstall packages you want to keep. If the changes look fine, you can proceed. – mchid Nov 24 '20 at 07:24
  • Please let me know if this works in a reply with @mchid at the beginning of the reply. If this works, I will mark your question as a duplicate of a similar question with this same answer. – mchid Nov 24 '20 at 07:25
  • Thank you. Here is what i got: The following packages will be REMOVED: linux-image-4.15.0-111-generic 0 upgraded, 0 newly installed, 1 to remove and 32 not upgraded. 2 not fully installed or removed. After this operation, 8,411 kB disk space will be freed. Do you want to continue? [Y/n] – JIm Liu Nov 24 '20 at 17:19
  • after Y,
    Could not find /boot/grub/menu.lst file. Would you like /boot/grub/menu.lst generated for you? (y/N) /usr/sbin/update-grub-legacy-ec2: line 1101: read: read error: 0: Bad file descriptor run-parts: /etc/kernel/postrm.d/x-grub-legacy-ec2 exited with return code 1 dpkg: error processing package linux-image-4.15.0-111-generic (--remove): installed linux-image-4.15.0-111-generic package post-removal script subprocess returned error exit status 1 Errors were encountered while processing: linux-image-4.15.0-111-generic E: Sub-process /usr/bin/dpkg returned an error code (1)
    – JIm Liu Nov 24 '20 at 17:23
  • Thanks. I believe I found the answer. Follow the procedure in the answer and if you need to, you can run sudo apt -f install if it gets stuck again. – mchid Nov 24 '20 at 20:28
  • Does this answer your question? Ubuntu Server 18.04 apt-get Fails – mchid Nov 24 '20 at 20:28
  • i did that before i posted my question. them i did this: sudo apt -f install. it brought me back to the start point. there seems two files missing. is there a way to copy them from somewhere into the achieves? Thank you. – JIm Liu Nov 24 '20 at 20:33
  • 1
  • @Karel: sudo dpkg --get-selections | grep hold or dpkg --get-selections | grep hold Nothing returned btw re-installation using disc image file on a different disc has no success – JIm Liu Nov 25 '20 at 15:51

0 Answers0