Writing a Java Class to Manage RPM Package Content
Installing a Linux system for the first time is quite straightforward. You can find good and cheap Linux packages on the market that will quickly install themselves. You need only choose some configuration options describing the type of hardware on which you want to install, and that's it.
As time goes on, you will add some new components to your Linux system, and that's where the nightmare may begin. A Linux system is composed of hundreds of components and dynamic libraries. In order to keep your system up and running, you should be careful, since installing a new version of a component may introduce incompatibilities in your system, making it more unstable as time goes on.
Replacing an existing component with a new version at first looks like a trivial task: you just need to pick up a new compiled version of the component, generally available on the Net in a .tgz file (tar + gzip compression), and install it on your system. Some dynamic libraries of the component you just upgraded may already be used by other installed components and might not be compatible with the new version you just installed.
It would be great to have a tool which could report the dependencies of each component installed on your system. Such a tool could tell you the version of Samba (for instance) installed on your system or that you can't install egcs-1.0.2-8 on your system prior to having binutils 2.9 up and running. This tool already exists on Linux—it is called RPM—and is on many existing Linux distributions, including Red Hat, Caldera, SuSE and Linux Mandrake.
RPM stands for Red Hat Package Manager and is described by its creator as “an open packaging system available for anyone to use and works on Red Hat Linux as well as other Linux and UNIX systems” (from the Red Hat installation guide).
Before starting the programming discussion, I will introduce the RPM package manager and give a general overview of it. If you need more information, see Resources for more than 400 pages of interesting details on RPM's history, design, usage and programming.
The diagram in Figure 1 represents the different components involved in the RPM tool. RPM is composed of three main parts:
a database
candidate packages
RPM utilities, which modify the database and packages
The RPM database, located in /var/lib/rpm on Red Hat distributions, is owned by root; it is a mirror of all the packages which are presently installed on your system. The RPM utility accepts various commands which query the database for installed packages, install or update the system with new RPM packages, remove unused packages from the system, and verify and check installed package dependencies. Usually, when a new version of a given component becomes available on the Net, you have two choices:
Look for a tar gzip file containing the sources. Compile the sources on your system, then proceed with installation of the binaries. The given package generally provides a README, a make and make install procedure to help you.
Look for a tar, gzip file containing the binaries, meaning that someone else has already compiled the sources for you on the same kind of computer as yours. Then proceed with installation of the binaries.
Let's say you are interested in installing version 1.9.18 of Samba. First, you should look on the Net for an RPM of the Samba package (instead of a tar, gzip package). Once you have it, type:
rpm -uvh samba-1.9.18p8-50.1.i386.rpm
This command will install (or upgrade) a copy of Samba on your system. It will also check that all dependencies needed by this version of Samba are present on your system. If the rpm command completes with no error messages, you're guaranteed the installed package will be ready to run without trouble at the end of the installation process.
This installation process will also update the RPM database which keeps track of all installed packages on your system and all their dependencies.
So if, six months later, you want to find out which version of Samba is installed on your system, typing the following command:
rpm -q samba
will tell you
samba-1.9.18p8-50.1If you want to remove a package from your system, the RPM utilities will remove the files which were installed on your system during installation.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- New Products
- Linux Systems Administrator
- Senior Perl Developer
- Technical Support Rep
- Web & UI Developer (JavaScript & j Query)
- UX Designer
- Designing Electronics with Linux
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)





2 hours 27 min ago
8 hours 13 min ago
8 hours 31 min ago
10 hours 24 min ago
12 hours 17 min ago
19 hours 11 min ago
19 hours 27 min ago
21 hours 19 min ago
1 day 3 hours ago
1 day 7 hours ago