CT320

Three headers follow: ! Long name of class !! Semester !!! New Chapter 12, replaced by the name of the current page.

CT320: Network and System Administration

Fall 2013

New Chapter 12

Links to the various pages for this class:

Wish I could do this: * Schedule

See this page as a slide show

CT 320: Network and System Administration

Chapter 12: Software Installation

Colorado State University
Computer Science Department

Original slides from Dr. James Walden at Northern Kentucky University.

Topics

  1. The Problem of Software Installation
  2. Package Management Systems
  3. Using RPM
  4. Finding RPMs
  5. Building RPMs

Software Installation

  1. Customization
    • Select options, e.g., language.
    • Select file set.
  2. Install new files in appropriate locations.
  3. Modify existing configuration files.
  4. Make software available to user.
    • Shell configuration (PATH, etc.)
    • GUI configuration (menu, icons, etc.)

What’s the problem?

Package Manager Features

UNIX Package Management Systems

RPM Package Names

RPM Package Contents

Using RPM

  1. Install
  2. Uninstall
  3. Upgrade
  4. Query
  5. Verify

Installing a Package (rpm)

  1. Check the package and the files it wants to install.
  2. Perform preinstallation tasks.
  3. Uncompress the files and copy them in the proper locations
  4. Perform post-processing tasks
  5. Update the RPM Database
    > rpm -Uvh foo-1.0-1.i386.rpm
    Preparing... ############################## [100%]
    1:foo ############################## [100%]

Upgrading a Package (rpm)

    > rpm -Uvh foo-1.0-1.i386.rpm
    Preparing... ################################ [100%]
    1:foo ################################ [100%]

Uninstalling a Package (rpm)

Completely removes package from system.

    > rpm -e foo-1.0-1
    > rpm -q foo
    package foo is not installed.

Dependencies

    # rpm -e setup
    error: Failed dependencies:
    setup is needed by (installed) basesystem-8.0-1
    setup >= 2.0.3 is needed by (installed)
    initscripts-6.95-1
    setup >= 2.5.4-1 is needed by (installed)
    filesystem-2.1.6-5
    setup is needed by (installed) xinetd-2.3.7-2
    setup is needed by (installed) dump-0.4b28-4
    # rpm -q setup
    setup-2.5.20-1

Dependency Resolution

RPM Options

    rpm --prefix /usr/local -Uvh *.rpm
    rpm --oldpackage -Uvh foo-0.9-2.i386.rpm

Just Testing

Querying the RPM Database

    # rpm -q telnet
    telnet-0.17-31.EL4.3
    # rpm -ql telnet
    /usr/bin/telnet
    /usr/share/man/man1/telnet.1.gz
    # rpm -qi telnet
    Name : telnet Relocations: (not)
    Version : 0.17 Vendor: CentOS
    Release : 31.EL4.3 Build Date: Tue 14 Jun 2005
    Install Date: Sat 11 Feb 2006 Build Host: build5
    Group : Applications/Internet Src RPM: telnet-0.17.src.rpm
    Size : 87254 License: BSD
    Signature : DSA/SHA1, Tue 14 Jun 2005, Key ID a53d0bab443e1821
    Packager : Johnny Hughes <johnny@centos.org>
    Summary : Client program for telnet remote login protocol.
    Description :
    Telnet is a popular protocol for logging into remote systems over the
    Internet. The telnet package provides a command line telnet client.

Querying the RPM Database

    # rpm -qc bash
    /etc/skel/.bash_logout
    /etc/skel/.bash_profile
    /etc/skel/.bashrc
    # rpm -qd sendmail
    /usr/share/man/man1/mailq.sendmail.1.gz
    /usr/share/man/man1/newaliases.sendmail.1.gz
    /usr/share/man/man5/aliases.sendmail.5.gz
    /usr/share/man/man8/mailstats.8.gz
    /usr/share/man/man8/makemap.8.gz
    /usr/share/man/man8/praliases.8.gz
    /usr/share/man/man8/rmail.8.gz
    /usr/share/man/man8/sendmail.sendmail.8.gz
    /usr/share/man/man8/smrsh.8.gz

Searching all Packages

    # rpm -qa | grep telnet
    telnet-0.17-31.EL4.3
    # rpm -qa | grep py
    python-2.3.4-14.1
    pyOpenSSL-0.6-1.p23
    rpm-python-4.3.3-11_nonptl
    pygtk2-2.4.0-1
    python-devel-2.3.4-14.1
    python-ldap-2.0.1-2
    pyxf86config-0.3.19-1
    libxml2-python-2.6.16-6
    python-elementtree-1.2.6-4
    python-sqlite-1.1.6-1
    dbus-python-0.22-12.EL.5
    pyparted-1.6.8-2
    python-urlgrabber-2.9.6-2

Querying Files and Packages

    # rpm -qf /usr/bin/telnet
    telnet-0.17-31.EL4.3
    # rpm -qf /etc/security/limits.conf
    pam-0.77-66.11

Verifying Packages

    # rpm -V telnet
    # rpm -V telnet-server
    missing c /etc/xinetd.d/telnet
    missing /usr/sbin/in.telnetd
    missing d /usr/share/man/man5/issue.5.gz

Finding RPMs

  1. The Red Hat Enterprise Linux CD-ROMs
  2. The Red Hat Errata Page available at http://www.redhat.com/apps/support/errata/
  3. A Red Hat FTP Mirror Site available at http://www.redhat.com/download/mirror.html
  4. Dag RPM Repository at http://dag.wieers.com/home-made/apt/
  5. Search for RPMs at www.rpmfind.net.
  6. Search for RPMs at rpm.pbone.net.

Building from Source

Most free software uses autoconf:

    $ tar zxf software_package
    $ cd software_package
    $ patch <../package.patch
    $ ./configure
    $ make
    $ su
    # make install

Building Source RPMs

    rpm -ivh foo-1.0-2.src.rpm
    cd /usr/src/redhat
    SOURCES: Contains archive of sources + patches.
    SPEC: SPEC files describe how to build RPMs.
    BUILD: The actual build takes place here.
    RPMS: Binary RPMs stored under arch subdirs.
    SRPMS: Source RPMs stored here.
    rpmbuild -ba SPECS/foo.spec
    ls -l RPMS
    ls -l SRPMS

The SPEC File

Why build Source RPMs?

yum Package Installation

    # yum install postgresql.x86_64
    Resolving Dependencies
    Install 2 Package(s)
    Is this ok [y/N]: y
    Package(s) data still to download: 3.0 M
    (1/2): postgresql-9.0.4-5.fc15.x86_64.rpm | 2.8 MB 00:11
    (2/2): postgresql-libs-9.0.4-5.fc15.x86_64.rpm | 203 kB 00:00
    ------------------------------------------------------------
    Total 241 kB/s | 3.0 MB 00:12
    Running Transaction
    Installing : postgresql-libs-9.0.4-5.fc15.x86_64 1/2
    Installing : postgresql-9.0.4-5.fc15.x86_64 2/2

yum Package Removal

    # yum remove postgresql.x86_64
    Resolving Dependencies
    ---> Package postgresql.x86_64 0:9.0.4-5.fc15 will be erased
    Is this ok [y/N]: y
    Running Transaction
    Erasing : postgresql-9.0.4-5.fc15.x86_64 1/1
    Removed:
     postgresql.x86_64 0:9.0.4-5.fc15

yum Package Info

    # yum info samba-common.i686
    Available Packages
    Name : samba-common
    Arch : i686
    Epoch : 1
    Version : 3.5.11
    Release : 71.fc15.1
    Size : 9.9 M
    Repo : updates
    Summary : Files used by Samba servers and clients
    URL : http://www.samba.org/
    License : GPLv3+ and LGPLv3+
    Description : Samba-common provides files necessary for both the
    server and client packages of Samba.

yum Other Commands

    # yum update postgresql.x86_64 // update package
    # yum list | less // list packages
    # yum search firefox // search packages
    Loaded plugins: langpacks, presto, refresh-packagekit
    ============== N/S Matched: firefox ======================
    firefox.x86_64 : Mozilla Firefox Web browser
    gnome-do-plugins-firefox.x86_64 : gnome plugins for firefox
    mozilla-firetray-firefox.x86_64 : System tray for firefox
    mozilla-adblockplus.noarch : Adblocking extension for Firefox
    mozilla-noscript.noarch : JavaScript list extension for Firefox
    Name and summary matches only, use "search all" for everything.

References

Modified: 2013-09-17T20:36

User: Guest

Check: HTML CSS
Edit History Source
Apply to CSU | Contact CSU | Disclaimer | Equal Opportunity
Colorado State University, Fort Collins, CO 80523 USA
© 2015 Colorado State University
CS Building