如何更新 YUM 存储库?

如何更新 YUM 存储库?

我对这一切还很陌生,所以如果能得到帮助的话,请循序渐进。

我正在尝试连接到以下存储库,以便可以更新我的 YUM 包: http://repo.webtatic.com/yum/centos/5/SRPMS/

老实说,我不知道如何通过 SSH 做到这一点——任何指导都非常感谢。

答案1

说明列于:http://www.webtatic.com/projects/yum-repository/

rpm -ivh http://repo.webtatic.com/yum/centos/5/`uname -i`/webtatic-release-5-0.noarch.rpm

答案2

yum 清理元数据

取自“man yum” ?clean

CLEAN OPTIONS

  yum clean expire-cache
         Eliminate  the local data saying when the metadata and mirrorlists were downloaded for each repo. This means yum will revalidate the cache for each repo. next time it is used. However if the cache is still valid, nothing significant was deleted.

  yum clean packages
         Eliminate any cached packages from the system.  Note that packages are not automatically deleted after they are downloaded.

  yum clean headers
         Eliminate all of the header files, which old versions of yum used for dependency resolution.

  yum clean metadata
         Eliminate all of the files which yum uses to determine the remote availability of packages. Using this option will force yum to download all the metadata the next time it is run.

  yum clean dbcache
         Eliminate the sqlite cache used for faster access to metadata.  Using this option will force yum to download the sqlite metadata the next time it is run, or recreate the sqlite  metadata  if using an older repo.

  yum clean rpmdb
         Eliminate any cached data from the local rpmdb.

  yum clean plugins
         Tell any enabled plugins to eliminate their cached data.

  yum clean all
         Does  all  of  the  above.  As a convenience, if this command does not result in a completely empty cache due to the restrictions outlined at the beginning of this section, a message will be printed, saying how much disk space can be reclaimed by cleaning the remaining repos manually.  For this purpose, a repo is considered clean when its disk usage doesn't exceed 64KB (that  is to account for directory entries and tiny metadata files such as "productid" that are never cleaned).

答案3

首先,您必须在 yum 的配置文件中设置存储库。创建存储库配置如下:

# cd /etc/yum.repos.d
# nano Webtatic

在文件中插入类似这样的内容

[webtatic] 
name=Webtatic repo
baseurl=http://repo.webtatic.com/yum/centos/5/SRPMS/
enabled=1 
gpgcheck=1 
gpgkey=http://repo.webtatic.com/yum/RPM-GPG-KEY-webtatic-andy

保存并关闭文件。然后导入存储库的密钥:

# rpm --import http://repo.webtatic.com/yum/RPM-GPG-KEY-webtatic-andy

此时存储库已添加到 yum。现在您只需使用它。

# yum update

答案4

Yum 会自动下载软件包列表,存储库配置在 /etc/yum.repos.d 下的文件中。此外,它不会下载源 RPM,请参阅:http://yum.baseurl.org/wiki/Faq#Q.14:如何下载源软件包i.easrc.rpm文件

该站点的最小 repo 文件看起来如下所示:

[webtatic]
name=CentOS-5 - Webtatic.com
baseurl=http://repo.webtatic.com/yum/centos/5/$basearch/

相关内容