2012年3月2日星期五

Package Management

1.Package Management on Red hat Linux
   1.1 Yellowdog Updater Modified (Yum)

         • Options Available with Yum
            option        description
            search        Allows you to search for packages available for download
            list              Lists all the packages available for download
            install          Installs a package or packages
            check-update Lists packages available for update
            update        Updates the package specified or downloads and installs any available updates
            remove       Removes a package or packages from your host

            info             Provides package information about a package
            provides     Tells you what package a particular file or feature belongs to
            list ­updates   Lists all the packages with updates available only
            list ­available  Lists all the available packages only
            localinstall    Installs a locally downloaded RPM package
            clean ­all        Cleans up downloaded package files that are no longer needed

   1.2 Configuring Yum

     Yum has its configuration files stored under /etc/yum.conf and /etc/yum.repos.d/, and it stores state files in the directories /var/lib/yum and /var/cache/yum.

     You will not normally need to make changes to the default /etc/yum.conf. An example of when you might want to change configuration is to add a proxy server that Yum should use when downloading packages. The defaults will generally suit most environments. A full list of the available configuration settings for Yum is available through the yum.conf­ man page.
          $­man ­yum.conf

     The files defining what repositories are available to Yum are contained in the /etc/yum.repo.d directory. Let’s look at a generic repository file:
       $­cat­/etc/yum.repo.d/myrepo.repo
       [myrepo]
       name=myrepo
       baseurl=http://myrepo.mydomain.com/pub/linux/releases/$releasever/$basearch/os/
       enabled=1
       gpgcheck=1
       gpgkey=http://myrepo.mydomain.com/linux/RPM-GPG-KEY-linux

        option         description

        [repo-id]     The repo_id is the unique name for the repository.
        name           The name is a description of the repository.
        baseurl        The baseurl is the URL to the repository. This is generally an HTTP URL, much like
                           you would use in a web browser.
        enabled       You can enable or disable the package by specifying 0 for disabled and 1 for enabled.
        gpgcheck    This option tells Yum to check the GPG keys used to “sign” packages so that you can
                           be sure the package hasn’t been tampered with. Specifying 0 turns off checking and
                           1 indicates checking is on.
        gpgkey       This is the URL where Yum should find the repository’s GPG key.

   1.3 Red Hat Package Management (RPM)
         • Options Available with rpm

           options and Flags        description
            -q­|­­--­query                  Allows you to query the RPM database and find information about installed
                                              packages on your host
            -i­|­­--­install                    Installs a local package on your host
            -e­|­­--­erase                   Removes a package from your host
            -U­|­­--­upgrade              Upgrades an existing package or installs a package on your host if it is not
                                              already installed
            -F­|­­--­freshen                Upgrades a package only if an earlier version is installed
            -V­|­­--­verify                  Verifies an installed package


            #­rpm ­­--­query ­­--­all
         This command, which uses the ­--­query flag together with the ­--­all flag, indicating that you are querying all packages, lists all the packages installed.

   1.4 Compiling from Source
         • Configure
            $ ./configure
         • Compile and Make
            # make
         • Install
            $ sudo­ make ­install

         • Uninstall
            $­sudo­ make ­uninstall












没有评论:

发表评论