I'm stuck with an "Error: There are no enabled repositories"

I’m stuck and am looking for some guidance.

I’m running 8.5 on x86-64.

I need to install packages, but I continue to get the error:

Error: There are no enabled repositories in "/etc/yum.repos.d", "/etc/yum/repos.d", "/etc/distro.repos.d".

When I run dnf repolist all:

repo id                                                        repo name                                                                    status
ha                                                             AlmaLinux 8 - HighAvailability                                               disabled
ha-debuginfo                                                   AlmaLinux 8 - HighAvailability debuginfo                                     disabled
ha-source                                                      AlmaLinux 8 - HighAvailability Source                                        disabled
plus                                                           AlmaLinux 8 - Plus                                                           disabled
plus-debuginfo                                                 AlmaLinux 8 - Plus debuginfo                                                 disabled
plus-source                                                    AlmaLinux 8 - Plus Source                                                    disabled
powertools                                                     AlmaLinux 8 - PowerTools                                                     disabled
powertools-debuginfo                                           AlmaLinux 8 - PowerTools debuginfo                                           disabled
powertools-source                                              AlmaLinux 8 - PowerTools Source                                              disabled
resilientstorage                                               AlmaLinux 8 - ResilientStorage                                               disabled
resilientstorage-debuginfo                                     AlmaLinux 8 - ResilientStorage debuginfo                                     disabled
resilientstorage-source                                        AlmaLinux 8 - ResilientStorage Source                                        disabled

I need to install some PERL modules, upgrade PHP, and other thinks, but I’m foggy on the repos.

Guidance or links to resources would be appreciated.

Thanks :slight_smile:

Are those all?

Where are the ‘baseos’, ‘appstream’, and ‘extras’? They are the core repos that are enabled by default. If you don’t have those defined, then you have erased a file somehow.

They would be in file /etc/yum.repos.d/almalinux.repo that looks like:

# almalinux.repo

[baseos]
name=AlmaLinux $releasever - BaseOS
mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/baseos
# baseurl=https://repo.almalinux.org/almalinux/$releasever/BaseOS/$basearch/os/
enabled=1
gpgcheck=1
countme=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux

[appstream]
name=AlmaLinux $releasever - AppStream
mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/appstream
# baseurl=https://repo.almalinux.org/almalinux/$releasever/AppStream/$basearch/os/
enabled=1
gpgcheck=1
countme=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux

[extras]
name=AlmaLinux $releasever - Extras
mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/extras
# baseurl=https://repo.almalinux.org/almalinux/$releasever/extras/$basearch/os/
enabled=1
gpgcheck=1
countme=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux

## Sources
[baseos-source]
name=AlmaLinux $releasever - BaseOS Source
mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/baseos-source
# baseurl=https://repo.almalinux.org/almalinux/$releasever/BaseOS/Source/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux

[appstream-source]
name=AlmaLinux $releasever - AppStream Source
mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/appstream-source
# baseurl=https://repo.almalinux.org/almalinux/$releasever/AppStream/Source/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux

[extras-source]
name=AlmaLinux $releasever - Extras Source
mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/extras-source
# baseurl=https://repo.almalinux.org/almalinux/$releasever/extras/Source/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux

## Debuginfo
[baseos-debuginfo]
name=AlmaLinux $releasever - BaseOS debuginfo
mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/baseos-debuginfo
# baseurl=https://repo.almalinux.org/almalinux/$releasever/BaseOS/debug/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux

[appstream-debuginfo]
name=AlmaLinux $releasever - AppStream debuginfo
mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/appstream-debuginfo
# baseurl=https://repo.almalinux.org/almalinux/$releasever/AppStream/debug/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux

[extras-debuginfo]
name=AlmaLinux $releasever - Extras debuginfo
mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/extras-debuginfo
# baseurl=https://repo.almalinux.org/almalinux/$releasever/extras/debug/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux

(Re)create that file with above content and then run:

sudo dnf update almalinux-release
sudo dnf reinstall almalinux-release
1 Like

I took this over for someone and I think they left a lot out.

Adding that worked (that almalinux.repo filed existed, but it was empty). But I got an error:

# dnf update alamlinux-release
AlmaLinux 8 - BaseOS                                                 11 MB/s | 7.0 MB     00:00    
AlmaLinux 8 - AppStream                                              13 MB/s | 9.8 MB     00:00    
AlmaLinux 8 - Extras                                                 44 kB/s |  12 kB     00:00    
No match for argument: alamlinux-release
Error: No packages marked for upgrade.

I restarted my server and ran: dnf check-update:

Last metadata expiration check: 0:39:18 ago on Tue 19 Apr 2022 05:45:03 PM EDT.

device-mapper.x86_64                                                                              8:1.02.177-11.el8_5                                                                                                  baseos   
device-mapper-libs.x86_64                                                                         8:1.02.177-11.el8_5                                                                                                  baseos   
expat.x86_64                                                                                      2.2.5-4.el8_5.3                                                                                                      baseos   
firewalld.noarch                                                                                  0.9.3-7.el8_5.1                                                                                                      baseos   
firewalld-filesystem.noarch                                                                       0.9.3-7.el8_5.1                                                                                                      baseos   
glibc.x86_64                                                                                      2.28-164.el8_5.3                                                                                                     baseos   
glibc-all-langpacks.x86_64                                                                        2.28-164.el8_5.3                                                                                                     baseos   
glibc-common.x86_64                                                                               2.28-164.el8_5.3                                                                                                     baseos   
httpd-filesystem.noarch                                                                           2.4.37-43.module_el8.5.0+2631+6f259f31.3.alma                                                                        appstream
httpd-tools.x86_64                                                                                2.4.37-43.module_el8.5.0+2631+6f259f31.3.alma                                                                        appstream
libarchive.x86_64                                                                                 3.3.3-3.el8_5                                                                                                        baseos   
libsmbclient.x86_64                                                                               4.14.5-10.el8_5                                                                                                      baseos   
libwbclient.x86_64                                                                                4.14.5-10.el8_5                                                                                                      baseos   
libxml2.x86_64                                                                                    2.9.7-12.el8_5                                                                                                       baseos   
nscd.x86_64                                                                                       2.28-164.el8_5.3                                                                                                     baseos   
openssl.x86_64                                                                                    1:1.1.1k-6.el8_5                                                                                                     baseos   
openssl-libs.x86_64                                                                               1:1.1.1k-6.el8_5                                                                                                     baseos   
python3-firewall.noarch                                                                           0.9.3-7.el8_5.1                                                                                                      baseos   
samba.x86_64                                                                                      4.14.5-10.el8_5                                                                                                      baseos   
samba-client.x86_64                                                                               4.14.5-10.el8_5                                                                                                      baseos   
samba-client-libs.x86_64                                                                          4.14.5-10.el8_5                                                                                                      baseos   
samba-common.noarch                                                                               4.14.5-10.el8_5                                                                                                      baseos   
samba-common-libs.x86_64                                                                          4.14.5-10.el8_5                                                                                                      baseos   
samba-common-tools.x86_64                                                                         4.14.5-10.el8_5                                                                                                      baseos   
samba-libs.x86_64                                                                                 4.14.5-10.el8_5                                                                                                      baseos   
systemd.x86_64                                                                                    239-51.el8_5.5                                                                                                       baseos   
systemd-libs.x86_64                                                                               239-51.el8_5.5                                                                                                       baseos   
systemd-pam.x86_64                                                                                239-51.el8_5.5                                                                                                       baseos   
systemd-udev.x86_64                                                                               239-51.el8_5.5                                                                                                       baseos   
tzdata.noarch                                                                                     2022a-1.el8                                                                                                          baseos   
vim-common.x86_64                                                                                 2:8.0.1763-16.el8_5.12                                                                                               appstream
vim-enhanced.x86_64                                                                               2:8.0.1763-16.el8_5.12                                                                                               appstream
vim-filesystem.noarch                                                                             2:8.0.1763-16.el8_5.12                                                                                               appstream
vim-minimal.x86_64                                                                                2:8.0.1763-16.el8_5.12                                                                                               baseos

It looks like it will update a bunch of packages, but the “almalinux-release” option fails. Do I need to figure that out first, or can I just run dnf update?

First, you had typo there: alam is not alma.

If almalinux-release is installed and latest version, then just:

dnf reinstall almalinux-release

Both of these should tell whether you have it installed:

rpm -qa alma\*
dnf list alma\*
1 Like

I keep misspelling that. Sorry. Yes, it says all dependencies resolved!

Thank you!

Any inputs here!!
Total 24 MB/s | 20 MB 00:00
AlmaLinux 8.6 - BaseOS 0.0 B/s | 0 B 00:00
Curl error (37): Couldn’t read a file:// file for file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux [Couldn’t open file /etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux]
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing ‘yum clean packages’.