≡ Menu

rpm

Q. How do I find out my SCSI hard disk RPM speed from a Linux shell prompt without opening my server case? How do I find out hard disk model and serial number from a shell prompt?
[click to continue…]

I would like to only download the packages via yum and not install/update them. How do I download a RPM package using yum command under CentOS Enterprise Linux server 5.x or RHEL 5.x systems?
[click to continue…]

Q. What is my root password for MySQL under CentOS Linux 5.0 server?
[click to continue…]

How do I find out what package provides a file called /bin/ls? I use the rpm -qf /bin/ls command under Red Hat Enterprise Linux to find out package name. Can you tell me equivalent command for the same under Debian or Ubuntu Linux?
[click to continue…]

Q. How can I know what packages are available for binary update under Fedora / RHEL / CentOS Linux version 5 server? How do I list all outdated packages? How do I apply update / patches to system?
[click to continue…]

Q. How do I know what packages are available to be updated on my Debian / Ubuntu Linux system?

A. You can use standard command line utility called apt-get or GUI tool called Synaptic Update-Manager.

List all packages which could be updated

To list outdated package use apt-get command has following two options:
=> -u : Show upgraded packages; Print out a list of all packages that are to be upgraded.
=> upgrade : It is used to install the newest versions of all packages currently installed on the system

Type the following command at shell prompt:
$ sudo apt-get upgrade
$ sudo apt-get -i upgrade

Output:

Reading package lists... Done
Building dependency tree... Done
The following packages will be upgraded:
  debconf debconf-i18n e2fslibs e2fsprogs file findutils klibc-utils libblkid1 libc6 libc6-i686 libcomerr2 libklibc libkrb53 libmagic1
  libpam-modules libpam-runtime libpam0g libss2 libssl0.9.8 libuuid1 linux-image-2.6-686 linux-image-2.6.18-5-686 locales perl perl-base
  perl-modules tar tzdata
28 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 39.6MB of archives.
After unpacking 148kB of additional disk space will be used.
Do you want to continue [Y/n]?

To updated just say yes to prompt - "Do you want to continue". Alternatively, you can type the following command:
$ sudo apt-get update
$ sudo apt-get upgrade

Synaptic GUI Package Update Notifier

Synaptic works hand-in-hand with Update-Manager to inform you about updates to the software installed on your system. If software or security updates are available, Update-Manager will display a pop-up message and an icon in the notification area on your GNOME desktop. To update your system, click on the notification icon, enter your password and click OK.
How to keep your Ubuntu / Debian system up-to-date
(Fig. 01: Synaptic GUI Package Update Notifier [ Image credit Ubuntu Project] )

Linux: Display rpm package architecture

Q. I’m using CentOS on 64 bit Linux. How do I find out rpm package architecture before installation such as i386 or x86_64 bit?

A. Almost each rpm package has i386 or x86_64 added to file extension. However some time you may see filename such as file-version.rpm. You can list all installed rpm packages with rpm -qa command but it will not display architecture. You can run following command to display rpm package architecture:
rpm -qa --qf "%{n}-%{arch}\n"
Ouput:

filesystem-x86_64
comps-extras-noarch
gnome-mime-data-x86_64
glibc-x86_64
atk-x86_64
libICE-x86_64
db4-x86_64
elfutils-libelf-x86_64
ncurses-x86_64
libsepol-x86_64
libcap-x86_64
sqlite-x86_64
pcre-x86_64
gdbm-x86_64
libsepol-i386
libXdmcp-x86_64
db4-i386
iptables-x86_64
libXrender-x86_64
libXi-x86_64
xorg-x11-font-utils-x86_64
slang-x86_64
libXpm-x86_64
startup-notification-x86_64
gzip-x86_64
libIDL-x86_64
libXau-i386
wireless-tools-x86_64
libvorbis-x86_64

Another option is to use following command to display detailed information about package:
rpm -qi {package-name}
If you wish to display package version along with architecture, enter:
rpm -qa --qf "%{n}-%{v}-%{r}.%{arch}\n" | less
Run rpm command to print a list of all of the tags it knows about when it is invoked with the --querytags argument.
rpm --querytags | less