Apt-get unable to securely remove '/boot/System.map-4.4.8-3-osmc.dpkg-tmp': read only file system

I tried to install a python3 library (rpi3) but I got the following error:

osmc@osmc:~$ sudo apt-get install python3-bottle
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages will be REMOVED:
rbp2-image-4.4.8-3-osmc
The following NEW packages will be installed:
python3-bottle
0 upgraded, 1 newly installed, 1 to remove and 72 not upgraded.
1 not fully installed or removed.
Need to get 46,1 kB of archives.
After this operation, 82,5 MB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://security.debian.org/ jessie/updates/main python3-bottle all 0.12.7-1+deb8u2 [46,1 kB]
Fetched 46,1 kB in 0s (278 kB/s)
(Reading database … 32490 files and directories currently installed.)
Removing rbp2-image-4.4.8-3-osmc (3) …
dpkg: error processing package rbp2-image-4.4.8-3-osmc (–remove):
unable to securely remove ‘/boot/System.map-4.4.8-3-osmc.dpkg-tmp’: Datotečni sustav je samo za čitanje
Errors were encountered while processing:
rbp2-image-4.4.8-3-osmc
E: Sub-process /usr/bin/dpkg returned an error code (1)

What would be the best way to solve this?

Would it be OK if I execute:
sudo mount -o remount,rw /boot

and then try again?

NO!!! What you are trying to install is removing the OSMC kernel!

What is python3-bottle? I’m not familiar with that one.

It is a fast, simple and lightweight WSGI micro web-framework for Python. Tutorial — Bottle 0.13-dev documentation

I just tried this on my Pi2, and didn’t get the same. The above quote shows where the problem seems to be. You seem to have an aborted install. I didn’t actually to the install, but I did not get the message you got.

The device isnot RPI3, it is RPI2.

I don’t have a Pi3, but the message about removing a not fully install package makes me think you had some failed updates.

Try sudo apt-get install -f then sudo apt-get autoremove to clean up partially installed and no longer required packages. Then try re-installing.

If you still have a “read only” error your SD card may be faulty.

1 Like

This RPI2 was unmanaged for a long time with mediacenter down. After your suggestions, I have started mediacenter, went to the osmc addon and run the manual update. After several back and forth (complains), osmc managed to update everything and I was able to install python library.

Thanks everyone who tried to help.
Best regards.