我想从存储库安装一些软件包,但总是在我尝试yum install packagename yum updates db时:
Loaded plugins: fastestmirror,langpacks,presto,refresh-packagekit Determining fastest mirrors updates/Metalink | 23 kB 00:00 * fedora: nl.mirror.eurid.eu * rpmfusion-free: ftp.astral.ro * rpmfusion-free-updates: ftp.astral.ro * rpmfusion-nonfree: ftp.astral.ro * rpmfusion-nonfree-updates: ftp.astral.ro * updates: nl.mirror.eurid.eu fedora-awesome | 3.3 kB 00:00 google-chrome | 951 B 00:00 rpmfusion-free-updates | 3.3 kB 00:00 rpmfusion-free-updates/primary_db | 272 kB 00:08 rpmfusion-nonfree-updates | 3.3 kB 00:00 rpmfusion-nonfree-updates/primary_db | 93 kB 00:05 updates | 4.7 kB 00:00 updates/primary_db | 4.6 MB 02:35 updates/group | 1.9 MB 00:33
所以使用yum install packagename -C也行不通(发现“找不到缓存”错误,yum makecache也不会给出结果).
但我只是想在不更新db的情况下安装软件包.
如果你想让yum表现得像apt-get(不是每次运行都更新元数据),编辑/etc/yum.conf并放在那里:
原文链接:https://www.f2er.com/bash/385905.htmlMetadata_expire =从不
要么
Metadata_expire = 7D
如果你想在一周后更新元数据.如果你运行yum makecache,你的元数据将会像Debian中的apt-get update一样更新.
但请记住,如果在配置文件中使用“never”,则必须手动关注它.如果您使用“7d”,您将保存数据带宽,但一周后,元数据将自动更新.
这是Metadata_expire文档:
You can also change from the default of using seconds to using days,hours or minutes by appending a d,h or m respectively. The default is 6 hours,to compliment yum-updatesd running once an hour. It’s also possible to use the word “never”,meaning that the Metadata will never expire.