GNU/Linux >> LINUX-Kenntnisse >  >> Cent OS

„Cache für Repo ‚repo_name‘ konnte nicht synchronisiert werden, dieses Repo wird ignoriert“ – CentOS/RHEL 8-Fehler

Das Problem

Während der Installation des Pakets oder der Auflistung mit dnf- oder yum-Befehlen werden die folgenden Fehler angezeigt:

# dnf repolist
..
Failed to synchronize cache for repo 'xxx', ignoring this repo.
Failed to synchronize cache for repo 'yyy', ignoring this repo.

Beim Überprüfen der dnf-Protokolle:

# tail -f /var/log/dnf.log
2019-08-12T10:58:13Z INFO --- logging initialized ---
2019-08-12T10:58:13Z DDEBUG timer: config: 3 ms
2019-08-12T10:58:13Z DEBUG Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, needs-restarting, playground, repoclosure, repodiff, repograph, repomanage, reposync
2019-08-12T10:58:13Z DEBUG DNF version: 4.0.9
2019-08-12T10:58:13Z DDEBUG Command: dnf repolist
2019-08-12T10:58:13Z DDEBUG Installroot: /
2019-08-12T10:58:13Z DDEBUG Releasever: 8
2019-08-12T10:58:13Z DEBUG cachedir: /var/cache/dnf
2019-08-12T10:58:13Z DDEBUG Base command: repolist
2019-08-12T10:58:13Z DDEBUG Extra commands: ['repolist']
2019-08-12T10:58:13Z DEBUG repo: downloading from remote: ol8_appstream
2019-08-12T10:58:16Z DEBUG Cannot download 'https://xxx': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried.
2019-08-12T10:58:16Z DEBUG repo: downloading from remote: ol8_baseos_latest
2019-08-12T10:58:18Z DEBUG Cannot download 'https://yyy': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried.
2019-08-12T10:58:18Z WARNING Failed to synchronize cache for repo 'ol8_appstream', ignoring this repo.
2019-08-12T10:58:18Z WARNING Failed to synchronize cache for repo 'ol8_baseos_latest', ignoring this repo.
2019-08-12T10:58:18Z DEBUG No module defaults found
2019-08-12T10:58:18Z DDEBUG timer: sack setup: 5157 ms
2019-08-12T10:58:18Z DEBUG Total packages: 0
2019-08-12T10:58:18Z DDEBUG Cleaning up.

Die Lösung

Dieses Problem kann folgende Ursachen haben:

  • Falsche Datums- und Uhrzeiteinstellungen
  • Alter dnf-Cache verfügbar oder abgelaufen
  • Proxy-Adresse nicht definiert oder falsche Proxy-Adresse in /etc/dnf/dnf.conf angegeben

Führen Sie die folgenden Schritte aus, um das Problem zu beheben:

1. Überprüfen Sie das Datum und die Uhrzeit dieses Servers und stellen Sie sicher, dass sie aktuell sind.

# timedatectl 

oder

# date

2. Löschen Sie den abgelaufenen oder alten Cache mit dem folgenden Befehl:

# dnf clean all

3. Aktualisieren Sie die korrekte Proxy-Adresse in /etc/dnf/dnf.conf Datei, dann seine Fähigkeit, Pakete zu installieren und aufzulisten:

# cat /etc/dnf/dnf.conf
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=True
proxy=http://[proxy-host].[domain].com:[port]

4. Überprüfen Sie den Befehl repolist, um festzustellen, ob das Problem jetzt behoben ist.

# dnf repolist

Versuchen Sie auch, ein Paket zu installieren, zum Beispiel ksh.

# dnf install ksh
Last metadata expiration check: 0:00:52 ago on Mon 12 Aug 2019 04:42:02 PM IST.
Dependencies resolved.
===================================================================================================
Package Arch Version Repository Size
===================================================================================================
Installing:
ksh x86_64 20120801-252.0.1.el8 ol8_appstream 928 k
Transaction Summary
===================================================================================================
Install 1 Package
Total download size: 928 k
Installed size: 3.5 M
Is this ok [y/N]: y
Downloading Packages:
ksh-20120801-252.0.1.el8.x86_64.rpm 129 kB/s | 928 kB 00:07
---------------------------------------------------------------------------------------------------
Total 129 kB/s | 928 kB 00:07
warning: /var/cache/dnf/xxx/packages/ksh-20120801-252.0.1.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ad986da3: NOKEY
Importing GPG key 0xAD986DA3:
Userid : ""
Fingerprint: 76FD 3DB1 3AB6 7410 B89D B10E 8256 2EA9 AD98 6DA3
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-geek
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : ksh-20120801-252.0.1.el8.x86_64 1/1
Running scriptlet: ksh-20120801-252.0.1.el8.x86_64 1/1
Verifying : ksh-20120801-252.0.1.el8.x86_64 1/1
Installed:
ksh-20120801-252.0.1.el8.x86_64

Complete!


Cent OS
  1. So beheben Sie „Cache für Repo-Appstream konnte nicht synchronisiert werden“

  2. Fehler beim Herunterladen von Metadaten für Repo „AppStream“ [CentOS]

  3. So bereinigen Sie den YUM-Cache in CentOS / RHEL

  4. „mlock failed:Cannot allocate memory“ lvcreate-Befehlsfehler in CentOS/RHEL 7

  5. „Bad id for repo:My Repo, byte =2“ yum update error

Installieren Sie Varnish Cache 6 für Apache/Nginx auf CentOS 8

Installieren Sie Varnish Cache für Apache unter CentOS 8

Metadaten für Repo konnten nicht heruntergeladen werden

So installieren Sie Varnish Cache für Apache unter CentOS/RHEL 8

So installieren Sie Varnish Cache 6 für Nginx unter CentOS/RHEL 8

Fix – Fehler:Fehler beim Herunterladen von Metadaten für Repo-Appstream – CentOS 8