This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 months ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
您可以使用
dnf -C
从缓存运行,这将防止这种情况发生——或者在DNF配置文件中设置cacheonly
。您还可以将metadata_expire
设置为更高的值 - 默认值为 48 小时,或者当 dnf 配置或存储库文件更改时(选中check_config_file_age
将其关闭)。这些选项在
man dnf.conf
中有详细说明。You can use
dnf -C
to run from the cache, which will prevent this — or setcacheonly
in the DNF configuration file. You can also setmetadata_expire
to a higher value — the default is 48 hours, or when a dnf configuation or repo file changes (checkcheck_config_file_age
to turn this off).These options are detailed in
man dnf.conf
.如果您在这里遇到相同的问题,那么解决方案很容易,基本上对于大多数基于RedHat的发行版,所提取的元数据都将到期约一个小时。您可以简单地通过延长所有回购获取的元数据持续存在的时期来解决此问题,而不是针对生产环境的推荐,而是本地设置可以节省一天的时间。
只需运行命令
即可尝试根据分发来调整回购文件上的时间,可能会有所不同。
If you're here with the same problem the solution is easy, basically for most RedHat based distros the fetched metadata is set to expire for about a hour. You can simply solve this by extending the period that the metadata for all repo fetched remains persistent, its not recomended for prod environments but for a local setup may save the day.
Just run the command
Try to tweak out the time on the repo file, may vary based on distribution.