2. Forcefully install a package# rpm -ivh gcc-4.3-62.198.x86_64.rpm
Preparing... ########################################### [100%]
package gcc-4.3-62.198.x86_64 is already installed
As you see since gcc rpm is already installed the installation does not completes so for such situations use should use --force switch as seen below# rpm -ivh gcc-4.3-62.198.x86_64.rpm --force
Preparing... ########################################### [100%]
1:gcc ########################################### [100%]

4. Un-install a package
To uninstall an rpm you need the exact name of the rpm which has to be installed. For eg if you have to uninstall gcc43-c++ then in case you run the below command to remove this

# rpm -e gcc43-c
error: package gcc43-c is not installed
As you see you should provide complete name # rpm -e gcc-c++
# echo $?
0

5. Install/Un-install a package without dependencies
Make sure you are fully aware before you use this option since there is a probability that the package won't function properly if the dependencies are not installed. Although you can skip the same using --nodeps# rpm -ivh kiwi-instsource-5.05.25-616.1.x86_64.rpm
warning: kiwi-instsource-5.05.25-616.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID d3668a00
error: Failed dependencies:
build is needed by kiwi-instsource-5.05.25-616.1.x86_64# rpm -ivh kiwi-instsource-5.05.25-616.1.x86_64.rpm --nodeps
warning: kiwi-instsource-5.05.25-616.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID d3668a00
Preparing... ########################################### [100%]
1:kiwi-instsource ########################################### [100%]
To remove a package you can use the same option

To check this make sure you have access to the rpm of which the content has to be checked# rpm -qlp squashfs-4.0-2.1.x86_64.rpm
warning: squashfs-4.0-2.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 29b4acdd
/usr/bin/mksquashfs
/usr/bin/unsquashfs
/usr/share/doc/packages/squashfs
/usr/share/doc/packages/squashfs/CHANGES
/usr/share/doc/packages/squashfs/PERFORMANCE.README
/usr/share/doc/packages/squashfs/README
/usr/share/doc/packages/squashfs/README-4.0

There might be a case when you know a file like /usr/bin/sudo but you are not sure which rpm is responsible for installing this file. Use -qf along with rpm command for such cases.

NOTE: The below command is only useful if the file you are querying for is present in your machine

# rpm -qf /usr/bin/sudo
sudo-1.7.6p2-0.17.5

10. Display a List of the Package's Documentation
When -d is added to a query, we get a list of all files containing documentation for the named package or packages. This is a great way to get up to speed when you're having problems with unfamiliar software. As with -c and -l, you'll see either a simple list of filenames, or (if you've added -v) a more comprehensive list.# rpm -qd gawk
/usr/share/doc/packages/gawk/AUTHORS
/usr/share/doc/packages/gawk/COPYING
/usr/share/doc/packages/gawk/FUTURES
/usr/share/doc/packages/gawk/LIMITATIONS
/usr/share/doc/packages/gawk/NEWS
/usr/share/doc/packages/gawk/POSIX.STD
/usr/share/doc/packages/gawk/PROBLEMS
/usr/share/doc/packages/gawk/README
/usr/share/info/gawk.info.gz
/usr/share/info/gawkinet.info.gz
/usr/share/man/man1/awk.1.gz
/usr/share/man/man1/gawk.1.gz
/usr/share/man/man1/igawk.1.gz
/usr/share/man/man1/pgawk.1.gz

11. Display the Package's List of Configuration Files

When -c is added to an rpm -q command, RPM will display the configuration files that are part of the specified package or packages. # rpm -qc netcfg
/etc/HOSTNAME
/etc/aliases
/etc/defaultdomain
/etc/ethers
/etc/exports
/etc/ftpusers
/etc/host.conf
/etc/hosts
/etc/hosts.allow
/etc/hosts.deny
/etc/hosts.equiv

12. Query the Packages That Provide Capability
RPM provides extensive support for dependencies between packages. The basic mechanism used is that a package may require what another package provides.# rpm -q --whatprovides gcc
gcc-4.3-62.198

14. Display Capabilities Provided by the Package
By adding "--provides" to a query command, we can see the capabilities provided by one or more packages. If the package doesn't provide any capabilities, the --provides option produces no output:

# rpm -q gcc --provides
c_compiler
gcc = 4.3-62.198

15. Query All Installed Packages

Using the -a option, you can query every package installed on your system. For example:

Get Articles delivered to your mail

CONNECT US ON SOCIAL PLATFORM

YOU MIGHT ALSO LIKE

RECENT POSTS

Your browser does not support JavaScript!

About Me

My name is Deepak Prasad and I am very passionate about my work which mostly includes and revolves around Linux/Unix platform, virtualisation, openstack cloud, hardware, firmware, security, network, scripting, automation and similar stuff.

If I look back it looks like it was just yesterday when I started as a fresher in my first company as a total noob (which still I am BTW) and now I am here trying to run a tutorial site, I am not sure how good this is but at least I feel I learn something new every time I open my blog to write a new post. This honestly was sort of a notebook for me later turned into a tutorial blog.