AlmaLinux 9 on AWS Lightsail unable to install Grafana via repo

I’ve been trying to install OSS Grafana following the instructions on Install Grafana on RHEL or Fedora | Grafana documentation and it’s not* working. I’m able to create the repo, but anytime dnf attempts to check the repository (update, install, makecache, etc) it just freezes when it gets to it and the process ends up getting killed. No other error messages. I am able to install the RPM directly but any attempt even after that to hit the repo freezes it.

I tried both the old style repo and the new one as recommended in the documentation, no dice. (i had to modify the gpg.key and baseurl URLs because i’m a new user and can only have two URLs in a post. But just know they all start with https://, and don’t have square brackets)

wget -q -O gpg.key packages.grafana[.]com/gpg.key
rpm --import gpg.key

(/etc/yum.repos.d/grafana.repo)
[grafana]
name=grafana
baseurl=packages.grafana[.]com/oss/rpm
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=packages.grafana[.]com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt

or

wget -q -O gpg.key rpm.grafana[.]com/gpg.key
rpm --import gpg.key

(/etc/yum.repos.d/grafana.repo)
[grafana]
name=grafana
baseurl=rpm.grafana[.]com
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=rpm.grafana[.]com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt


[root@xxx ~]# dnf install grafana
Killed

[root@xxx ~]# dnf -v makecache
Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, groups-manager, needs-restarting, playground, repoclosure, repodiff, repograph, repomanage, reposync, system-upgrade
DNF version: 4.14.0
cachedir: /var/cache/dnf
Making cache files for all metadata files.
appstream: has expired and will be refreshed.
baseos: has expired and will be refreshed.
extras: has expired and will be refreshed.
grafana: has expired and will be refreshed.
countme: no event for appstream: window already counted
AlmaLinux 9 - AppStream 41 kB/s | 4.2 kB 00:00
reviving: ‘appstream’ can be revived - repomd matches.
appstream: using metadata from Mon 23 Dec 2024 02:23:46 PM UTC.
countme: no event for baseos: window already counted
AlmaLinux 9 - BaseOS 41 kB/s | 3.8 kB 00:00
reviving: ‘baseos’ can be revived - repomd matches.
baseos: using metadata from Mon 23 Dec 2024 02:24:13 PM UTC.
countme: no event for extras: window already counted
AlmaLinux 9 - Extras 41 kB/s | 3.8 kB 00:00
reviving: ‘extras’ can be revived - repomd matches.
extras: using metadata from Mon 23 Dec 2024 02:24:27 PM UTC.
Grafana 9.0 kB/s | 712 B 00:00
reviving: ‘grafana’ can be revived - repomd matches.
Killed


I’ve tried:
rm -rf /var/cache/dnf/grafana : clears things out, does not help
dnf clean all : clears things out, does not help
dnf -v makecache / dnf makecache --refresh : breaks as long as grafana is enabled
dnf config-manager --set-disabled grafana / dnf config-manager --set-enabled grafana : dnf works again while grafana is disabled
dnf update dnf : it’s on v4.14.0 now


Here is the server info:

[ec2-user@ip-xxx ~]$ hostnamectl
Static hostname: ip-xxx.ec2.internal
Icon name: computer-vm
Chassis: vm
Machine ID: xxx
Boot ID: xxx
Virtualization: amazon
Operating System: AlmaLinux 9.5 (Teal Serval)
CPE OS Name: cpe:/o:almalinux:almalinux:9::baseos
Kernel: Linux 5.14.0-503.16.1.el9_5.x86_64
Architecture: x86-64
Hardware Vendor: Amazon EC2
Hardware Model: t3.micro
Firmware Version: 1.0

I’ll also mention this is on a completely new/fresh/clean instance, nothing else is installed on it.

That has only 1GB of memory. It looks like everything what needs a memory is killed. Use instance type with more memory first.

Oh, ok. I had grafana running on an existing 1gb instance for a number of years (CentOS 7) and didn’t think a new instance would require more memory. Is this new?

Current instance of grafana, i’m trying to upgrade to a new instance because CentOS is no longer supported.


[centos@status ~]$ hostnamectl
Static hostname: example.com
Icon name: computer-vm
Chassis: vm
Machine ID: xxx
Boot ID: xxx
Virtualization: xen
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-1160.45.1.el7.x86_64
Architecture: x86-64

The current instance is:
1 GB RAM, 1 vCPU, 40 GB SSD
The new instance is:
1 GB RAM, 2 vCPUs, 40 GB SSD

I’ll give it a try with a 2GB memory instance and see if that helps. Thanks!

Old instance running grafana v11.2.2
New instance running grafana v11.4.0

I’m not saying that. You may need more memory for installation(not Grafana running) only and then you can run Grafana on 1gb instance for a number of years again. Ask your OS package manager how much memory it needs for installation. But any “killed” indicates it needs more memory than you have.

Creating a 2GB instance did the trick, I was able to install Grafana without issue. Thank you!
Based on your last reply it seems that I need 2GB of memory to install, but could probably run it fine (after install) on 1GB. Unfortunately for AWS, you can’t downgrade an instance, only upgrade it. But that would be good to know if I switch to a platform that allows me to downgrade. Thanks again!