YUM – Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
前幾天在使用CentOS的『yum』指令的當下,突然跳出這個訊息『Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast』當下有點傻眼,但請教Google後,才發現原因很簡單!
下列是我使用『yum』指令:
會跳出這個訊息的話,是不論你接了什麼參數,只要使用yum就會出現。
1 2 |
[andy@www ~]$ sudo yum search installed | grep php Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast |
解決辦法
清除yum repository暫存
清除yum repository暫存:『sudo yum clean all』
1 2 3 4 5 6 |
[andy@www ~]$ sudo yum clean all Loaded plugins: fastestmirror, langpacks Cleaning repos: base epel extras mysql-connectors-community mysql-tools-community mysql57-community remi-safe : updates webtatic Cleaning up everything Cleaning up list of fastest mirrors |
原因
Repository list的更新日期久遠
yum判斷你上次更新repository list的時間太久遠(2週),所以不讓使用者操作yum,以避免安裝到舊的軟體!