Package Management How to use rpms. Topics The Problem of Software Installation Package Management Systems Using RPM Finding RPMs Building RPMs.

Slides:



Advertisements
Similar presentations
Software Package Management WeeSan Lee. Roadmap What is software package management? RPM YUM pkgtools.
Advertisements

Vulnerability Assessments with Nessus 3 Columbia Area LUG January
Software installation Chapter 7. Software installation Numerous software options Usually free Open source Several sources Installation CD Websites sourceforge.net.
Linux+ Guide to Linux Certification, Third Edition Chapter 11 Compression, System Backup, and Software Installation.
Julie McEnery1 Installing the ScienceTools The release manager automatically compiles each release of the Science Tools, it creates a set of wrapper scripts.
Installing Linux softwares Sirak Kaewjamnong. 2 Software packets  When Linux developers create their software they typically bundle all the executable.
Chapter 11 Compression, System Backup, and Software Installation.
Downloading & Installing Software Chapter 13. Maintaining the System Yum Pirut BitTiorrent Rpm Keeping Software Up To Date Up2date Red Hat Network Wget.
Module 10 – Linux Installations. Wikipedia: Red Hat Package Manager or RPM Package Manager (RPM) is a package management system. The name RPM variously.
Managing Software using RPM. ♦ Overview In Linux, Red Hat Package Manager referred as RPM is a tool used for managing software packages and its main function.
UNIX ™ /Linux Overview Unix/IP Preparation Course June 9, 2013 Lusaka, Zambia.
Linux Operations and Administration
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 9: Implementing and Using Group Policy.
Linux+ Guide to Linux Certification
Dustin Harman VM Workshop 2015 RPM Basics. What is RPM? Red Hat Package Manager Native package manager on RHEL, Fedora, SUSE, some Mandriva RPM/SRPM files.
A+ Guide to Managing and Maintaining Your PC Fifth Edition Chapter 15 Installing and Using Windows XP Professional.
70-294: MCSE Guide to Microsoft Windows Server 2003 Active Directory Chapter 12: Deploying and Managing Software with Group Policy.
Tutorial 11 Installing, Updating, and Configuring Software
SUSE Linux Enterprise Server Administration (Course 3037) Chapter 4 Manage Software for SUSE Linux Enterprise Server.
LPIC-1 TRAINING COURSE Topic 102: Linux Installation and package management.
Course ILT Windows installation and upgrades Unit objectives Install a Windows operating system Upgrade from one version of Windows to another.
October, Scientific Linux INFN/Trieste B.Gobbo – Compass R.Gomezel - T.Macorini - L.Strizzolo INFN - Trieste.
Linux Package Management Dr. Michael L. Collard 1.
Linux Introduction Part 2. Finding Files find “start directory” -name "filename“ Find the file called "filename" on the filesystem starting the search.
CIT 470: Advanced Network and System AdministrationSlide #1 CIT 470: Advanced Network and System Administration Package Management.
CERN Manual Installation of a UI – Oxford July - 1 LCG2 Administrator’s Course Oxford University, 19 th – 21 st July Developed.
APT for RPM Simplified package management for rpm based distributions INFN - Napoli 1 INFM - UDR Napoli 2 HEPiX/HEPNT 2003 – Vancouver Rosario Esposito.
Install Software. UNIX Shell The UNIX/LINUX shell is a program important part of a Unix system. interface between the user & UNIX kernel starts running.
Linux+ Guide to Linux Certification Chapter Thirteen Compression, System Back-Up, and Software Installation.
A Practical Guide to Fedora and Red Hat Enterprise Linux Unit 8: Installing Software in Linux Chapter 13: Downloading and Installing Software By Fred R.
Managing Software Patches 10/15/ Introducing Solaris OE Patches A patch contains collection of files and directories Patch replaces existing files.
Linux Services Muhammad Amer. 2 xinetd Programs  In computer networking, xinetd, the eXtended InterNET Daemon, is an open-source super-server daemon.
CIT 500: IT Fundamentals Packages and Filesystems 1.
SUSE Linux Enterprise Desktop Administration Chapter 6 Manage Software.
Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.
Installation of packages Objectives –Using software packaging tools Contents –Application delivered as –Where to get commonly used rpm’s –Autofs on! –Getting.
CHAPTER 2. Overview 1. Pre-Installation Tasks 2. Installing and Configuring Linux 3. X Server 4. Post Installation Configuration and Tasks.
What is a port The Ports Collection is essentially a set of Makefiles, patches, and description files placed in /usr/ports. The port includes instructions.
CHAPTER 8 Managing Software and System Resources.
Deploying Software with Group Policy Chapter Twelve.
Installation of packages Objectives –Using software packaging tools Contents –Application delivered as –Where to get commonly used rpm’s –Autofs on! –Getting.
© 2006 ITT Educational Services Inc. Linux Operating System :: Unit 3 :: Slide 1 Downloading and Installing Software yum pirut Bit Torrent rmp.
CSCI 330 UNIX and Network Programming Unit XX: Linux Administration.
Yannick Patois - Datagrid Software Repository Presentation - March, n° 1 Datagrid Software Repository Presentation CVS, packages and automatic.
Tanner Lovelace – Slide 1 RPM Packaging 101 Tanner Lovelace Triangle Linux Users Group 11/Jan/2003.
Linux Operations and Administration
Software in the Data Protector Architecture
RedHat Package Management RPM and YUM in RedHat Enterprise, Fedora, Suse and Centos.
System Administration Application Management. ● A common task for a system administrator is the installation, updating and removal of software. Several.
Perl in RPM-Land Dave Cross Magnum Solutions Ltd YAPC::Europe 15 th August 2008.
RPM101: A gentle intro to creating your own packages Richard Keech Red Hat Asia-Pacific.
RPM.
Installation of MySQL Objectives Contents Practical Summary
CIT 470: Advanced Network and System Administration
Linux Command RTFM: rpm(8) & yum(8)
Connect:Direct for UNIX v4.2.x Silent Installation
COP 4343 Unix System Administration
Chapter 9 Router Configuration (Ospf, Rip) Webmin, usermin Team viewer
CompTIA Server+ Certification (Exam SK0-004)
Chapter 7 Installing Program &Backup Tool
Managing Software.
Lecture 13 RPM and its advantages.
More Scripting & Chapter 11
RedHat Package Management
University of Texas Rio Grande Valley Systems Administration CSCI 6175
Tanner Lovelace Triangle Linux Users Group 11/Jan/2003
IS3440 Linux Security Unit 8 Software Management
OPS235 PACKAGE MANAGEMENT
FreeBSD ports & packages
Perl in RPM-Land Dave Cross Magnum Solutions Ltd YAPC::Europe
Presentation transcript:

Package Management How to use rpms

Topics The Problem of Software Installation Package Management Systems Using RPM Finding RPMs Building RPMs

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 (K menu, icons, etc.)

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? 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?

Package Manager Features Build management. Dependency tracking. Querying. Reversibility. Verification. Version control.

UNIX Package Management Systems deb: Debian system uses dpkg and APT. pkg-add: Solaris packaging system. portage: Gentoo uses with emerge. ports: BSD ports system. RPM: Redhat packaging system. up2date: RHEL interface to RPM urpmi: Mandriva interface to RPM yast: SuSE interface to RPM yum: Fedora interface to RPM. tgz: Tarballs used by Slackware.

RPM Package Names - -..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.

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.

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

Installing a Package 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 -ivh foo i386.rpm Preparing... ########################################### [100%] 1:foo ########################################### [100%]

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%]

Uninstalling a Package Completely removes package from system. $ rpm -e foo $ rpm –q foo package foo is not installed.

Dependencies Prevent install/removal if unfulfilled. # rpm -e setup error: Failed dependencies: setup is needed by (installed) basesystem 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

Dependency Resolution Higher level tools handle dependencies up2date, yum Automatic resolution + downloading. 1. Find dependencies in RPM headers. 2. Download dependencies, check their headers. 3. Repeat. 4. Install after all RPMs downloaded. D/L Sites: /etc/sysconfig/rhn/sources

RPM Options Specify multiple RPMs at once. RPM will order them to resolve dependencies. Prefix: install in new location. rpm --prefix /usr/local –Uvh *.rpm Oldpackage: revert to an older version rpm --oldpackage –Uvh foo i386.rpm Forcing install, upgrade, or removal --force allows overwriting of files/packages. --nodeps allows install w/o dependency check.

Just Testing Testing ( --test ) discovers common errors: Package already installed. Package needs dependencies. Root ( --root /tmp ) changes fs root. Performs installs in chroot() environment. Allows you to test software installs without impacting your running RPM database/pkgs.

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 : 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 : 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.

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 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

Querying Files and Packages Finding owners # 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.

Verififying Packages Verifying a package returns nothing if ok # rpm -V telnet Returns errors if package has problems # 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 Fedora Core Linux CD-ROMs 2. A Red Hat FTP Mirror Site available at Dag RPM Repository at / / 4. Search for RPMs at 5. 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 Install the source RPM. rpm –ivh foo src.rpm Move to the build directory. 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.

Building Source RPMs Use rpmbuild to build the RPMs. rpmbuild –ba SPECS/foo.spec Copy or install RPMs. ls -l RPMS ls -l SRPMS

The SPEC File Introduction Descriptions that rpm –qi shows you. One desc/pkg, as one SRPM may build multiple binary RPMs. Prep Extracting the source code and patching it. Build Configures package and runs make. Install Copies files to right locations, sets owner+perms. Clean Removes files created by build that are no longer needed. Files Lists files to go into each RPM.

Why build Source RPMs? No binary RPM exists for your version of Linux. Features RPM exists, but feature you want disabled. Optimization Modify SPEC file to optimize for your arch.

References 1. Debian FAQ, “Debian Package Management Tools,” 2. Eric Foster-Johnson, RPM Guide, Aeleen Frisch, Essential System Administration, 3 rd edition, O’Reilly, Evi Nemeth et al, UNIX System Administration Handbook, 3 rd edition, Prentice Hall, RedHat, Red Hat Enterprise Linux 4 System Administration Guide, EL-4-Manual/sysadmin-guide/, EL-4-Manual/sysadmin-guide/