------------------------------------------------------------------------------- YUM / RPM General What is installed locally yum list installed rpm -qa --queryformat '%{NAME}-%{VERSION}-%{RELEASE}:%{SUMMARY}\n' | sort | awk -F: '{printf "%-30s %s\n",$1,$2}' What is on a specific repo yum --disablerepo=\* --enablerepo=adobe\* list available Local Install (yum also gets dependancies) yum localinstall /path/to/package-1.0.0-1.i386.rpm Dependancies (requires and is required by) rpm -q --requires xyzzy rpm -q --whatrequires xyzzy What package will install file or library "xyzzy" (if needed by another package). Install the rpmdb-redhat package then use rpm -q --whatprovides xyzzy rpm -q --redhatprovides xyzzy ------------------------------------------------------------------------------- General RPM List package and info rpm -qilp {package}.rpm What dependancys (requirements) does it need rpm -qRp {package}.rpm Install with progress bar rpm -ihv {package}.rpm Follow dependancys (in same directory, using "rpmdb" database) rpm -hiv --aid {package}.rpm Reset file permissions of installed Package rpm --setperms {package} Reset ownership rpm --setugids {package} Reset permissions on all install packages for p in $(rpm -qa); do rpm --setperms $p; done for p in $(rpm -qa); do rpm --setugids $p; done Checksum installed files test string: S:size M:mode(perms/type) 5:md5sum T:time file type: c:config d:doc r:readme rpm -Vf /etc/profile ------------------------------------------------------------------------------- General YUM Clean up Cache sudo yum clean all sudo yum makecache Install package sudo yum install xine Local copy sudo yum localinstall ImageMagick-6.2.5-5.i386.rpm Remove it and any dependancys nolonger in use sudo yum remove rhythmbox Install package_group sudo yum groupinstall 'MySQL Database' Update All sudo yum update Update just package sudo yum update xine List available packages yum list xine yum list '*mp3*' yum grouplist List description for a package yum info junit search for string in package name and description yum search mp3 look for a package providing a library yum provides libneon Turn on auto updates... chkconfig yum on service yum start NOTE: this does not actually run a service, it just enables the "/etc/cron.daily/yum.conf" cron job to auto-update the system at 4am ------------------------------------------------------------------------------- Downgrade Packages yum downgrade firefox dependancy hell rpm -Uvh --oldpackage packagename When updating skip packages and associated packages yum --exclude=firefox --skip-broken update ------------------------------------------------------------------------------- RPM from SRPM sources Build a RPM directly from a source RPM rpmbuild --rebuild {package}.src.rpm Then install rpm -ihv ~/rpmbuild/RPMS/i386/{package}.i386.rpm NOTE: yum can NOT download SRPM packages at this time. Build step by step package=??? # get sources rpm -ihv $package-*.src.rpm yum-builddep $package # %files -- check all prerequesite files are avaiable rpmbuild -bl ~/rpmbuild/SPECS/$package.spec # %prep -- extract / apply all patches -- in /usr/src/redhat/BUILD rpmbuild -bp ~/rpmbuild/SPECS/$package.spec # %build -- compile the binaries patched (above and manually) sources rpmbuild --short-circuit -bc ~/rpmbuild/SPECS/$package.spec # %install -- install the just built binaries rpmbuild --short-circuit -bi ~/rpmbuild/SPECS/$package.spec # Unpack and build the appropriate RPM's from installed package rpmbuild -bb ~/rpmbuild/SPECS/$package.spec # Rebuild SRPM source package (after changes to patching or sources tar) rpmbuild -bs ~/rpmbuild/SPECS/$package.spec Clean out the whole source area rm -rf ~/rpmbuild Build a RPM that will install into a different prefix??? -- untested rpmbuild --define="_prefix /opt/MyApps/ImageMagick" spec_file To prevent RPM from stripping debug infomation either Add to "spec" file %define __os_install_post %{nil} or in the install section export this variable export DONT_STRIP=1 or disable the script that calls it On fedora systems that is /usr/lib/rpm/find-debuginfo.sh ------------------------------------------------------------------------------- Unpackage RPM without installing... mkdir t cd t rpm2cpio .../RPM.rpm | cpio -idmv ------------------------------------------------------------------------------- RPM from TAR source Found on GQview web site, how this workes is another matter. When complete, the new binary package can be found in /usr/src/redhat/RPMS/i386 rpm -tb xxx-x.x.x.tar.gz ------------------------------------------------------------------------------- Create 'os' yum repository from DVD echo ' | [fedora-dvd] | name=Fedora DVD (for $releasever) | baseurl=file:///media/Fedora%20$releasever%20i386%20DVD/ | enabled=0 ' | sed -n '/^ *|/!d; s/^ *|//; s/^ //; p' > FILE yum --disablerepo=\* --enablerepo=fedora-dvd list available Install original kernel from DVD yum --disablerepo=\* --enablerepo=fedora-dvd install \ kernel kernel-PAE kernel-headers kernel-devel kernel-PAE-devel -------------------------------------------------------------------------------