red hat centos 安装 yum

      最近配置了服务器需要安装软件方法有几种。

  1. 下载软件包 ,编译安装 (./configure,make,make install)这样安装配置性更高。相信高手都是这样安装的。
  2. yum安装。这样安装起来比较简单。(yum install  软件包名称 ) 主要适用于(centos,red hat)等.
    卸载:yum remove  软件包名称.
  3. apt-get 安装 这个和yum安装差不多。(sudo apt-get install  软件包名称   ) 主要适用于(ubuntu ,debian).
    卸载 : sudo apt-get autoremove 卸载所有相关包。
  4. 采用 package 方式安装 : 用 package 安装,只要抓取该程序 package 档案。
    安装 (pkg_add package_name)  移除 (pkg_delete package_name)  就可以完成安装 / 移除。
    注意 :文件名称 .tgz 结尾的是 package 文件名称 .tar.gz 结尾的是 source 。
    注 : 目前已经安装的 package 数据库放在 /var/db/pkg/ 这个数据夹之中。
  5. 另外还有 port tree 方式安装 (freebsd).

下面是red hat 安装yum的方法

  1. 下载包 :wget  http://yum.baseurl.org/download/2.0/yum-2.0.8-1.src.rpm   .
    当然也可以选择别的版本:http://yum.baseurl.org/download/2.0/
  2. 进入目录进行安装 :
    rpmbuild --rebuild yum-2.0.8-1.src.rpm
    cd  /usr/src/redhat/RPMS/noarch/
    rpm -ivh yum-2.0.8-1.noarch.rpm
  3. 配置yum更新地址
    [base]

    #name=Red Hat Linux $releasever - $basearch - Base

    #baseurl=http://mirror.dulug.duke.edu/pub/yum-repository/redhat/$releasever/$basearch/

    name=Red Hat Linux $releasever - $basearch - Base

    baseurl= http://centos.ustc.edu.cn/centos/4/os/i386/

    #[updates]

    #name=Red Hat Linux $releasever - Updates

    #baseurl=http://mirror.dulug.duke.edu/pub/yum-repository/redhat/updates/$releasever/

    name=Red Hat Linux $releasever - Updates

    baseurl= http://mirror.centos.org/centos/4/updates/i386/

    [base]
    #name=Red Hat Linux $releasever - $basearch - Base

    #baseurl=http://mirror.dulug.duke.edu/pub/yum-repository/redhat/$releasever/$basearch/

    name=Red Hat Linux $releasever - $basearch - Base

    baseurl= http://centos.ustc.edu.cn/centos/4/os/i386/
  4. 更新yum: yum update 等待更新完成就可以使用yum了。
  5. 下面是yum 基本命令介绍
    install
    is used to install the latest version of a package or group of packages while ensuring that all dependencies are satisfied.
    If no package matches the given package name(s), they are assumed to be a shell glob and any matches are then installed.

    update If run without any packages, update will update every currently installed package. If one or more packages are specified,
    Yum will only update the listed packages. While updating packages, yum will ensure that all dependencies are satisfied.
    If no package matches the given package name(s), they are assumed to be a shell glob and any matches are then installed.

    check-update
    Implemented so you could know if your machine had any updates that needed to be applied without running it interactively.
    Returns exit value of 100 if there are packages available for an update. Also returns a list of the pkgs to be updated in
    list format. Returns 0 and no packages are available for update.

    upgrade
    Can take packages as arguments, upgrade is just like update except that it includes package obsoletes in its calculations -
    this makes it better for distro-version changes, for example: upgrading from somelinux 8.0 to somelinux 9. *deprecated* -
    this command may be removed in the future.

    remove is used to remove the specified packages from the system as well as removing any packages which depend on the package being
    removed.

    list can be used to list various information about available packages; more complete details are available in the List Options
    section below.

    provides
    can be used to find out which package provides some feature or file. Just use a specific name or a file-glob-syntax wild-
    cards to list the packages available or installed that provide that feature or file.

    search can be used to find any packages matching a string in the description, summary, packager and package name fields of an rpm.
    Useful for finding a package you do not know by name but know by some word related to it. Takes the same file glob wild-
    cards as provides.

    info can be used to list a description and summary information about available packages; takes the same arguments as in the List
    Options section below.

    clean is used to clean up various things which accumulate in the yup cache directory over time. More complete details can be
    found in the Clean Options section below.

    原创文章,转载请注明:   转载自Martin

    本文链接地址:   red hat centos 安装 yum


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

思维万创

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值