I'm using Raspberry Pi 1 model B without GUI and when I try to upgrade software using sudo apt-get upgrade I get the following error:
Segmentation fault
dpkg: warning: subprocess old pre-removal script returned error exit status 139
dpkg: trying script from the new package instead ...
Segmentation fault
dpkg : error processing archive /var/cache/apt/archives/python-rpi.gpio_0.6.2~jessie-1_armhf.deb (--unpack):
subprocess new pre-removal script returned error exit status 139
Segmentation fault
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 139
Errors were encountered while processing:
/var/cache/apt/archives/python-rpi.gpio_0.6.2~jessie-1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I've tried many "solutions" for this problem but none of them have worked, so I guess asking here may help.
I tried sudo aptitude upgrade and I get
dpkg: error processing package python-rpi.gpio (--configure):
package is in a very bad inconsistent state; you should
reinstall it before attempting configuration
Processing triggers for libc-bin (2.19-18+deb8u3) ...
Errors were encountered while processing:
python-rpi.gpio