Update/upgrade grafana

Tags: #<Tag:0x00007f5c94ba1f88> #<Tag:0x00007f5c94ba1ec0> #<Tag:0x00007f5c94ba1df8>

Not a big deal, you can change the check mark to a different post if you like. Giving the credit to the proper post is just a way to, well give credit to the person that took the time to help with an issue. :wink:

Erm, so you just downloaded the new grafana setup, but missed the part to install it:

sudo dpkg -i grafana_6.7.1_armhf.deb

you might want to rename the file first, since it was downloaded as

grafana_6.7.1_armhf.deb.1

So:

mv grafana_6.7.1_armhf.deb.1 grafana_6.7.1_armhf.deb
sudo dpkg -i grafana_6.7.1_armhf.deb

after that, make the changes in grafana.ini and then you just need to reboot grafana

Just curious, but why wouldn’t you set up the repo as directed in the Grafana install instructions? Then you can upgrade easily in the future. They have ARM instructions now (which they didn’t have in the past).

1 Like

@Sascha_Billian:
Thank you for your helpfulness.
Now I have done this:

[16:11:14] openhabian@openhab:~$ mv grafana_6.7.1_armhf.deb.1 grafana_6.7.1_armhf.deb

[16:18:09] openhabian@openhab:~$ sudo dpkg -i grafana_6.7.1_armhf.de

dpkg: error: cannot access archive ‘grafana_6.7.1_armhf.de’: No such file or directory

[16:18:19] openhabian@openhab:~$ sudo dpkg -i grafana_6.7.1_armhf.deb

(Reading database … 50524 files and directories currently installed.)

Preparing to unpack grafana_6.7.1_armhf.deb …

Unpacking grafana (6.7.1) over (6.7.1) …

Replaced by files in installed package grafana-rpi (6.6.1) …

Setting up grafana (6.7.1) …

Restarting grafana-server service… OK

Processing triggers for systemd (241-7~deb10u3+rpi1) …

[16:18:42] openhabian@openhab:~$ sudo nano /etc/grafana/grafana.ini

[16:19:25] openhabian@openhab:~$ sudo reboot

but still it doesn’t work.

When I open the grafana.ini file i see “allow_embedding = true”.
After a reboot I insert on my browser “IP-ADRESS:3000/login”. I allways see the old version of grafana :woozy_face:
What am I doing wrong or have I misunderstood something? :thinking:

@jswim788:
Thank you for your input. Good to know!
Can I use this way even to update grafana (when I just installed it)?

Maybe only the cache of your browser needs to be cleared. It clearly says that Grafana 6.7.1 is installed.

As per @jswim788 if you

echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list 

and then

sudo apt-get update

you can update just Grafana any time a new version is available with

sudo apt-get --only-upgrade install grafana

@Sascha_Billian, @robb01:
Thank you for our inputs.
I dont’ know why my update/upgrade don’t work or I don’t see the new version of grafana. :rage:
On my rpi i get this messages:

and

[10:56:28] openhabian@openhab:~$ sudo apt-get --only-upgrade install grafana
Reading package lists… Done
Building dependency tree
Reading state information… Done
grafana is already the newest version (6.7.1).
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.

-> It clearly says that Grafana 6.7.1 is installed, too.

I reboot the rpi and my windows pc. But when I insert on my browser “IP-ADRESS:3000/login” and I click than on the question mark I allways see the old version (Grafana v6.6.1 (21bf8b71bc)) of grafana :sob:

Did you do a refresh in your browser? On Chrome that’s a control-shift-R. What browser are you using?

Try from a different PC or tablet. I suspect 6.7.1 is indeed installed, but your browser is using cached content as @Sascha_Billian says above.

@jswim788:
I use chrome and firefox.
Both browsers always show the old version. Even after a reboot.
Even a refresh in chrome with your key combination has brought no change.
On my tablet with chrome I only see the old version.

It may be that I have to delete something from the “old version”.
It’s funny that on one side it is installed the new version and on the other side I only see the old one.

For me not understandable… :sweat:

When I would update my system with your instructions I get this message:

[18:59:13] openhabian@openhab:~$ sudo apt-get update
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:3 https://repos.influxdata.com/debian buster InRelease
Ign:4 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Get:5 https://packages.grafana.com/oss/deb stable InRelease [12.1 kB]
Get:6 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Err:5 https://packages.grafana.com/oss/deb stable InRelease
The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 8C8C34C524098CB6
Reading package lists… Done
W: GPG error: https://packages.grafana.com/oss/deb stable InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 8C8C34C524098CB6
E: The repository ‘https://packages.grafana.com/oss/deb stable InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Probably because you need to follow all the instructions here. Anybody looking at this later should go to that link, but here is what it has now for the OSS release:

sudo apt-get install -y apt-transport-https
sudo apt-get install -y software-properties-common wget
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -

# Alternatively you can add the beta repository, see in the table above
sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"

sudo apt-get update
sudo apt-get install grafana

But I don’t think that will change your problem. You only have Grafana server, right? Could the IP address you have point to the wrong/different server?

Do you see any messages in /var/log/syslog or /var/log/grafana/grafana.log that indicate the version as it starts up?

@jswim788:
Thank you for your helpfulness and patience.

I use only one rpi as server with the openhabian distribution and grafana. For openhab and grafana I use the same IP-Adress. Only the port is chanched.

No, unfortunality I don’t see nothing that idicate the version of grafana.

When I use the command (link)

grafana-cli -v

I get the massages

Grafana cli version 6.6.1

It is possible that I have installed on my rpi to versions of grafana (old and new) because on the one site the installation of the new version of grafana is completed and on the other site I see on my browser the old version of grafana?
what could I do now? :thinking:

Sorry, I’m not an expert with linux. How can I delete the message or rather correct the installationspaket of grafana. I get this message:

Thank you!

What do you see if you type this?

systemctl status grafana-server

Something like this?

● grafana-server.service - Grafana instance
   Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2020-03-22 19:39:36 PDT; 5 days ago
     Docs: http://docs.grafana.org
 Main PID: 1379 (grafana-server)
    Tasks: 11 (limit: 4139)
   CGroup: /system.slice/grafana-server.service
           └─1379 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana/grafana-server.pid --packaging=deb cfg:default.paths.logs=/var/log/grafana cfg:default.p

If the last line is similar, type this and see what you get for the version:

/usr/sbin/grafana-server -v

What I see is:

Version 6.7.1 (commit: ca6d08d5cb, branch: HEAD)

Let’s see if that gives a clue.

If you think you may have two versions running try running:

ps axx | grafana

(copy and paste that command).
If you get two versions of /usr/sbin/grafana-server showing then you may have two installations.

Hello!

I get the message:

[10:32:53] openhabian@openhab:~$ /usr/sbin/grafana-server -v
Version 6.6.1 (commit: 21bf8b71bc, branch: HEAD)

When I copy and paste your command I get the message:

[10:35:52] openhabian@openhab:~$ ps axx | grafana
-bash: grafana: command not found

Sorry my bad.
It should be

ps axx | grep grafana

No problem.
I get this message:

[11:42:58] openhabian@openhab:~$ ps axx | grep grafana
427 ? Ssl 7:23 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana/grafana-server.pid --packaging=deb cfg:default.paths.logs=/var/log/grafana cfg:default.paths.data=/var/lib/grafana cfg:default.paths.plugins=/var/lib/grafana/plugins cfg:default.paths.provisioning=/etc/grafana/provisioning
16050 pts/0 S+ 0:00 grep --color=auto grafana

That suggests that you only have the one installation of grafana which is good.
If you are getting
Grafana cli version 6.6.1

then maybe uninstall grafana and try a re-install:

sudo apt-get purge grafana

and then re-install with

sudo apt-get update
sudo apt-get install grafana

Thank you for your helpfulness!

Yes, I think the same.
It’s only strange that I get this answer when I enter this command:

Somewhere are files from the new version of grafana on my system…

This command

will remove all config files and give you a clean start when you re-install.

@robb01:
I’m without words.
Now I have done:

[11:47:31] openhabian@openhab:~$ sudo apt-get purge grafana
[sudo] password for openhabian:
Sorry, try again.
[sudo] password for openhabian:
Sorry, try again.
[sudo] password for openhabian:
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages will be REMOVED:
grafana*
0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded.
After this operation, 105 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database … 50524 files and directories currently installed.)
Removing grafana (6.7.1) …
(Reading database … 50186 files and directories currently installed.)
Purging configuration files for grafana (6.7.1) …
Updating FireMotD available updates count …
[14:41:52] openhabian@openhab:~$ sudo apt-get purge grafana
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package ‘grafana’ is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
[14:42:16] openhabian@openhab:~$ sudo apt-get update
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Get:2 https://packages.grafana.com/oss/deb stable InRelease [12.1 kB]
Ign:3 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Hit:4 https://repos.influxdata.com/debian buster InRelease
Get:5 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Err:2 https://packages.grafana.com/oss/deb stable InRelease
The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 8C8C34C524098CB6
Err:7 http://raspbian.raspberrypi.org/raspbian buster InRelease
Cannot initiate the connection to raspbian.raspberrypi.org:80 (2a00:1098:0:80:1000:75:0:3). - connect (101: Network is unreachable) Could not connect to ra spbian.raspberrypi.org:80 (93.93.128.193), connection timed out
Reading package lists… Done
W: GPG error: https://packages.grafana.com/oss/deb stable InRelease: The following signatures couldn’t be verified because the public key is not available: N O_PUBKEY 8C8C34C524098CB6
E: The repository ‘https://packages.grafana.com/oss/deb stable InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
[14:43:37] openhabian@openhab:~$ sudo apt-get install -y apt-transport-https
Reading package lists… Done
Building dependency tree
Reading state information… Done
apt-transport-https is already the newest version (1.8.2).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
[14:46:54] openhabian@openhab:~$ sudo apt-get install -y software-properties-common wget
Reading package lists… Done
Building dependency tree
Reading state information… Done
software-properties-common is already the newest version (0.96.20.2-2).
wget is already the newest version (1.20.1-1.1).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
[14:46:57] openhabian@openhab:~$ wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
OK
[14:47:22] openhabian@openhab:~$ sudo add-apt-repository “deb https://packages.grafana.com/oss/deb stable main”
Traceback (most recent call last):
File “/usr/bin/add-apt-repository”, line 95, in
sp = SoftwareProperties(options=options)
File “/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py”, line 109, in init
self.reload_sourceslist()
File “/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py”, line 599, in reload_sourceslist
self.distro.get_sources(self.sourceslist)
File “/usr/lib/python3/dist-packages/aptsources/distro.py”, line 93, in get_sources
(self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Raspbian/buster
[14:47:37] openhabian@openhab:~$ sudo apt-get update
Get:1 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Ign:2 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Get:3 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Hit:4 https://repos.influxdata.com/debian buster InRelease
Hit:5 http://archive.raspberrypi.org/debian buster InRelease
Get:6 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages [13.0 MB]
Err:8 https://packages.grafana.com/oss/deb stable InRelease
Cannot initiate the connection to packages.grafana.com:443 (2a04:4e42:39::729). - connect (101: Network is unreachable) Could not connect to packages.grafa na.com:443 (151.101.242.217), connection timed out
Fetched 13.0 MB in 30s (429 kB/s)
Reading package lists… Done
W: Failed to fetch https://packages.grafana.com/oss/deb/dists/stable/InRelease Cannot initiate the connection to packages.grafana.com:443 (2a04:4e42:39::729 ). - connect (101: Network is unreachable) Could not connect to packages.grafana.com:443 (151.101.242.217), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead.
[14:48:26] openhabian@openhab:~$ sudo apt-get update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Get:3 https://packages.grafana.com/oss/deb stable InRelease [12.1 kB]
Hit:4 https://repos.influxdata.com/debian buster InRelease
Ign:5 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Get:6 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Get:7 https://packages.grafana.com/oss/deb stable/main armhf Packages [15.0 kB]
Fetched 21.1 kB in 2s (9,759 B/s)
Reading package lists… Done
[14:49:14] openhabian@openhab:~$ sudo apt-get install grafana
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
grafana
0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 35.6 MB of archives.
After this operation, 105 MB of additional disk space will be used.
Get:1 https://packages.grafana.com/oss/deb stable/main armhf grafana armhf 6.7.1 [35.6 MB]
Fetched 35.6 MB in 14s (2,525 kB/s)
Selecting previously unselected package grafana.
(Reading database … 50186 files and directories currently installed.)
Preparing to unpack …/grafana_6.7.1_armhf.deb …
Unpacking grafana (6.7.1) …
Replaced by files in installed package grafana-rpi (6.6.1) …
Setting up grafana (6.7.1) …

NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable grafana-server

You can start grafana-server by executing

sudo /bin/systemctl start grafana-server
Processing triggers for systemd (241-7~deb10u3+rpi1) …
Updating FireMotD available updates count …
[14:50:17] openhabian@openhab:~$ sudo systemctl enable grafana-server
Synchronizing state of grafana-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable grafana-server
[14:58:27] openhabian@openhab:~$ sudo systemctl start grafana-server
[14:59:20] openhabian@openhab:~$ /usr/sbin/grafana-server -v
Version 6.6.1 (commit: 21bf8b71bc, branch: HEAD)

[15:10:15] openhabian@openhab:~$ sudo /bin/systemctl daemon-reload
[sudo] password for openhabian:
[15:11:44] openhabian@openhab:~$ sudo /bin/systemctl enable grafana-server
Synchronizing state of grafana-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable grafana-server
[15:11:59] openhabian@openhab:~$ sudo /bin/systemctl start grafana-server
[15:12:19] openhabian@openhab:~$ /usr/sbin/grafana-server -v
Version 6.6.1 (commit: 21bf8b71bc, branch: HEAD)

Even after a rebbot i get with the command

/usr/sbin/grafana-server -v
allways the same answer.

Version 6.6.1 (commit: 21bf8b71bc, branch: HEAD)