Stuck after atp-get upgrade

after over 40 days of normal operation of OH on my PI I’ve run apt-get update then apt-get upgrade.
now I cannot run many commands and are stuck, please help me!

  • Platform information:
    raspberry PI3

Release = Raspbian GNU/Linux 8 (jessie)

Kernel = Linux 4.4.0-1-rpi2

Platform = none

Uptime = 97 day(s). 9:44:53

CPU Usage = 25.31 % avg over 4 cpu(s) (4 core(s) x 1 socket(s))

CPU Load = 1m: 1.00, 5m: 1.16, 15m: 1.22

Memory = Free: 0.10GB (11%), Used: 0.84GB (89%), Total: 0.94GB

Swap = Free: 0.00GB (0%), Used: 0.00GB (100%), Total: 0.00GB

Root = Free: 25.30GB (91%), Used: 2.20GB (9%), Total: 29.00GB

Updates = 44 apt-get updates available.

Sessions = 1 sessions

Processes = 116 running processes of 32768 maximum processes

PHP = Version: 5.6.33, Memory Limit:

error log:
Installing new version of config file /etc/influxdb/influxdb.conf …
Setting up raspberrypi-bootloader-nokernel (1.20180328-1~nokernel1~jessie) …
Removing ‘diversion of /boot/start.elf to /usr/share/rpikernelhack/start.elf by rpikernelhack’
Removing ‘diversion of /boot/start_cd.elf to /usr/share/rpikernelhack/start_cd.elf by rpikernelhack’
Removing ‘diversion of /boot/start_db.elf to /usr/share/rpikernelhack/start_db.elf by rpikernelhack’
Removing ‘diversion of /boot/start_x.elf to /usr/share/rpikernelhack/start_x.elf by rpikernelhack’
Removing ‘diversion of /boot/bcm2708-rpi-0-w.dtb to /usr/share/rpikernelhack/bcm2708-rpi-0-w.dtb by rpikernelhack’
Removing ‘diversion of /boot/bcm2708-rpi-b-plus.dtb to /usr/share/rpikernelhack/bcm2708-rpi-b-plus.dtb by rpikernelhack’
Removing ‘diversion of /boot/bcm2708-rpi-b.dtb to /usr/share/rpikernelhack/bcm2708-rpi-b.dtb by rpikernelhack’
Removing ‘diversion of /boot/bcm2708-rpi-cm.dtb to /usr/share/rpikernelhack/bcm2708-rpi-cm.dtb by rpikernelhack’
Removing ‘diversion of /boot/bcm2709-rpi-2-b.dtb to /usr/share/rpikernelhack/bcm2709-rpi-2-b.dtb by rpikernelhack’
Removing ‘diversion of /boot/bcm2710-rpi-3-b-plus.dtb to /usr/share/rpikernelhack/bcm2710-rpi-3-b-plus.dtb by rpikernelhack’
Removing ‘diversion of /boot/bcm2710-rpi-3-b.dtb to /usr/share/rpikernelhack/bcm2710-rpi-3-b.dtb by rpikernelhack’
Removing ‘diversion of /boot/bcm2710-rpi-cm3.dtb to /usr/share/rpikernelhack/bcm2710-rpi-cm3.dtb by rpikernelhack’
Removing ‘diversion of /boot/overlays/README to /usr/share/rpikernelhack/overlays/README by rpikernelhack’
Removing ‘diversion of /boot/overlays/adau1977-adc.dtbo to /usr/share/rpikernelhack/overlays/adau1977-adc.dtbo by rpikernelhack’
Removing ‘diversion of /boot/overlays/adau7002-simple.dtbo to /usr/share/rpikernelhack/overlays/adau7002-simple.dtbo by rpikernelhack’
Removing ‘diversion of /boot/overlays/ads1015.dtbo to /usr/share/rpikernelhack/overlays/ads1015.dtbo by rpikernelhack’
Removing ‘diversion of /boot/overlays/ads1115.dtbo to /usr/share/rpikernelhack/overlays/ads1115.dtbo by rpikernelhack’
Removing ‘diversion of /boot/overlays/ads7846.dtbo to /usr/share/rpikernelhack/overlays/ads7846.dtbo by rpikernelhack’
dpkg-divert: error: unable to sync file ‘/boot/overlays/ads7846.dtbo.dpkg-divert.tmp’: Input/output error
dpkg-divert: error: reading package info file ‘/var/lib/dpkg/updates/0000’: Input/output error
/var/lib/dpkg/info/raspberrypi-bootloader-nokernel.postinst: 58: /var/lib/dpkg/info/raspberrypi-bootloader-nokernel.postinst: sync: Input/output error
/var/lib/dpkg/info/raspberrypi-bootloader-nokernel.postinst: 59: /var/lib/dpkg/info/raspberrypi-bootloader-nokernel.postinst: rm: Input/output error
Bus error

[many bus error later…]

/var/lib/dpkg/info/raspberrypi-bootloader-nokernel.postinst: 448: /var/lib/dpkg/info/raspberrypi-bootloader-nokernel.postinst: sync: Input/output error
/var/lib/dpkg/info/raspberrypi-bootloader-nokernel.postinst: 449: /var/lib/dpkg/info/raspberrypi-bootloader-nokernel.postinst: rm: Input/output error
Bus error
/var/lib/dpkg/info/raspberrypi-bootloader-nokernel.postinst: 451: /var/lib/dpkg/info/raspberrypi-bootloader-nokernel.postinst: sync: Input/output error
dpkg: error processing package raspberrypi-bootloader-nokernel (–configure):
subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of libraspberrypi0:
libraspberrypi0 depends on raspberrypi-bootloader-nokernel (= 1.20180328-1~nokernel1~jessie); however:
Package raspberrypi-bootloader-nokernel is not configured yet.

dpkg: error processing package libraspberrypi0 (–configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libraspberrypi-bin:
libraspberrypi-bin depends on libraspberrypi0 (= 1.20180328-1~nokernel1~jessie); however:
Package libraspberrypi0 is not configured yet.

dpkg: error processing package libraspberrypi-bin (–configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.19-18+deb8u10) …
dpkg: unrecoverable fatal error, aborting:
unable to flush updated status of `libc-bin’: Read-only file system
E: Sub-process /usr/bin/dpkg returned an error code (2)
E: Problem executing scripts DPkg::Post-Invoke ‘if [ -x /usr/bin/etckeeper ]; then etckeeper post-install; fi’
E: Sub-process returned an error code

Do sudoku apt-get install package
And install package by package one by one
Don’t try to do all 44 at once.
You’ll get stuck one one probably. Skip it. Do the others. Come back to that one.
If it doesn’t work for that one Google that one

Sure I will do for the next time, but for now system appears to be dead. No way to ssh to it, hope to fine d way to recover as much as possible.
I’m not a linux guru so it will be hard.