Oracle Linux出现No more mirrors are available错误:原因及解决办法
Hey there, I’ve run into this exact error dozens of times while working with Oracle Linux, so let’s break down what’s causing it and how to fix it step by step.
Common Causes
- Outdated or dead mirror configs: Oracle updates its official mirror URLs from time to time, so old
.repofiles might point to addresses that no longer exist. - Network connectivity issues: Your system can’t reach the mirror servers—this could be due to firewalls blocking outbound traffic, misconfigured proxies, or a flaky network connection.
- Invalid package name/version mismatch: The package you’re trying to install doesn’t exist in any of your configured repos, either because you typed the name wrong or it’s not supported for your Oracle Linux version.
- Repo conflicts or disabled repos: Multiple repo configurations might be conflicting, or all the repos that carry your target package are disabled.
- End-of-life system version: If you’re running an older Oracle Linux release (like OL6) that’s no longer supported, official mirrors have been taken down.
Step-by-Step Fixes
1. Refresh Your Mirror Configs
First, back up your existing repo files to avoid messing things up:
sudo mkdir -p /etc/yum.repos.d/backup sudo cp /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup/
Then download the latest official repo file for your Oracle Linux version:
- For Oracle Linux 8:
sudo curl -o /etc/yum.repos.d/oracle-linux-ol8.repo https://yum.oracle.com/public-yum-ol8.repo - For Oracle Linux 7:
sudo curl -o /etc/yum.repos.d/oracle-linux-ol7.repo https://yum.oracle.com/public-yum-ol7.repo
Clean out old cache and generate a new one:
sudo yum clean all sudo rm -rf /var/cache/yum sudo yum makecache
2. Troubleshoot Network Issues
First, test if you can reach the mirror server:
ping yum.oracle.com
If it fails, check your firewall settings to ensure HTTP/HTTPS outbound traffic is allowed:
sudo firewall-cmd --list-all
If you use a proxy, add it to your yum config by editing /etc/yum.conf and adding these lines (replace with your proxy details):
proxy=http://your-proxy-address:port proxy_username=your-proxy-username proxy_password=your-proxy-password
3. Verify Package Availability
Double-check that the package you want actually exists in your repos:
yum search your-target-package
If it’s missing, you might need to enable a specific repo. For example, to enable the AppStream repo on OL8:
sudo yum-config-manager --enable ol8_appstream
4. Handle End-of-Life (EOL) Versions
If you’re on an unsupported release like OL6, switch to Oracle’s archive mirrors. Edit your repo file and update the baseurl to:
baseurl=https://yum.oracle.com/repo/OracleLinux/OL6/archive/latest/$basearch/
Then run the cache clean/makecache commands again.
5. Resolve Repo Conflicts
List all enabled repos to spot conflicts:
yum repolist enabled
If you see repos that offer overlapping packages, disable the ones you don’t need:
sudo yum-config-manager --disable repo-name-to-disable
内容的提问来源于stack exchange,提问作者han liu

