On the other hand, maybe I found a solution (there might still be issues with the SD Card, but here is what I did to get emonhub working again, in case others are hit by the same issue with upgrading…
Recap: my Pi3 was failing to update emonhub, complaining about dependencies for python3-pip:
python3-pip : Depends: python-pip-whl (= 18.1-5) but 18.1-5+rpt1 is to be installed
Recommends: python3-dev (>= 3.2) but it is not going to be installed
Recommends: python3-setuptools but it is not going to be installed
Recommends: python3-wheel but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
sudo: pip3: command not found
What worked for me was removing python-pip-whl:
sudo apt-get remove python-pip-whl
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
gir1.2-glib-2.0 libgirepository-1.0-1 libjs-sphinxdoc libjs-underscore libpython-all-dev python-all python-all-dev python-asn1crypto python-cffi-backend
python-configparser python-crypto python-cryptography python-dbus python-entrypoints python-enum34 python-gi python-ipaddress python-keyring
python-keyrings.alt python-secretstorage python-wheel python-xdg
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
python-pip python-pip-whl
0 upgraded, 0 newly installed, 2 to remove and 119 not upgraded.
After this operation, 2,790 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 51965 files and directories currently installed.)
Removing python-pip (18.1-5+rpt1) ...
Removing python-pip-whl (18.1-5+rpt1) ...
Processing triggers for man-db (2.8.5-2) ...
I then manually installed python3-pip which installed cleanly, although I realised after that I didn’t need to do that, because I then re-ran the install.sh script, which installs python3-pip anyway! The script also downloads other packages (most of which I had manually downloaded whilst trying to fix this yesterday), and starts up the emonhub service, which is now working - Yay!
The re-install of python3-pip, and when I ran the install.sh script, both listed a bunch of packages as no longer needed: I assume they are the python 2.7 versions as they don’t have a “3” in their name? I haven’t removed any, but might be useful to know if we still need them, or, why does apt think they are not needed anymore?
pi@emonpi:/tmp/emonhub $ ./install.sh
Apply raspberrypi serial configuration? 1=yes, 0=no:
You entered 1
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-configobj is already the newest version (5.0.6-3).
python3-pip is already the newest version (18.1-5).
python3-serial is already the newest version (3.4-4).
The following packages were automatically installed and are no longer required:
libjs-sphinxdoc libjs-underscore libpython-all-dev python-all python-all-dev python-asn1crypto python-cffi-backend python-configparser python-crypto
python-cryptography python-dbus python-entrypoints python-enum34 python-gi python-ipaddress python-keyring python-keyrings.alt python-secretstorage
python-wheel python-xdg
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 114 not upgraded.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting paho-mqtt
Downloading https://www.piwheels.org/simple/paho-mqtt/paho_mqtt-1.5.0-py3-none-any.whl (61kB)
100% |████████████████████████████████| 61kB 903kB/s
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.21.0)
Installing collected packages: paho-mqtt
Successfully installed paho-mqtt-1.5.0
Unit /etc/systemd/system/[email protected] is masked, ignoring.
useradd: user 'emonhub' already exists
- installing emonhub.service
- Service ActiveState=active