2

I entered the following command as suggested, and below that is the error message I got.

$ sudo apt-get update && sudo apt-get dist-upgrade
W: You may want to run apt-get update to correct these problems
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: The package linux-headers-3.13.0-101 needs to be reinstalled, but I can't find an archive for it.

How do I reinstall this package?

Bob Thomson
Ottawa, Canada

wjandrea
  • 14,236
  • 4
  • 48
  • 98
BobT
  • 21
  • Is that before or after the upgrade from 14.04 to 16.04? What's the output of lsb_release -a and apt-cache policy linux-image-generic? – David Foerster Dec 23 '16 at 01:29

1 Answers1

2

To do the distribution upgrade, the command you want is:

sudo do-release-upgrade

The error you are getting is most likely due to the package it's referencing being in a bad state. There are several ways around this, however since you are upgrading my recommendation would be to first remove the package:

sudo apt-get autoremove linux-headers

If this doesn't work you may need to play hardball:

sudo apt-get remove --purge linux-headers

Once you get that package removed, you'll be able to continue normally.

On the off chance that the above commands don't work, take a look at the answers here How to remove package in bad state, software center freezes, no synaptic Even though you are not having issues with Synaptic, it shows you how to handle the bad package that's causing your error.