Articles in this section

dnf-makecache service error on a Plesk server: Failed to download metadata for repo

Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

Symptoms

  • Service dnf-makecache fails to start, and shows a 404 error for a specific repository:

    # systemctl status dnf-makecache.service
    dnf-makecache.service - dnf makecache
    Loaded: loaded (/usr/lib/systemd/system/dnf-makecache.service; static; vendor preset: disabled)
    Active: failed (Result: exit-code) since Sat 2024-11-02 08:43:37 MDT; 30min ago
    Process: 509243 ExecStart=/usr/bin/dnf makecache --timer (code=exited, status=1/FAILURE)
    Main PID: 509243 (code=exited, status=1/FAILURE)

    Nov 02 08:43:37 example.com systemd[1]: Starting dnf makecache...
    Nov 02 08:43:37 example.com dnf[509243]: MariaDB 669 B/s | 146 B 00:00
    Nov 02 08:43:37 example.com dnf[509243]: Errors during downloading metadata for repository 'mariadb':
    Nov 02 08:43:37 example.com dnf[509243]: - Status code: 404 for https://mirrors.xtom.com/mariadb/yum/10.11/rhel/8/x86_64/repodata/repomd.xml (IP: 2604:a840::7)
    Nov 02 08:43:37 example.com dnf[509243]: Error: Failed to download metadata for repo 'mariadb': Cannot download repomd.xml: Status code: 404 for https://mirrors.xtom.com/mariadb/yum/10.11/rhel/8/x86_64/repodata/repomd.xml (IP: 2604:a840::7)
    Nov 02 08:43:37 example.com systemd[1]: dnf-makecache.service: Main process exited, code=exited, status=1/FAILURE
    Nov 02 08:43:37 example.com systemd[1]: dnf-makecache.service: Failed with result 'exit-code'.
    Nov 02 08:43:37 example.com systemd[1]: Failed to start dnf makecache.

Cause

Configured repository is temporarily or permanently unavailable.

Resolution

Edit the necessary repository:

  1. Connect to the server via SSH

  2. Use the URL in the error to find which file is configured to use that specific repository:

    1. For CentOS/AlmaLinux/RHEL/Rocky Linux:

      # grep -ir mirrors.xtom.com /etc/yum.repos.d/
      /etc/yum.repos.d/MariaDB.repo:#baseurl = https://mirrors.xtom.com/mariadb/yum/10.11/rhel/$releasever/$basearch
      /etc/yum.repos.d/MariaDB.repo:gpgkey = https://mirrors.xtom.com/mariadb/yum/RPM-GPG-KEY-MariaDB

    2. For Ubuntu/Debian:

      # grep -ir mirrors.xtom.com /etc/apt/sources.list.d/

    Note: Change the URL above for the one that shows up on the target server.

  3. Edit the found repository file with your favorite editor:

    # vi /etc/yum.repos.d/MariaDB.repo

  4. Comment the line that starts with "baseurl" with a hash (#) and add a new line like this:

    baseurl = https://mirrors.xtom.com/mariadb/yum/10.11/rhel/$releasever/$basearch

    Note: The new URL is provided by the software provider/developer. If the URL is from Plesk, contact Plesk Support.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.