簡體   English   中英

GCP METADATA OSCONFIG:TRUE 導致 yum check-update 失敗 repo not found

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM