RPM Interview Questions


Q: How to install packages with all the dependency packages if all the packages are available at a common repository?
Ans : rpm –ivh  –aid packagename.

Q: How to check, where a particular package installed it’s configuration files.
Ans : rpm –qc packagename.

Q: How to check the change log of the installed package.
Ans : rpm -q –changelog packagename.

Q: How to check, where a particular package installed it’s doc files.
Ans : rpm -qd packagenme

Q: How to check all the files installed by package?
Ans : rpm -q –filesbypkg packagename

Q: How to check the version of files installed by a package
Ans : rpm -qi packagename

Q: How to check the dependencies for a particular packages i.e. Required libraries packages etc.
Ans : rpm -q -R packagename.

Q: How to upgrade the packages which are already installed on to the linux box.
Ans : rpm -F install options packagename.

Q: What is the command to update only the rpm database.
Ans : rpm -i –justdb packagename

Q: What is the command to check whether a particular package installation would be successful but would not actually install the package.
Ans : rpm -ivh –test packagename

Q: How to check that a particular file belong to which package
Ans : rpm -qf filename

Q: How to list files in  a package
Ans : rpm -ql packagename

Q: How to verify whether the files installed by package are intact or been tampered/corrupted.
Ans : rpm -qs packagename

Q: What is the command to create a new RPM Database
Ans : rpm –initdb

Q: What is the command to rebuild the RPM Database
Ans : rpm –rebuilddb

Advertisements

PitHole: RPM : “warning, user XXX does not exist – using root”


If while installing rpm package following error occurs
warning: user XXX does not exist – using root

Issue : I’m trying to build/install an rpm and it keeps giving me these warnings while installing the binary. Though I heard this could be safely ignored as its bcos there is no user XXX on my box, was wondering if there is a way to supress this in the rpm spec file itself. I know I could also manually build it as root. But curious if we could supress this from the spec.

Resolution:

Add the following in the spec file and recompile the spec file

%defattr(-,root,root)

Slackware: Enabling package update through online mirrors


Unfortunately Slackware 12.0 does not unable update of OS by default, slackpkg needs to be installed from the install CD/DVD which is located in “extra\slackpkg” folder.

installpkg slackpkg*.tgz

uncomment only one mirror on /etc/slackpkg/mirrors file which represent your version.

slackpkg update; slackpkg upgrade-all

the above command will upgrade your machine.

Adding Public keys for apt-get


When one adds a new repository in sources.list file then there is a high possibility that we face the following error when `apt-get update` command is executed

————————- Error —————–

W: GPG error: http://edevelop.org unstable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7E5D69A103CA4243
W: GPG error: http://ftp.debian-unofficial.org sarge Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D5642BC86823D007
W: There are no public key available for the following key IDs:
B5D0C804ADB11277
W: You may want to run apt-get update to correct these problems
————————————————-

To resolve this issue i have created a script which when provided the KeyID will download the key and add it to your key ring.

---------------------------------- Script ------------------------

gpg --keyserver subkeys.pgp.net --recv-keys $1
gpg --armor --export $1 | sudo apt-key add -
——————————————————————