First, you should not do this as an ordinary user. Set up an rpm environment in your home directory instead. It is easy, only two steps.
First step. Create a file ~/.rpmmacros that contains
%packager Lars E. Pettersson <user@domain.invalid> %_topdir %(echo $HOME)/redhat
Second step. Create the directories to be used
mkdir -p ~/redhat/{BUILD,RPMS/{i386,i586,i686,x86_64,i686,noarch},SOURCES,SPECS,SRPMS}
You can now rebuild packages with the command rpmbuild
--rebuild --clean package-1-1.src.rpm The built binary
package, or packages, may be found in the directories below the
~/rpm/RPMS/ directory.
In case of trouble with rpm or yum, try to remove the rpm database
lock files, /var/lib/rpm/__db.00*, and rebuild the
database.
rm /var/lib/rpm/__db.00* rpm --rebuilddb
rpm is a package management command used by a number of different Linux distributions. The following tips and tricks should work at any of these.
rpm -qa --qf "%{INSTALLTIME} %{INSTALLTIME:date} %{NAME} %{VERSION} %{RELEASE}\n" | sort -r
rpm2cpio sendmail.src.rpm | cpio -t
To extract a file, do (if a path is listed by cpio
-t then you must include that path with the filename,
do not forget the begining dot)
rpm2cpio sendmail.src.rpm | cpio -ivd FILE_FROM_LIST
rpm -q RPM_FILE --changelog
rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} --> %{summary}\n'
/usr/lib/rpm/rpmdb_stat -ch /var/lib/rpm
yum is a utility that can check for, and automatically download, and install, updated rpm packages. More information about yum can be found at http://linux.duke.edu/projects/yum/
yum list extras
sudo yum shell > config gpgcheck 0 > localinstall download/bla_bla_1.1-1.i386.rpm > run > quit