Total break down after running apt-get autoremove

After running apt-get autoremove and confirming that I would take the risk of removing the running kernel image, I am now not even able to ssh to my ATV. When I am rebooting the ATV I get the sad smiley face as already before. Any ideas how to fix that rather severe problem?

That doesn’t sound right at all.
Can you paste the output of apt-get autoremove?

Thanks

Unfortunately most of it is only in German:
root@OSMC:~# apt-get autoremove
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen… Fertig
Die folgenden Pakete werden ENTFERNT:
atv-image-4.2.3-22-osmc
0 aktualisiert, 0 neu installiert, 1 zu entfernen und 0 nicht aktualisiert.
Nach dieser Operation werden 44,4 MB Plattenplatz freigegeben.
Möchten Sie fortfahren? [J/n] j

Fortschritt: [ 25%] [############################################…]
Paketkonfiguration

Konfiguriere atv-image-4.2.3-22-osmc───────────────────────────────────────────────────────────────Sie versuchen, die gleiche Version (4.2.3-22-osmc) des Kernels zu entfernen, die Sie derzeit verwenden. Dies hat möglicherweise katastrophale Folgen. Es wird nicht nur │
│ /boot/vmlinuz-4.2.3-22-osmc entfernt, was es unmöglich macht, diesen Kernel zu starten (Sie müssen sicherstellen, dass Ihr Bootloader aktualisiert wurde, um einen neuen Kernel zu starten), │
│ sondern auch alle Module im Verzeichnis /lib/modules/4.2.3-22-osmc. Nur eine Kopie des Kernel-Images zu haben ist nicht ausreichend, Sie müssen auch die Module ersetzen. │
│
│ Nochmal: dies ist sehr gefährlich. Sollten Sie auf irgendeine Art und Weise Zweifel haben, antworten Sie mit »Ja«. Wenn Sie genau wissen, was Sie tun und darauf vorbereitet sind, ihr System │
│ unbrauchbar zu machen, dann antworten Sie mit »Nein«. │
│ Wollen Sie die Deinstallation jetzt abbrechen? │
< Ja > < Nein > │
Ok, proceeding with removing running kernel image.
Examining /etc/kernel/prerm.d.
Fortschritt: [ 75%] [####################################################################################################################################…] Ex
root@OSMC:~#

That’s fine.

So what’s the current kernel version (uname or /proc/version).
I have tried to fix the NVIDIA mismatch but it may not yet be fixed. Logs will confirm.

Should be 4.2.3-24

Sam

The problem right now is that I can not access my ATV via ssh anymore. There is an IP adress I can find via checking my router but it now longer says “apple tv” but “unknown” instead, so I can not connect. Any ideas?

You can access the command line with a keyboard

But suspect you will need network activity to resolve this.

Sam

removing the running kernel image?
Well, that is to happen.
Never remove the currently running kernel. Would be like removing your car under your but while driving at 220Km/h on a german highway :slight_smile: That hurts! :smiley: :smiley: :smiley:

Check with “uname” which kernel you are currently running, and if it is the one the system proposes you to remove, don’t.
Reboot the system into the new kernel, then remove the old one.

Well, thanks for that advice. But as I already described it’s too late for that. I already removed the currently running kernel and now I am stuck on the sad smiley face again, but additionally can not enter via ssh (and a new IP address I checked at the router) the atv. Any suggestions?

yes. Connect a keyboard to it and use Ctrl-Alt-F1 to go to a console, and try fixing it from the console.
Alternative is to re-flash the device.

I’m on a Vero 4K and I distinctly remember a similar message. My reaction at the time was WTF, since most systems keep at least one generation of kernel as a fallback.

So a quick sniff through the apt term.log came up with the goods:

Configuring vero364-image-3.14.29-8-osmc
<snip>
You are running a kernel (version 3.14.29-8-osmc) and attempting to remove the same version. This is a potentially disastrous action. Not
only will /boot/vmlinuz-3.14.29-8-osmc be removed, making it impossible to boot it, (you will have to take action to change your boot loader
to boot a new kernel), it will also remove all modules under the directory /lib/modules/3.14.29-8-osmc. Just having a copy of the kernel
image is not enough, you will have to replace the modules too.

I repeat, this is very dangerous. If at all in doubt, answer Yes. If you know exactly what you are doing, and are prepared to hose your
system, then answer No.

Do you want to abort removal now?

So the real question has to be: why on earth are getting such a question in the first place?

That question is very valid … Read and Understand it!
Some people do that (I for instance, because I know what I do), and I usually do that in single-user mode requiring nothing to run on some of my local devices.
I however don’t do that on any device I need or want to keep functional.

Which question? :wink:

Clearly, there must be an issue with the update process when, during a normal update, I see such a warning on my screen. Saying that we should “Read and Understand it” is just sidestepping the issue of why it’s there in the first place.

Understanding her means, that you are cutting off the branch you are sitting on.

it is not sidestepping anything. The warning is clear (regular Debian-type warning). If in doubt, don’t do it.

It is sidestepping the issue of why such a potentially dangerous situation has occurred. I have seen it only once, so it is not a regular occurrence.

Perhaps you can explain the circumstances when it might occur.

Everytime you upgrade the kernel (the one you are running) you will see this message.
Especially when doing an auto-remove.
First boot the new kernel, THEN use autoremove to remove the old one.

1 Like

As it happens…

osmc@osmc:~$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... The following packages were automatically installed and are no longer required:
  rbp2-image-4.4.27-9-osmc rbp2-image-4.9.29-2-osmc
Use 'apt-get autoremove' to remove them.
Done
The following NEW packages will be installed:
  rbp2-image-4.9.29-4-osmc
The following packages will be upgraded:
  libldap-2.4-2 rbp2-device-osmc rbp2-kernel-osmc rbp2-libcec-osmc sudo
5 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 21.1 MB of archives.
After this operation, 68.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://security.debian.org/ jessie/updates/main libldap-2.4-2 armhf 2.4.40+dfsg-1+deb8u3 [195 kB]
Get:2 http://apt.osmc.tv/ jessie-devel/main rbp2-image-4.9.29-4-osmc armhf 4 [19.5 MB]
Get:3 http://security.debian.org/ jessie/updates/main sudo armhf 1.8.10p3-1+deb8u4 [835 kB]
Get:4 http://apt.osmc.tv/ jessie-devel/main rbp2-kernel-osmc armhf 3.6.1 [998 B]                                                                     
Get:5 http://apt.osmc.tv/ jessie-devel/main rbp2-device-osmc armhf 1.4.0 [241 kB]                                                                    
Get:6 http://apt.osmc.tv/ jessie-devel/main rbp2-libcec-osmc armhf 4.0.2-5 [317 kB]                                                                  
Fetched 21.1 MB in 20s (1,006 kB/s)                                                                                                                  
Preconfiguring packages ...
(Reading database ... 51163 files and directories currently installed.)
Preparing to unpack .../libldap-2.4-2_2.4.40+dfsg-1+deb8u3_armhf.deb ...
Unpacking libldap-2.4-2:armhf (2.4.40+dfsg-1+deb8u3) over (2.4.40+dfsg-1+deb8u2) ...
Selecting previously unselected package rbp2-image-4.9.29-4-osmc.
Preparing to unpack .../rbp2-image-4.9.29-4-osmc_4_armhf.deb ...
Examining /etc/kernel/preinst.d/
run-parts: executing /etc/kernel/preinst.d/001-preprocess-rbp 4.9.29-4-osmc /boot/vmlinuz-4.9.29-4-osmc
Done.
Unpacking rbp2-image-4.9.29-4-osmc (4) ...
Preparing to unpack .../sudo_1.8.10p3-1+deb8u4_armhf.deb ...
Unpacking sudo (1.8.10p3-1+deb8u4) over (1.8.10p3-1+deb8u3) ...
Preparing to unpack .../rbp2-kernel-osmc_3.6.1_armhf.deb ...
Unpacking rbp2-kernel-osmc (3.6.1) over (3.5.8) ...
Preparing to unpack .../rbp2-device-osmc_1.4.0_armhf.deb ...
Unpacking rbp2-device-osmc (1.4.0) over (1.3.9) ...
Preparing to unpack .../rbp2-libcec-osmc_4.0.2-5_armhf.deb ...
Unpacking rbp2-libcec-osmc (4.0.2-5) over (4.0.2-4) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for systemd (215-17+deb8u7) ...
Setting up libldap-2.4-2:armhf (2.4.40+dfsg-1+deb8u3) ...
Setting up rbp2-image-4.9.29-4-osmc (4) ...

 Hmm. There is a symbolic link /lib/modules/4.9.29-4-osmc/build
 However, I can not read it: No such file or directory
 Therefore, I am deleting /lib/modules/4.9.29-4-osmc/build


 Hmm. The package shipped with a symbolic link /lib/modules/4.9.29-4-osmc/source
 However, I can not read the target: No such file or directory
 Therefore, I am deleting /lib/modules/4.9.29-4-osmc/source

Running depmod.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.9.29-4-osmc /boot/vmlinuz-4.9.29-4-osmc
run-parts: executing /etc/kernel/postinst.d/inform-updater 4.9.29-4-osmc /boot/vmlinuz-4.9.29-4-osmc
run-parts: executing /etc/kernel/postinst.d/process-vmlinuz-rbp 4.9.29-4-osmc /boot/vmlinuz-4.9.29-4-osmc
Setting up sudo (1.8.10p3-1+deb8u4) ...
Setting up rbp2-kernel-osmc (3.6.1) ...
Setting up rbp2-device-osmc (1.4.0) ...
Setting up rbp2-libcec-osmc (4.0.2-5) ...
Processing triggers for libc-bin (2.19-18+deb8u9) ...
osmc@osmc:~$ uname -a
Linux osmc 4.4.27-9-osmc #1 SMP PREEMPT Tue Mar 14 20:54:19 UTC 2017 armv7l GNU/Linux
osmc@osmc:~$ sudo reboot
Connection to 192.168.11.88 closed by remote host.
Connection to 192.168.11.88 closed.
[user@fedora-24-dvm ~]$ ssh osmc@192.168.11.88
osmc@192.168.11.88's password: 

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed May 31 12:25:56 2017 from 192.168.11.4
osmc@osmc:~$ uname -a
Linux osmc 4.9.29-4-osmc #1 SMP PREEMPT Tue May 30 19:42:56 UTC 2017 armv7l GNU/Linux
osmc@osmc:~$ 

I don’t see the message.

make a ~# ls -l /boot
and a: ~# uname -a
to see what versions of the kernel are installed and are currently running.

taking then into account this:

Calculating upgrade... The following packages were automatically installed and are no longer required:
  rbp2-image-4.4.27-9-osmc rbp2-image-4.9.29-2-osmc
Use 'apt-get autoremove' to remove them.

we’ll know if we can run the autoremove. I

This would appear to be a bug in OSMC and it is absolutely not normal practice to mark the currently running kernel as an autoremove candidate - or even the previous version. I wondered if Sam was trying to save space but kernels aren’t that big and any space-related benefits of being (too) radical are far outweighed by the benefits of keeping one or two previous versions hanging around. I’ve examined the code I believe to be at fault and will PM Sam separately.

CC @DBMandrake.

For years we’ve been aware of an issue where the currently active kernel will try and remove itself. Our conclusion was that this is extremely rare, and only happened when a new kernel was not installed correctly.

Keen to hear your thoughts.

But OP still hasn’t posted the active running kernel. AppleTV is getting old and causing us a high support burden, so we are removing support in the near future.

Sam

DBMandrake:

It means their currently running kernel is not one that was pulled in by our kernel package dependency.
They probably manually installed a kernel image.

AppleTV suffers from the pitfalls of HFS+ as /boot.
We have provided a lot of advice on how to ensure updates execute successfully, but in short it relies on turning off your device correctly.

I suspect OP has manually tried to install the kernel image after a failed upgrade.
Full logs will let us see what’s occurred