对我来说,做任何事情yum
都慢得令人沮丧。例如,当搜索一个包,找到它,然后尝试安装它时,这两个yum
命令似乎运行完全相同的更新,仅相隔几秒钟!
我能做些什么来加快速度?
(oldcfft)~/workspace/panel (live)> yum search bz2
Loaded plugins: fastestmirror, presto
Determining fastest mirrors
epel/metalink | 14 kB 00:00
* base: mirror.5ninesolutions.com
* epel: mirror.metrocast.net
* extras: centos.unmeteredvps.net
* updates: mirrors-pa.sioru.com
10gen | 951 B 00:00
10gen/primary | 12 kB 00:00
10gen 105/105
base | 3.7 kB 00:00
base/primary_db | 4.4 MB 00:09
epel | 4.2 kB 00:00
epel/primary_db | 5.5 MB 00:13
extras | 3.4 kB 00:00
extras/primary_db | 18 kB 00:00
nginx | 2.9 kB 00:00
nginx/primary_db | 24 kB 00:00
pgdg91 | 2.8 kB 00:00
pgdg91/primary_db | 123 kB 00:00
pgdg92 | 2.8 kB 00:00
pgdg92/primary_db | 112 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 4.4 MB 00:15
epel/pkgtags | 588 kB 00:01
======================================================================== N/S Matched: bz2 =========================
bzip2.x86_64 : A file compression utility
Name and summary matches only, use "search all" for everything.
(oldcfft)~/workspace/panel (live)> sudo yum install -y bzip2
Loaded plugins: fastestmirror, presto
Determining fastest mirrors
epel/metalink | 14 kB 00:00
* base: mirror.es.its.nyu.edu
* epel: mirror.us.leaseweb.net
* extras: centos.unmeteredvps.net
* updates: mirrors-pa.sioru.com
10gen | 951 B 00:00
10gen/primary | 12 kB 00:00
10gen 105/105
base | 3.7 kB 00:00
epel | 4.2 kB 00:00
epel/primary_db | 5.5 MB 00:15
extras | 3.4 kB 00:00
nginx | 2.9 kB 00:00
nginx/primary_db | 24 kB 00:00
pgdg91 | 2.8 kB 00:00
pgdg91/primary_db | 123 kB 00:00
pgdg92 | 2.8 kB 00:00
pgdg92/primary_db | 112 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 4.4 MB 00:10
Setting up Install Process
Package bzip2-1.0.5-7.el6_0.x86_64 already installed and latest version
Nothing to do
您首先
yum search
以普通用户身份运行,然后以 root 身份运行(使用sudo
)。以 root 身份调用将其缓存数据存储在 中
/var/cache/yum
,普通用户不可写。因此,当您以自己的用户帐户运行它时,必须再次下载它并将其存储在另一个临时目录中。要解决此问题,请始终
yum
在 root shell 中运行,或使用sudo
.使用该选项
-C
来使用有关存储库等信息的缓存版本。从手册页: