![](/img/trans.png)
[英]Red Hat Enterprise Linux 8.5 -> check-update -> Cannot download repodata/repomd.xml: All mirrors were tried
[英]GCP METADATA OSCONFIG:TRUE casues yum check-update to fail repo not found
在 Debian 9 Stretch 上使用 GCP 中的新操作系统修补功能>>
将项目元数据 enable-osconfig 的设置添加到 true 并将 enable-guest-attributes 添加到 true 后,GCP 日志记录显示以下错误日志:-
Error Applying yum changes, attempt 1, retrying in 1s: error running yum with args ["check-update" "--assumeyes"]: exit status 1, stdout: There are no enabled repos. Run "yum repolist all" to see the repos you have. You can enable repos with yum-config-manager --enable <repo>
having Run "yum repolist all" the response is repolist: 0
it appears that yum cannot find the repo that OSCONFIG metadata has attempted to add
Log entry: Writing repo file /etc/yum.repos.d/google_osconfig_managed.repo with updated contents
我现在如何解决错误并让 yum-config-manager 引用并安装这个显然存在的 repo(如上所述)?
我尝试过以下变体:
yum -config-manager --enable /etc/yum.repos.d/google_osconfig_managed.repo
但奇怪的是无济于事的回应是:
CRITICAL:yum.cli:Config Error: Error accessing file for config file:///home/accounts/onfig-manager
有任何想法吗? 即使是 URL 到 REPO 也可能有帮助?!
ps 我需要确切的语法,因为我真的不熟悉 BASH
我注意到您正在混合操作系统; 对于 Debian 9 Stretch,首先通过运行此命令 [0] 安装代理,然后您需要添加 debian 存储库 [1],然后如果您不使用“Google 提供的图像”,则需要导入谷歌云公钥 [2]。 最后,验证代理正在您的实例中运行 [3]:
[0]
sudo apt update
sudo apt -y install google-osconfig-agent
[1]
sudo su -c "echo 'deb http://packages.cloud.google.com/apt \ google-compute-engine-stretch-stable main'> /etc/apt/sources.list.d/google-compute-engine.list"
[2]
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \ sudo apt-key add -
[3]
systemctl status google-osconfig-agent
注意:yum 用于 CentOS/RedHat 操作系统。 Yoy 可以在GCP 官方文档中看到有关此的详细信息和“如何”指南
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.