Error installing grafana

Hi,

Hardware: RPi3 B+
openHAB version: openhab2.5.12 (v1.6.1b)

I am following this link to install grafana on my raspberry pi:

I installed grafana on another raspberry pi successfully just last week following the same steps. Yesterday, on a new raspberry pi, unfortunately, I am getting errors:

sudo apt-get install -y grafana
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package grafana is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package ‘grafana’ has no installation candidate

I could not find any helpful topics similar to this. I would be very grateful if someone could help me resolve this. Thank you!

Please paste the output of the command “grep -r grafana /etc/apt” as a
starter.

Antony.

Thank you so much for your response!
Here it is:

openhabian@openhabMK:~ $ grep -r grafana /etc/apt
/etc/apt/sources.list.d/grafana.list:deb https://packages.grafana.com/oss/deb stable main
/etc/apt/sources.list.d/grafana.list:deb https://packages.grafana.com/oss/deb stable main
/etc/apt/sources.list.d/grafana.list:deb https://packages.grafana.com/oss/deb stable main
/etc/apt/sources.list.d/grafana.list:deb https://packages.grafana.com/oss/deb stable main
Binary file /etc/apt/trusted.gpg matches

So, firstly I wonder why there are four separate references to the repository.

Secondly I wonder whether this matches the results of the same command on your
working Pi.

Thirdly I wonder whether you did “apt-get update” before trying the “apt-get
install grafana”.

Finally I wonder what the output of “apt-cache policy grafana” is.

Please post answers & output :slight_smile:

Antony.

That’s most probably because I tried to install it multiple times.

I am unable to check that, because I don’t have access to that Pi currently. But I followed the exact same instructions from the grafana website.

Yes, I am not that experienced with linux but I followed the exact same instructions from here: Install Grafana on Raspberry Pi | Grafana Labs

openhabian@openhabMK:~ $ apt-cache policy grafana
grafana:
  Installed: (none)
  Candidate: (none)
  Version table:

I was trying to figure it and saw this error that I probably glanced over and missed until today:

openhabian@openhabMK:~ $ sudo apt-get update
[sudo] password for openhabian:
Get:1 http://davesteele.github.io/comitup/repo comitup InRelease [3,936 B]
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Hit:3 https://repos.influxdata.com/debian jessie InRelease
Hit:4 https://deb.nodesource.com/node_12.x buster InRelease
Get:5 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Get:6 https://packages.grafana.com/oss/deb stable InRelease [12.1 kB]
Hit:7 https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable InRelease
Get:8 https://packages.grafana.com/oss/deb stable/main armhf Packages [27.5 kB]
Err:8 https://packages.grafana.com/oss/deb stable/main armhf Packages
  File has unexpected size (27354 != 27478). Mirror sync in progress? [IP: 2a04:4e42:52::729 443]
  Hashes of expected file:
   - Filesize:27478 [weak]
   - SHA512:3cac48f7fec42d716d6f5376ea518cc605428da0a978361d2eacc40f27aa7fc6583fa8fd629c59b95ccf46e8391094c0d1d5aed3f2055357a44e204bc3e67860
   - SHA256:d215ef61beaa16cbfe74dc926d305546e070cfb67814cf57db936362fdb985df
   - SHA1:9be559a23aa29db2e920cb851dcd2ca4ca709ad0 [weak]
   - MD5Sum:a943c884a7351acf0a8f6f7327c6b6f5 [weak]
  Release file created at: Thu, 15 Jul 2021 15:37:51 +0000
Fetched 18.9 kB in 6s (3,305 B/s)
Reading package lists... Done
...
...

Found this:

Same error on a completely fresh install of openhabian on a RPi4:

openhabian@RPi4:~ $ wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
OK
openhabian@RPi4:~ $ echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
deb https://packages.grafana.com/oss/deb stable main
openhabian@RPi4:~ $ sudo apt-get update
Hit:1 http://davesteele.github.io/comitup/repo comitup InRelease
Hit:2 https://repos.influxdata.com/debian jessie InRelease
Get:3 https://packages.grafana.com/oss/deb stable InRelease [12.1 kB]
Hit:4 http://archive.raspberrypi.org/debian buster InRelease
Hit:5 https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable InRelease
Hit:6 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:7 https://deb.nodesource.com/node_12.x buster InRelease
Get:8 https://packages.grafana.com/oss/deb stable/main armhf Packages [27.5 kB]
Err:8 https://packages.grafana.com/oss/deb stable/main armhf Packages
  File has unexpected size (27354 != 27478). Mirror sync in progress? [IP: 2a04:4e42:52::729 443]
  Hashes of expected file:
   - Filesize:27478 [weak]
   - SHA512:3cac48f7fec42d716d6f5376ea518cc605428da0a978361d2eacc40f27aa7fc6583fa8fd629c59b95ccf46e8391094c0d1d5aed3f2055357a44e204bc3e67860
   - SHA256:d215ef61beaa16cbfe74dc926d305546e070cfb67814cf57db936362fdb985df
   - SHA1:9be559a23aa29db2e920cb851dcd2ca4ca709ad0 [weak]
   - MD5Sum:a943c884a7351acf0a8f6f7327c6b6f5 [weak]
  Release file created at: Thu, 15 Jul 2021 15:37:51 +0000
Fetched 12.1 kB in 5s (2,339 B/s)
Reading package lists... Done
E: Failed to fetch https://packages.grafana.com/oss/deb/dists/stable/main/binary-armhf/Packages.bz2  File has unexpected size (27354 != 27478). Mirror sync in progress? [IP: 2a04:4e42:52::729 443]
   Hashes of expected file:
    - Filesize:27478 [weak]
    - SHA512:3cac48f7fec42d716d6f5376ea518cc605428da0a978361d2eacc40f27aa7fc6583fa8fd629c59b95ccf46e8391094c0d1d5aed3f2055357a44e204bc3e67860
    - SHA256:d215ef61beaa16cbfe74dc926d305546e070cfb67814cf57db936362fdb985df
    - SHA1:9be559a23aa29db2e920cb851dcd2ca4ca709ad0 [weak]
    - MD5Sum:a943c884a7351acf0a8f6f7327c6b6f5 [weak]
   Release file created at: Thu, 15 Jul 2021 15:37:51 +0000
E: Some index files failed to download. They have been ignored, or old ones used instead.

Can someone please help?

Hi there,
I am running into the identical issue, any news how to fix this?

Hardware: RP4 4GB
openHAB version: openhab2.5.12 (v1.6.1b)

openhabian@RasPiHome:~ $ sudo apt-get update
Hit:1 http://davesteele.github.io/comitup/repo comitup InRelease
Hit:2 http://giteduberger.fr rpimonitor/ InRelease
Hit:3 http://archive.raspberrypi.org/debian buster InRelease
Hit:4 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:5 https://repos.influxdata.com/debian buster InRelease
Hit:6 https://deb.nodesource.com/node_12.x buster InRelease
Get:7 https://packages.grafana.com/oss/deb stable InRelease [12.1 kB]
Hit:8 https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable InRelease
Get:9 https://packages.grafana.com/oss/deb stable/main armhf Packages [27.5 kB]
Err:9 https://packages.grafana.com/oss/deb stable/main armhf Packages
  File has unexpected size (27478 != 27543). Mirror sync in progress? [IP: 199.232.194.217 443]
  Hashes of expected file:
   - Filesize:27543 [weak]
   - SHA512:15202a2323e68f5eaa846c6ffe1703de65e3c6d0515f2ccc14fda2e4a1b6694b8660676deccf335647700155344b27ca97129eef0ce71c9de95bcb338be40fdb
   - SHA256:0668ea06f63aeb40947a2c3616c75426def5683512883e3cc22b3ec0a94f2d4e
   - SHA1:96b902031aef46080bc8f72aba0b365940d749ee [weak]
   - MD5Sum:50e90d7c2bfba3c752b199af27f300b0 [weak]
  Release file created at: Thu, 22 Jul 2021 10:29:07 +0000
Reading package lists... Done
W: Target Packages (main/binary-armhf/Packages) is configured multiple times in /etc/apt/sources.list.d/openhab.list:1 and /etc/apt/sources.list.d/openhab2.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/openhab.list:1 and /etc/apt/sources.list.d/openhab2.list:1
W: Target Translations (main/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list.d/openhab.list:1 and /etc/apt/sources.list.d/openhab2.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/openhab.list:1 and /etc/apt/sources.list.d/openhab2.list:1
W: Target Translations (main/i18n/Translation-en_GB.UTF-8) is configured multiple times in /etc/apt/sources.list.d/openhab.list:1 and /etc/apt/sources.list.d/openhab2.list:1
E: Failed to fetch https://packages.grafana.com/oss/deb/dists/stable/main/binary-armhf/Packages.bz2  File has unexpected size (27478 != 27543). Mirror sync in progress? [IP: 199.232.194.217 443]
   Hashes of expected file:
    - Filesize:27543 [weak]
    - SHA512:15202a2323e68f5eaa846c6ffe1703de65e3c6d0515f2ccc14fda2e4a1b6694b8660676deccf335647700155344b27ca97129eef0ce71c9de95bcb338be40fdb
    - SHA256:0668ea06f63aeb40947a2c3616c75426def5683512883e3cc22b3ec0a94f2d4e
    - SHA1:96b902031aef46080bc8f72aba0b365940d749ee [weak]
    - MD5Sum:50e90d7c2bfba3c752b199af27f300b0 [weak]
   Release file created at: Thu, 22 Jul 2021 10:29:07 +0000
E: Some index files failed to download. They have been ignored, or old ones used instead.
W: Target Packages (main/binary-armhf/Packages) is configured multiple times in /etc/apt/sources.list.d/openhab.list:1 and /etc/apt/sources.list.d/openhab2.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/openhab.list:1 and /etc/apt/sources.list.d/openhab2.list:1
W: Target Translations (main/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list.d/openhab.list:1 and /etc/apt/sources.list.d/openhab2.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/openhab.list:1 and /etc/apt/sources.list.d/openhab2.list:1
W: Target Translations (main/i18n/Translation-en_GB.UTF-8) is configured multiple times in /etc/apt/sources.list.d/openhab.list:1 and /etc/apt/sources.list.d/openhab2.list:1

Hi,
I am running into the identical issue, any news how to fix this?

Hardware: RP3

Err:9 https://packages.grafana.com/oss/deb stable/main armhf Packages
  File has unexpected size (27478 != 27543). Mirror sync in progress? [IP: 2a04:4e42:4c::729 443]
  Hashes of expected file:
   - Filesize:27543 [weak]
   - SHA512:15202a2323e68f5eaa846c6ffe1703de65e3c6d0515f2ccc14fda2e4a1b6694b8660676deccf335647700155344b27ca97129eef0ce71c9de95bcb338be40fdb
   - SHA256:0668ea06f63aeb40947a2c3616c75426def5683512883e3cc22b3ec0a94f2d4e
   - SHA1:96b902031aef46080bc8f72aba0b365940d749ee [weak]
   - MD5Sum:50e90d7c2bfba3c752b199af27f300b0 [weak]
  Release file created at: Thu, 22 Jul 2021 10:29:07 +0000

On installation appears the following error:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package grafana is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'grafana' has no installation candidate

bump, same thing here

(post deleted by author)

Had the same issue, this was my solution
sudo apt-get update --fix-missing

1 Like

cd /etc/apt/sources.list.d && mv grafana.lis grafana.list

If it’s stupid and it works it’s not stupid.

1 Like