
私のサーバーにCentOs 7をインストールしましたが、不明な理由に気づきました(少なくとも私にとって)、デフォルトのyumリポジトリは機能しません。
たとえば試してみましたが、yum install vim
得ました。
ロードされたプラグイン: fastmirror
設定されたリポジトリの1つが失敗し(不明)、yumにキャッシュされたデータが不足しているため、続行できません。この時点でyumができる唯一の安全なことは失敗です。この問題を「修正」する方法はいくつかあります。
1. Contact the upstream for the repository and get them to fix the problem. 2. Reconfigure the baseurl/etc. for the repository, to point to a working upstream. This is most often useful if you are using a newer distribution release than is supported by the repository (and the packages for the previous distribution release still work). 3. Run the command with the repository temporarily disabled yum --disablerepo=<repoid> ... 4. Disable the repository permanently, so yum won't use it by default. Yum will then just ignore the repository until you permanently enable it again or use --enablerepo for temporary usage: yum-config-manager --disable <repoid> or subscription-manager repos --disable=<repoid> 5. Configure the failing repository to be skipped, if it is unavailable. Note that yum will try to contact the repo. when it runs most commands, so will have to try and fail each time (and thus. yum will be be much slower). If it is a very temporary problem though, this is often a nice compromise: yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
リポジトリの有効なベースURLが見つかりません:addons / 7
問題が何であるかを調べるためにオンラインで検索しましたが、情報が見つかりませんでした。だから私は基本的に自分自身が追加する必要があるデフォルトのリポジトリを追加する必要があると決めました。
しかし、どうすればいいのかわかりません。
それでは、これを実行してyumを操作する方法はありますか?
CentOs 7をダウンロードできるリンク:
http://mirror.teklinks.com/centos/7.3.1611/isos/x86_64/CentOS-7-x86_64-Everything-1611.iso
編集2
私のCentOSバージョンを考えると、すべてのリポジトリをクリーンアップし、ここで新しいリポジトリを追加するとエラーが消えました。
# yum clean all
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
# rpm -Uvh http://dl.atrpms.net/all/atrpms-repo-7-7.el7.x86_64.rpm
# rpm -Uvh http://repo.webtatic.com/yum/el7/webtatic-release.rpm
しかし、今実行すると、次のような結果がyum install vim
得られます。
ロードされたプラグイン: fastmirror
キャッシュされたホストファイルのイメージ読み込み速度
* epel:ftp.riken.jp * remi-safe :
rpms.remirepo.net エラー:何もしません。
答え1
デフォルトのCentOS 7.xリポジトリの追加を無視しましたが、これがおそらく問題が発生した理由です。ところで、別のRPMを入手することでこの問題を解決できます。
$ rpm -ivh http://mirror.centos.org/centos/7/os/x86_64/Packages/centos-release-7-6.1810.2.el7.centos.x86_64.rpm
メモ:rpm
特定のファイルがどのRPMを提供しているかを照会して、どのRPMを取得できるかを判断できます。私たちの場合、次のファイルは次のとおりです。
$ rpm -qf /etc/yum.repos.d/CentOS-* | sort -u
centos-release-7-6.1810.2.el7.centos.x86_64
このRPMを再インストールすると、.repoの下のデフォルトのストレージファイルが更新されます/etc/yum.d
。ダウンロードURLがわからない場合は、RPMを再クエリして調べることができます。
まず、RPMの名前を書き留めます。
$ rpm -qi centos-release-7-6.1810.2.el7.centos.x86_64 | grep Name
Name : centos-release
その後、検索pkgs.orgこの短い名前の場合は、上記のコマンドに示されているURLにリンクされていますrpm -ivh ...
。
メモ:CentOS 7.3または現在使用されているCentOSのバージョンに同じ手順が適用されます。
答え2
リポジトリソースを構成するファイルは、次の場所にあります。
/etc/yum.conf
/etc/yum.repos.d/*
これらのファイルに正しいストレージリンクがあることを確認してください。特にその一つ/etc/yum/repos.d
編集にはsudoアクセス権が必要な場合があります。/etc/apt/sources.list
Debianベースのシステムと同じです。