How to get CPU-G to run on 18.04

Solution 1:

I couldn't find up-to-date information on cpu-g. In the meantime you might want to try hardinfo which you can install with:

sudo apt install hardinfo

Then typing hardinfo in the terminal or calling from Dash (Alt+F2) the gui appears like this:

hardinfo.png

You can get most if not all the information you need from cpu-g plus a whole lot more information on your machine.

Solution 2:

Let's see why it does not start:

cd ~/Downloads
wget https://netix.dl.sourceforge.net/project/cpug/cpu-g-0.9.0.tar.gz
tar -xf cpu-g-0.9.0.tar.gz
cd cpu-g-0.9.0

Start it:

$ ./cpu-g
You need to have PyGTK 2.10.0, GTK.Glade and GTK+ 2.10.0 or higher             installed in your system in order to run CPU-G.

So it needs at least two packages to be installed with

sudo apt-get install python-gtk2 python-glade2

Then it will launch:

sudo ./cpu-g

CPU-G on 18.04 LTS

(tested on VM and on real hardware)


About package from PPA (ppa:atareao/atareao) I also see that it does not start with:

$ /opt/extras.ubuntu.com/cpu-g/bin/cpu-g
[Errno 2] No translation file found for domain: 'cpu-g'
/opt/extras.ubuntu.com/cpu-g/share/cpu-g/distros/ubuntu.png
[Errno 2] No such file or directory: '/sys/class/power_supply/BAT0/charge_now'
[Errno 2] No such file or directory: '/sys/class/power_supply/BAT0/charge_now'
Traceback (most recent call last):
  File "/opt/extras.ubuntu.com/cpu-g/bin/cpu-g", line 42, in <module>
      cpug = CPUG()
  File "/opt/extras.ubuntu.com/cpu-g/share/cpu-g/cpug.py", line 999, in __init__
      self.update_info()
  File "/opt/extras.ubuntu.com/cpu-g/share/cpu-g/cpug.py", line 1318, in update_info
      self.start_battery_updater()
  File "/opt/extras.ubuntu.com/cpu-g/share/cpu-g/cpug.py", line 1346, in start_battery_updater
      self.get_battery_duration()
  File "/opt/extras.ubuntu.com/cpu-g/share/cpu-g/cpug.py", line 1079, in get_battery_duration
      inv.battery_info('charge-now')/1000000) + _(' Ah'))
TypeError: unsupported operand type(s) for /: 'str' and 'int'