Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Doing anything with yum is frustratingly slow for me. For example, when searching for a package, finding it, and then trying to install it, both yum commands appear to run the exact same updates, just seconds apart!

What can I do to speed this up?

(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
share|improve this question

2 Answers 2

You first ran yum search as a normal user, and then later ran it as root (with sudo).

The invocation as root stores its cache data in /var/cache/yum, which is not writable to normal users. So, when you ran it as your own user account, it had to be downloaded again and stored in another temporary directory.

To resolve this issue, always run yum in a root shell, or with sudo.

share|improve this answer

Use the option -C to use the cached version of the information about repositories etc. From the man page:

  -C, --cacheonly
          Tells yum to run entirely from system cache - does  not  down-
          load  or  update  any  headers unless it has to to perform the
          requested action. If you’re using this as a user yum will  not
          use  the  tempcache  for the user but will only use the system
          cache in the system cachedir.
share|improve this answer
1  
he will need to enable cache first, by default it is disabled in /etc/yum.conf: "keepcache=1" –  Danila Ladner Sep 19 '13 at 14:45
1  
This is true, though it doesn't answer this question. –  Michael Hampton Sep 19 '13 at 17:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.