AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 540203
Accepted
skyler
skyler
Asked: 2013-09-20 06:30:29 +0800 CST2013-09-20 06:30:29 +0800 CST 2013-09-20 06:30:29 +0800 CST

为什么 yum 必须在每个命令上更新其存储库?

  • 772

对我来说,做任何事情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
centos
  • 2 2 个回答
  • 1033 Views

2 个回答

  • Voted
  1. Best Answer
    Michael Hampton
    2013-09-20T08:15:41+08:002013-09-20T08:15:41+08:00

    您首先yum search以普通用户身份运行,然后以 root 身份运行(使用sudo)。

    以 root 身份调用将其缓存数据存储在 中/var/cache/yum,普通用户不可写。因此,当您以自己的用户帐户运行它时,必须再次下载它并将其存储在另一个临时目录中。

    要解决此问题,请始终yum在 root shell 中运行,或使用sudo.

    • 6
  2. Jenny D
    2013-09-20T06:39:07+08:002013-09-20T06:39:07+08:00

    使用该选项-C来使用有关存储库等信息的缓存版本。从手册页:

      -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.
    
    • 2

相关问题

  • 如何在 Linux 机器上找到有关硬件的详细信息?

  • 使用 crontab 和 /etc/cron.hourly,daily,weekly 的区别

  • 持续监控许多服务器运行状况的简单方法?

  • Hudson 无法在 tomcat5 中启动

  • CentOS 的依赖挑战

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve