RPM
List all installed packages:
1
$ rpm -qaGet the list of all installed packages and their architecture:
1
$ rpm -qa --queryformat "%-40{NAME} %-8{ARCH}\n"Same as above, but show i586 packages only:
1
$ rpm -qa --queryformat "%-40{NAME} %-8{ARCH}\n" | grep i586Downgrade a package to an old version:
1
$ wget ftp://ftp.repository.org/mandrakelinux/official/10.0/package-1.0-1mdk.i586.rpm2$ rpm -Uvh --oldpackage package-1.0-1mdk.i586.rpmUnpack/Deflate/Extract a RPM without installing it:
1
$ rpm2cpio dummy.src.rpm | cpio -idEvaluate %mkrel 3 rpm macro:
1
$ rpm --eval '%mkrel 3'Force removal of a package that has problems with embedded βpre-β and/or βpost-β scripts:
1
$ rpm -e --noscripts packagename
Urpmi
List all available packages with name containing python:
1
$ urpmq --fuzzy pythonFind which RPM contain the file named dummy:
1
$ urpmf dummyGet information about the dummy RPM:
1
$ urpmq -i dummyGet the list of all RPMs that require python-psyco package:
1
$ urpmf --requires python-psycoGet the list of all RPMs that provide python-psyco package:
1
$ urpmf --provides python-psycoI use this command in a cron entry to update automatically and regularly my Mandriva:
1
$ /usr/sbin/urpmi.update -a && /usr/sbin/urpmi --update --auto --auto-selectGenerate urpmi repository index and metadata of the current folder:
1
$ genhdlist ./
Yum
Install a new package:
1
$ yum install subversionSearch for packages containing the x11 string:
1
$ yum search x11Get the list of packages that provide Pythonβs Subversion bindings:
1
$ yum provides "*/svn/__init__.py"Update repository index:
1
$ yum updateClear all caches (sometimes required to force a repository index update):
1
$ yum clean allGenerate Yum repository index and metadata of the current folder:
1
$ createrepo -v ./