問題描述
安裝 gcc 時(shí)出現(xiàn)以下問題:
Curl error (37): Couldn't read a file:// file for file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-x86_64 [Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-x86_64]
系統(tǒng)情況
系統(tǒng):fedora-39
國內(nèi)鏡像源:阿里云1、阿里云2
解決方案
此問題是由于yum源下載時(shí)需要檢查此路徑/etc/pki/rpm-gpg下是否有以下文件,查找不到下載就會(huì)報(bào)錯(cuò)。具體解決方案可如下操作(親測有效)。
- 進(jìn)入 對應(yīng)的路徑下:
/etc/pki/rpm-gpg
;
user@fedora$ cd /etc/pki/rpm-gpg
- 查看此路徑下的所有文件;
user@fedora:/etc/pki/rpm-gpg$ pwd
user@fedora:/etc/pki/rpm-gpg$ ls |xargs -n1
文章來源:http://www.zghlxwxcb.cn/news/detail-750044.html
- 進(jìn)入 yum 源文件中編輯,將其 gpgkey 改成
/etc/pki/rpm-gpg
下存在的文件名。
user@fedora$ sudo vi /etc/yum.repos.d/fedora.repo
文章來源地址http://www.zghlxwxcb.cn/news/detail-750044.html
- 執(zhí)行
sudo yum makecache
清除緩存即可。
到了這里,關(guān)于yum安裝軟件時(shí)報(bào)錯(cuò)"Curl error (37): Couldn't read a file:// file for file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-x86_64 "的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!