Posts tagged ·

rpm

·...

How to find all the rpm packages installed on a particular date

Comments Off

To find all the RPM packages which were installed on a particular date:

# rpm -qa –queryformat “%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH}) INSTALLED: %{INSTALLTIME:date}\n” | grep my_date

Example:

rpm -qa –queryformat “%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH}) INSTALLED: %{INSTALLTIME:date}\n” | grep “29 Sep 2006″

To find the install date and time of an RPM package:

# rpm -qa –queryformat “%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH}) INSTALLED: %{INSTALLTIME:date}\n” | grep rpm_package_name

If you want the epoch time rather than human readable date:

# rpm -qa –queryformat “%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH}) INSTALLED: %{INSTALLTIME}\n” | grep rpm_package_name

Example:

rpm -qa –queryformat “%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH}) INSTALLED: %{INSTALLTIME:date}\n” | grep libaio

Comments Off

Some AIX Open Source websites/repositories

Comments Off

http://www.perzl.org/aix/

pWare — AIX Open Source Software for IBM AIX 5.3 and 6.1

Samba for AIX

Recent Web Browsers for AIX

Bull Open Source Software Archive for AIX

Bull’s updated version of the AIX Toolbox for Linux Applications

Darren Tucker’s OpenSSH Page

Comments Off

RPM Cheat Sheet

Comments Off
 Technote (FAQ)
 
Problem
RPM Cheat Sheet
 
Solution


CONTENTS:
    INTRODUCTION
    SCOPE
    RPM INFORMATION QUERY
    INSTALL A NEW PACKAGE
    UPGRADE A CURRENT PACKAGE
    CHECKING A DIFFERENT RPM DATABASE
    RESET THE PERMISSIONS AND OWNER OF A SINGLE PACKAGE
    RESET THE PERMISSIONS AND OWNER OF A SINGLE FILE
    RESET ALL THE PACKAGES IN THE RPMS DATABASE'S PERMISSIONS AND OWNERSHIP
    ADDITIONAL INFORMATION


INTRODUCTION
------------
RPM is a acronym for the Red Hat Package Manager. rpm is a powerful
package manager which can be used to build, install, query, verify,
update and uninstall individual linux software packages. Most linux
distributions use the rpm package manager except Debian which has its
own package manager (dpkg, dselect or apt-get).

This TechNote is a cheat sheet for common RPM commands users or system
administrators may need without wading through the online man page or
documentation.  Readers are asked to edit this TechNote and add any handy rpm
commands they use.


SCOPE
-----
This TechNote covers RPM v3.0 and v4.0.


RPM INFORMATION QUERY
---------------------
package  =  name of installed RPM package, such as SysVinit-scripts-1.05-6
rpmfile  =  name of file containing an RPM package, such as sysv.1.05.i386.rpm
filename =  full path to a file on the current system, such as /etc/inittab

List rpm's currently installed
    # rpm -qa
List files belonging to a particular rpm
    # rpm -ql kernel
    # rpm -qlp kernel-2.2.12-20.i386.rpm
list the rpm the file belongs to
    # rpm -qf /etc/inittab
Display detailed information on the package
    # rpm -qi initscripts
List documentation file
    # rpm -qd initscripts
List configuration file
    # rpm -qc initscripts
Display pre and post installation scripts
    # rpm -q -scripts initscripts
List dependencies
    # rpm -qR initscripts
Show changes since last version
    # rpm -q --changelog


INSTALL A NEW PACKAGE
---------------------
To install a new package simply use the "rpm -i" command with the name
of the package file. If the new install package depends upon another
package, the install fails like this :

    # rpm -iv netscape-communicator-4.72-3.i386.rpm
    error: failed dependencies:
        netscape-common = 4.72 is needed by
        netscape-communicator-4.72-3

To correct the problem, the dependency must be first installed.


UPGRADE A CURRENT PACKAGE
-------------------------
To upgrade a current, existing package, use the "rpm -U" command with
the name of the package file.  Examples of 'clean' and 'error' upgrades:

query current version of the package
     # rpm -qa |grep -i lprng-
     LPRng-3.7.4-28
update this package
     # rpm -U LPRng-3.8.12-1.i386.rpm
verify the update
     # rpm -qa |grep -i lprng-
     LPRng-3.8.12-1
upgrade another package
     # rpm -u LPRngTool-1.3.2-1.i386.rpm
     error: failed dependencies:
             ifh-->= 3.4 is needed by LPRngTool-1.3.2-1
upgrade the dependency package first
     # rpm -u ifhp-3.5.8-1.i386.rpm
     # rpm -u LPRngTool-1.3.2-1.i386.rpm
final package verification
     # rpm -qa |egrep -i "lprng|ifhp"
     LPRng-3.8.12-1
     LPRngTool-1.3.2-1
     ifhp-3.5.8-1


CHECKING A DIFFERENT RPM DATABASE
---------------------------------
If you need to mount a different root filesystem underneath the one you're
currently running and check the RPMs in that, use the chroot() option.

For example, if the system's current root directory is on /dev/hda1 but we
have another operating system root (say a different distribution) on /dev/hdb1
we can do this to search that distribution's RPMs:

   # mount /dev/hdb1 /mnt
   # rpm --root /mnt -qa


RESET THE PERMISSIONS AND OWNER OF A SINGLE PACKAGE
---------------------------------------------------
If you need to check permissions and group and user id's and change them
back to the install permissions and id's you can do the following.

For this example we will use the "slang" package.
For demonstration purposes  lets see what files it contains.
    # rpm -ql slang-1.4.4-4
    /usr/lib/libslang.so.1
    /usr/lib/libslang.so.1.4.4

And the permissions on the file are:
    # ls -l /usr/lib/libslang.so.1.4.4
    -rw-r--r-- 1 root root 429040 Jun 26  2001 /usr/lib/libslang.so.1.4.4

When we compare it against the RPM database it comes back clean.
    # rpm -Vq slang
    #

Let us change the permissions and owner of the file.
    # chmod 007 /usr/lib/libslang.so.1.4.4
    # chown uucp.users /usr/lib/libslang.so.1.4.4
    # ls -l /usr/lib/libslang.so.1.4.4
    -------rwx 1 uucp users 429040 Jun 26  2001 /usr/lib/libslang.so.1.4.4

Then verify that they are incorrect up by checking it against the RPM database
    # rpm -Vq slang
    .M...UG.   /usr/lib/libslang.so.1.4.4

From "man rpm" we see that the mode and ownership do not jive with the RPM
database.

M Mode differs (includes permissions and file type)
U User ownership differs
G Group ownership differs
See "man rpm" for other descriptions.

We can now reset them with the "--setperms" and "--setugids" RPM switches.
    # rpm --setperms slang
    # rpm --setugids slang

When we compare it against the RPM database it comes back clean.
    # rpm -Vq slang
    #
And the permissions on the file are what they were original
    # ls -l /usr/lib/libslang.so.1.4.4
    -rw-r--r-- 1 root root 429040 Jun 26  2001 /usr/lib/libslang.so.1.4.4


RESET THE PERMISSIONS AND OWNER OF A SINGLE FILE
------------------------------------------------
If you need to reset the  permissions and group and user id's of a single
file you can use use the "--setperms" and "--setugids" with the "-f" RPM
switches.

Below is an example.
    # ls -l /usr/lib/libslang.so.1.4.4
    -rw-r--r-- 1 root root 429040 Jun 26  2001 /usr/lib/libslang.so.1.4.4
    # chown uucp.users /usr/lib/libslang.so.1.4.4
    # chmod 777 /usr/lib/libslang.so.1.4.4
    # ls -l /usr/lib/libslang.so.1.4.4
    -rwxrwxrwx 1 uucp users 429040 Jun 26  2001 /usr/lib/libslang.so.1.4.4
    # rpm --setugids -f /usr/lib/libslang.so.1.4.4
    # rpm --setperms -f /usr/lib/libslang.so.1.4.4
    # ls -l /usr/lib/libslang.so.1.4.4
    -rw-r--r-- 1 root root 429040 Jun 26  2001 /usr/lib/libslang.so.1.4.4


RESET ALL THE PACKAGES IN THE RPMS DATABASE'S PERMISSIONS AND OWNERSHIP
-----------------------------------------------------------------------
You can rest the permission and ownership of all the packages in your RPM
database by doing the following:

    # rpm -Vq `rpm -qa`
    # rpm --setperms `rpm -qa`
    # rpm --setugids `rpm -qa

Each step in this process could take a long time to complete, so be patient.


ADDITIONAL INFORMATION
----------------------
See the "man 8 rpm" for more detailed information.

See the RPM-HOWTO on your system or at the Linux Documentation Project:

    http://www.linuxdoc.org/HOWTO/RPM-HOWTO/index.html 
 
 
Historical Number
linux/5
 
 
Comments Off