Presentation is loading. Please wait.

Presentation is loading. Please wait.

CIT 470: Advanced Network and System Administration

Similar presentations


Presentation on theme: "CIT 470: Advanced Network and System Administration"— Presentation transcript:

1 CIT 470: Advanced Network and System Administration
Package Management CIT 470: Advanced Network and System Administration

2 CIT 470: Advanced Network and System Administration
Topics The Problem of Software Installation Package Management Systems Using RPM Finding RPMs Building RPMs CIT 470: Advanced Network and System Administration

3 Software Installation
Customization Select options like language. Select file set. Install new files in appropriate locations. Modify existing configuration files. Make software available to user. Shell configuration (PATH, etc.) GUI configuration (menu, icons, etc.) CIT 470: Advanced Network and System Administration

4 CIT 470: Advanced Network and System Administration
What’s the problem? What prerequisites does your software have? What prereqs do your prereq packages have? How do you handle conflicts? What if two programs install/modify same file? Does your install work on every type of computer? How do you handle upgrades? What if user has customized configuration? What if ownerships/permissions have changed? What if user needs old and new versions? How do you uninstall software? CIT 470: Advanced Network and System Administration

5 Package Manager Features
Build management. Dependency tracking. Querying. Reversibility. Verification. Version control. CIT 470: Advanced Network and System Administration

6 UNIX Package Management Systems
deb: Debian system uses dpkg and APT. pkgadd: Solaris packaging system. portage: Gentoo uses with emerge. ports: BSD ports system. RPM: Redhat packaging system. tgz: Tarballs used by Slackware. CIT 470: Advanced Network and System Administration

7 CIT 470: Advanced Network and System Administration
RPM RPM Package Manager Originally stood for Red Hat Package Manager Came with Red Hat Linux 2.0 in 1995. Distributions Red Hat Red Hat Enterprise Linux (also CentOS) Fedora Mandriva SUSE RPM on other OS AIX Novell Netware CIT 470: Advanced Network and System Administration

8 CIT 470: Advanced Network and System Administration
RPM Package Names <name>-<version>-<release>.<arch>.rpm Name: name of the software package. Version: version of the software package. Release: release version of the RPM. Arch: architecture (i386, noarch, ppc, etc.) If Arch is src, RPM contains source code for building the package. CIT 470: Advanced Network and System Administration

9 CIT 470: Advanced Network and System Administration
RPM Package Contents Identification Identifies package and RPM version. Signature Checksum and digital signature. Header Package and version information. Specifies dependencies on other packages. Payload Actual files to install. Stored as cpio archive compressed with gzip. Use rpm2cpio to obtain cpio archive. CIT 470: Advanced Network and System Administration

10 CIT 470: Advanced Network and System Administration
Using RPM Install Uninstall Upgrade Query Verify CIT 470: Advanced Network and System Administration

11 CIT 470: Advanced Network and System Administration
Installing a Package Check the package and the files it wants to install. Perform preinstallation tasks. Uncompress the files and copy them in the proper locations Perform post-processing tasks Update the RPM Database > rpm -ivh foo i386.rpm Preparing... ########################################### [100%] 1:foo ########################################### [100%] CIT 470: Advanced Network and System Administration

12 CIT 470: Advanced Network and System Administration
Upgrading a Package Uninstall + install, retaining configuration files. Will install a package if no older version. Will remove all older versions. > rpm -Uvh foo i386.rpm Preparing... ########################################### [100%] 1:foo ########################################### [100%] CIT 470: Advanced Network and System Administration

13 Uninstalling a Package
Completely removes package from system. > rpm -e foo-1.0-1 > rpm –q foo package foo is not installed. CIT 470: Advanced Network and System Administration

14 CIT 470: Advanced Network and System Administration
Dependencies Prevent install/removal if unfulfilled. # rpm -e setup error: Failed dependencies: setup is needed by (installed) basesystem-8.0-1 setup >= is needed by (installed) initscripts setup >= is needed by (installed) filesystem setup is needed by (installed) xinetd setup is needed by (installed) dump-0.4b28-4 # rpm -q setup setup CIT 470: Advanced Network and System Administration

15 Querying the RPM Database
# rpm -q telnet telnet EL4.3 # rpm -ql telnet /usr/bin/telnet /usr/share/man/man1/telnet.1.gz # rpm -qi telnet Name : telnet Relocations: (not) Version : Vendor: CentOS Release : 31.EL Build Date: Tue 14 Jun 2005 Install Date: Sat 11 Feb Build Host: build5 Group : Applications/Internet Src RPM: telnet-0.17.src.rpm Size : License: BSD Signature : DSA/SHA1, Tue 14 Jun 2005, Key ID a53d0bab443e1821 Packager : Johnny Hughes 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. RPM database stored under /var/lib/rpm CIT 470: Advanced Network and System Administration

16 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 CIT 470: Advanced Network and System Administration

17 Searching all Packages
# rpm -qa | grep telnet telnet EL4.3 # rpm -qa | grep py python pyOpenSSL p23 rpm-python _nonptl pygtk python-devel python-ldap pyxf86config libxml2-python python-elementtree python-sqlite dbus-python EL.5 pyparted python-urlgrabber CIT 470: Advanced Network and System Administration

18 CIT 470: Advanced Network and System Administration
Searching Packages Find recently installed packages rpm -qa --last Find packages that are disk hogs rpm -qa --qf "%{size} %{name}\n" | sort –n The --qf (queryformat) option can print arch, name, size, version, distribution, etc. CIT 470: Advanced Network and System Administration

19 Querying Files and Packages
Find which package a file belongs to: # rpm -qf /usr/bin/telnet telnet EL4.3 # rpm -qf /etc/security/limits.conf pam Querying packages Add –p to any query to apply it to a .rpm file instead of to an installed package. CIT 470: Advanced Network and System Administration

20 Dependency Resolution
Higher level tools handle dependencies up2date, yum, yast, urpmi Automatic resolution + downloading. 1. Find dependencies in RPM headers. 2. Download dependencies, check their headers. 3. Repeat. 4. Install after all RPMs downloaded. CIT 470: Advanced Network and System Administration

21 CIT 470: Advanced Network and System Administration
Yellow Dog Updater Modified Rewrite of YUP from Yellow Dog Linux. Used by many RPM-based distributions. Automatically syncs repo metadata. Prevents problems arising from out of data package information on local system. Wastes time when local data up to date. Image from CIT 470: Advanced Network and System Administration

22 CIT 470: Advanced Network and System Administration
Yum Installs yum install pkg: finds specified package, downloads it, and installs it. yum remove pkg: remove the specified package from the system. yum update <pkg>: updates specified package or updates all packages if no package specified. CIT 470: Advanced Network and System Administration

23 yum list <option> <pkgspec>
Options: available: list packages available to be installed. installed: list installed packages like rpm –qa. extras: lists installed packages that are not available on any currently configured repo. recent: lists packages added to repositories in last 7 days. updates: lists updates for any installed packages. Package Specifications: bash bash-3.10 \*sh \*.i386 CIT 470: Advanced Network and System Administration

24 CIT 470: Advanced Network and System Administration
Yum Commands check-update: lists updates, returns 100 if any updates available. clean: removes yum cache files. deplist: list all dependencies for a package. info: list package data like rpm –qi yum provides: find which package provides the specified command, i.e. yum provides \*bin/ls. yum search: lists packages whose name, summary, description, or URL matches the specified search term. CIT 470: Advanced Network and System Administration

25 CIT 470: Advanced Network and System Administration
Package Sources Sources Local files (CD/DVD or hard disk) Red Hat Network commercial sites for RHEL CentOS network official mirrors for CentOS Unofficial network repositories like RPMforge Source configuration up2date: /etc/sysconfig/rhn/sources yum: /etc/yum.conf, /etc/yum/repos.d CIT 470: Advanced Network and System Administration

26 CIT 470: Advanced Network and System Administration
RPMForge RPMForge Repository provides non-official packages Some packages don’t exist in RHEL Other packages are more up to date than RHEL Configure system to use RPMForge via rpm -Uhv CIT 470: Advanced Network and System Administration

27 CIT 470: Advanced Network and System Administration
References Debian FAQ, “Debian Package Management Tools,” Eric Foster-Johnson, RPM Guide, Aeleen Frisch, Essential System Administration, 3rd edition, O’Reilly, 2002. Evi Nemeth et al, UNIX System Administration Handbook, 3rd edition, Prentice Hall, 2001. RedHat, Red Hat Enterprise Linux 4 System Administration Guide, CIT 470: Advanced Network and System Administration


Download ppt "CIT 470: Advanced Network and System Administration"

Similar presentations


Ads by Google