yum管理-使用yum命令報403 Forbidden錯誤的解決方法


今天筆者在公司redhat 6.x/7.x服務器上使用yum命令報如下錯誤:

[root@qq_5201351 ~]# yum list
Loaded plugins: product-id, refresh-packagekit, search-disabled-repos, security, subscription-manager
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403 Forbidden"
Trying other mirror.
To address this issue please refer to the below knowledge base article

https://access.redhat.com/solutions/69319

If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.

Error: Cannot retrieve repository metadata (repomd.xml) for repository: rhel-6-server-rpms. Please verify its path and try again

為了排錯,筆者只留下了一個redhat.repo(這個文件移動走了,默認也會自動生成),還是報如上錯誤

對於這個403錯誤,筆者剛開始在思考是不是/etc/yum.conf配置中的代理服務器返回的,於是在自己電腦上訪問上面的url也是403錯誤

后又想了下,代理服務器應該也不會干這樣的事,應該更可能還是服務器自身的問題,

對於yum,紅帽系統是使用到了訂閱這個概念的,於是檢查,license及訂閱信息,結果如下:

[root@qq_5201351 ~]# subscription-manager list
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux Server
Product ID:     69
Version:        6.10
Arch:           x86_64
Status:         Subscribed
Status Details:
Starts:         05/30/2020
Ends:           05/30/2021

看着也沒有問題啊,最后反復看到上面的報錯信息,猛然發現了有個鏈接,https://access.redhat.com/solutions/69319

不過好像需要訂閱了的才能看到詳情,解決方案的大體意思是要重新注冊訂閱,於是重新注冊后,問題得到解決!

If an still issue persists, then unregister the system and register again using the following commands:

# subscription-manager unregister
# subscription-manager clean
# subscription-manager register
Subscribe the system with the required subscription(s) or use auto subscribe option to automatically assign subscription to the system.

# subscription-manager attach --auto 
Clean yum cache and try running yum command to confirm whether yum works or not.

# yum clean all 
# yum repolist
If there is Proxy server required to connect to the internet then configure the proxy server.
In /etc/yum.conf please add the proxy details as stated in the article :
e.g.

proxy=http://mycache.mydomain.com:3128
# The account details for yum connections
proxy_username=proxy-user
proxy_password=password.

 

 

 

尊重別人的勞動成果 轉載請務必注明出處:https://www.cnblogs.com/5201351/p/13875743.html

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM