在 redhat 6.2 中無法使用 yum 安裝任何東西

在 redhat 6.2 中無法使用 yum 安裝任何東西

我最近運行了一些命令來解決安裝libgcj包的問題頁。我想我從計算機中刪除了一些存儲庫。無論如何,yum install <package-name>之後我無法安裝任何東西。它回傳一個錯誤

Loaded plugins: product-id, security, subscription-manager
Updating certificate-based repositories.
Setting up Install Process
No package libgcj available.
Error: Nothing to do

另外,在更新時使用yum update它不起作用並給出此錯誤

Loaded plugins: product-id, security, subscription-manager
Updating certificate-based repositories.
Setting up Update Process
No Packages marked for Update

運行yum repolist enabled命令給出了這個

Loaded plugins: product-id, security, subscription-manager
Updating certificate-based repositories.
repolist: 0

有人可以展示如何解決這個問題嗎?

這是 rhel-source.repo 檔案的內容

name=Red Hat Enterprise Linux $releasever - $basearch - Source  
baseurl = ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[rhel-source-beta]
name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source 
baseurl = ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-
beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

答案1

我目前沒有 RHEL 系統來檢查官方儲存庫。您應該執行以下操作:

  • 確保您有有效的訂閱 ( subscription-manager list --available --all)
  • 檢查是否yum repolist會列出任何儲存庫(您已經完成了)
  • 檢查/etc/yum.repos.d/.repo 檔案的目錄。如果目錄不為空,請檢查文件是否不包含enabled=0.如果是,請編輯enabled=1或刪除該行
  • 如果 yum.repos.d 中沒有任何 .repo 文件,則重新建立它們 - 如前所述,我現在手邊沒有 RHEL 系統,但最低限度如下:

    [repository]
    name=repository_name
    baseurl=repository_url
    

查看這裡有關新增儲存庫的詳細資訊。

相關內容