I tried apt-get install linux-headers-$(uname -r) on both Jessie and Stretch and both failed. This was after doing apt-get update && apt-get upgrade.

The scenario was I was trying to install each of the os's into virtualbox. There, in order to be able to have a shared folder with the host, there is a procedure that must be run and it requires the latest linux-headers.

Thanks, fsmithred. The error message points me to a log file, and in that log file there's another error message that points me to another log file. I'll try pursuing your suggestion, though.

Incidentally, my host system is Wheezy. When my guest system is either Jessie or Stretch, this fails. The only time I've had success is when both host and guest are Wheezy. That shouldn't be so but I wonder if that is the cause.

What we've got here, I must confess, is stupid operator error. The example that I was following used sudo to issue all of the commands. When I changed to a su into root and issued the commands from there, I got no errors.

But now I've got a case of "the operation was successful but the patient died". After installing guest additions, setting up a shared folder still doesn't work and full screen in the guest os still doesn't work.