Chown: cannot access '/etc/grafana/*': No such file or directory

Trying to do a fresh install on Ubuntu 18.04.3 LTS. These are the steps I’ve completed so far:

curl https://packages.grafana.com/gpg.key | sudo apt-key add -
sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"
sudo apt-get update
sudo apt-get install grafana

And this is the error the install gives:

chown: cannot access '/etc/grafana/*': No such file or directory
dpkg: error processing package grafana (--configure):
 installed grafana package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 grafana

What does
apt policy grafana
show? If it shows lots then the first 10 lines will do. Copy/paste it here please.

grafana:
  Installed: 6.3.2
  Candidate: 6.3.2
  Version table:
 *** 6.3.2 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
        100 /var/lib/dpkg/status
     6.3.1 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     6.3.0 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     6.2.5 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     6.2.4 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     6.2.3 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     6.2.2 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     6.2.1 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     6.2.0 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     6.1.6 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     6.1.5 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     6.1.4 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     6.1.3 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     6.1.2 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     6.1.1 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     6.1.0 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     6.0.2 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     6.0.1 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     6.0.0 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.4.4 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.4.3 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.4.2 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.4.1 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.4.0 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.3.4 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.3.3 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.3.2 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.3.1 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.3.0 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.2.5 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.2.4 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.2.3 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.2.2 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.2.1 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.2.0 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.1.5 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.1.4 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.1.3 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.1.2 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.1.1 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.1.0 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.0.4 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.0.3 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.0.2 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.0.1 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     5.0.0 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.6.5 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.6.4 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.6.3 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.6.2 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.6.1 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.6.0 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.5.2 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.5.1 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.5.0 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.4.3 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.4.2 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.4.1 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.4.0-pre1 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.4.0 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.3.2 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.3.1 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.3.0 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.2.0 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.1.2-1486989747 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.1.1-1484211277 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.1.0-1484127817 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.0.2-1481203731 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     4.0.1-1480694114 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     3.1.1-1470047149 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     3.1.0-1468321182 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     3.0.4-1464167696 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages
     2.6.0 500
        500 https://packages.grafana.com/oss/deb stable/main amd64 Packages

That looks ok. I haven’t got an 18.04 system but I have checked it installs ok on 19.04.
Is there anything unusual about your 18.04 installation? Is it in a VM for example? Docker? Anything else unusual?
Does the directory /etc exist?
Does the directory /etc/grafana exist? If it does, what does this command show?
ls -al /etc/grafana

It is a VM. What is weird is that I have a sister VM of this machine and everything installs just fine over there. I’ve tried manually creating the empty folder in /etc/grafana and setting permissions but it still fails. If I can’t figure this out I’m going to try upgrading to Ubuntu 19.04 and/or SCP copy from the sister machine to see if I can get things working that way.

Update

I upgraded to Ubuntu 19.04, which afterwards I had to re-add the grafana apt-repository again but still no luck in installing Grafana. :frowning: same error. Next step is going to be looking at manually copying directories over and setting permissions manually.

I think you have something seriously amiss with your system. Are you able to install other packages ok?