gpt4 book ai didi

linux - 通过虚拟机的 CentOS - 镜像列表中没有 URL

转载 作者:行者123 更新时间:2023-12-04 19:30:07 25 4
gpt4 key购买 nike

关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。












我们不允许在 Stack Overflow 上提出有关专业服务器或网络相关基础设施管理的问题。您可以编辑问题,使其成为 on-topic对于堆栈溢出。


5个月前关闭。


社区在 5 个月前审查了是否重新打开此问题并将其关闭:

原始关闭原因未解决






Improve this question




我正在尝试运行 CentOS 8台服务器通过VirtualBox (6.1.30) (Vagrant),昨天对我来说效果很好,但今天我尝试运行 sudo yum update .由于某种原因,我不断收到此错误:

[vagrant@192.168.38.4] ~  >> sudo yum update
CentOS Linux 8 - AppStream 71 B/s | 38 B 00:00
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
我已经尝试更改 /etc/resolve.conf 上的命名空间, 删除 DNF文件夹和一切。在其他计算机上,这工作得很好,所以我认为问题出在我的主机上。我还尝试重置网络设置(我在 Windows 10 主机上),但也没有成功。这不是 DNS 问题;它工作得很好。
重新安装 Windows 后,我的 VM 中仍然出现相同的错误。
文件 dnf.log:
2022-01-31T15:28:03+0000 INFO --- logging initialized ---
2022-01-31T15:28:03+0000 DDEBUG timer: config: 2 ms
2022-01-31T15:28:03+0000 DEBUG Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, groups-manager, needs-restarting, playground, repoclosure, repodiff, repograph, repomanage, reposync
2022-01-31T15:28:03+0000 DEBUG YUM version: 4.4.2
2022-01-31T15:28:03+0000 DDEBUG Command: yum update
2022-01-31T15:28:03+0000 DDEBUG Installroot: /
2022-01-31T15:28:03+0000 DDEBUG Releasever: 8
2022-01-31T15:28:03+0000 DEBUG cachedir: /var/cache/dnf
2022-01-31T15:28:03+0000 DDEBUG Base command: update
2022-01-31T15:28:03+0000 DDEBUG Extra commands: ['update']
2022-01-31T15:28:03+0000 DEBUG User-Agent: constructed: 'libdnf (CentOS Linux 8; generic; Linux.x86_64)'
2022-01-31T15:28:05+0000 DDEBUG Cleaning up.
2022-01-31T15:28:05+0000 SUBDEBUG
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/dnf/repo.py", line 574, in load
ret = self._repo.load()
File "/usr/lib64/python3.6/site-packages/libdnf/repo.py", line 397, in load
return _repo.Repo_load(self)
libdnf._error.Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 67, in main
return _main(base, args, cli_class, option_parser_class)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 106, in _main
return cli_run(cli, base)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 122, in cli_run
cli.run()
File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 1050, in run
self._process_demands()
File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 740, in _process_demands
load_available_repos=self.demands.available_repos)
File "/usr/lib/python3.6/site-packages/dnf/base.py", line 394, in fill_sack
self._add_repo_to_sack(r)
File "/usr/lib/python3.6/site-packages/dnf/base.py", line 137, in _add_repo_to_sack
repo.load()
File "/usr/lib/python3.6/site-packages/dnf/repo.py", line 581, in load
raise dnf.exceptions.RepoError(str(e))
dnf.exceptions.RepoError: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
2022-01-31T15:28:05+0000 CRITICAL Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

最佳答案

看看这篇文章:CentOS Linux EOL
以下命令帮助了我:

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*
这样做将使 DNF 工作,但您将不再收到任何更新。
要升级到 CentOS 8 流:
sudo dnf install centos-release-stream -y
sudo dnf swap centos-{linux,stream}-repos -y
sudo dnf distro-sync -y
如果您的内核更新(容器中不需要),可以选择重新启动。

关于linux - 通过虚拟机的 CentOS - 镜像列表中没有 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70926799/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com