How to Force a Fresh Installation?

  • What Grafana version and what operating system are you using?
    Version 10.0.2 (commit: b2bbe10fbc, branch: HEAD)

  • What are you trying to achieve?
    I am trying to force a fresh installation (not an upgrade) on a Linux server (Red Hat Enterprise Linux Server release 7.9 (Maipo))

  • How are you trying to achieve it?
    I removed all references to “grafana” that I could find on the server and then installed the latest version by running sudo yum install -y --disablerepo=docker-ce-stable --skip-broken https://dl.grafana.com/enterprise/release/grafana-enterprise-10.0.2-1.x86_64.rpm

  • What happened?
    Everything seemingly installed successfully but I see that it’s likely the postinst didn’t copy files and set permissions likely because it thought it was being upgraded and not freshly installed.

  • What did you expect to happen?
    I was hoping that I removed all references so that it would think it was being installed from scratch again.

  • Can you copy/paste the configuration(s) that you are having problems with?
    Not really having issues with a config file yet because the sample.ini file was not copied over from the /usr/share/grafana/conf/ directory to the /etc/grafana/ directory

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    Not really any errors yet either. I’m just trying to get all of the folder permissions to be set automatically by the installation process and all of files created/copied to the correct locations automatically, too.

  • Did you follow any online instructions? If so, what is the URL?
    Yes: https://grafana.com/docs/grafana/latest/setup-grafana/installation/redhat-rhel-fedora/#install-the-grafana-rpm-package-manually

Just simply using yum remove grafana-enterprise or yum remove packagename should do the trick. As I check the yum docs, that doesn’t just uninstall the software, but takes configuration files and extras with it, it shouldn’t leave anything behind.

Note that if you’ve created special config files, symlinks, or other resources that didn’t come with the package you’d have to manually delete those.

But in essence, it should be as simple as yum remove and then yum install again.

I was hoping that I removed all references so that it would think it was being installed from scratch again.

This is ambiguous - yum will remove what references it originally created, but not any extras so might need clarification on what you mean here.

@davidallen5, thanks so much for the reply!! :pray: I did just as you described and it left quite a few remnants on the server that did not exist prior to me installing grafana yesterday. I’ve exported the text from the terminal to show you but it won’t let me upload a text file, only a photo, so I’ve attached screen shots of the locations that were left behind after removal. Note: nd57 is me and grafana_backup directory is where I put our grafana.ini and plugins for safe keeping while I try to get this server cleaned up and Grafana installed from scratch again.

I will try removing everything again manually and doing another install now that I’ve done yum remove as you suggested and see what happens. My goal here is to get this server to a point where I can easily do a install/upgrade/update Grafana to the next version when it comes out. This historically has not been easy to do on this server and it’s likely due to how Grafana was installed & setup to begin with; hence my wanting to start from scratch.


yum_remove_grafana2

1 Like

@davidallen5 I finally won!! :tada:

  1. After doing yum remove grafana
  2. I manually removed the above remnants
  3. I then ran sudo yum install -y --disablerepo=docker-ce-stable --skip-broken https://dl.grafana.com/enterprise/release/grafana-enterprise-10.0.2-1.x86_64.rpm again
  4. I witnessed log messages from the postinst script as I thought I should :tada:
  5. Was able to start Grafana as I desired with systemctl start grafana-server :tada: :tada:

Thanks for the guidance on this!!

1 Like

you’re quite welcome, glad it worked out. :wink:

1 Like

@davidallen5 I’m having another issue and hope you might be able to help :crossed_fingers:

Since I am using our pre-existing PostgreSQL db, we already have the default organization in the org table but Grafana says it can’t find it in the db.

I’ve tracked down the (possible) code based on the log messages I’m seeing but I can’t figure out why it’s not finding it. Here is the line that should find it and below are screen shots of the ini file and the log messages: https://github.com/grafana/grafana/blob/main/pkg/services/sqlstore/user.go#L153

Any help would be greatly appreciated!!

Matt

P.S. - I got impatient, deleted that record, reset the org_id_seq back to 1, let grafana insert the record, and it started successfully. However, upon stopping and then restarting, it fails to start again with the same log message of not being able to find the org… :roll_eyes: