150 likes | 404 Views
RedHat Package Management. RPM and YUM in RedHat Enterprise, Fedora, Suse and Centos. RPM. rpm command installs "packages" from *.rpm files at any source location. Basic commands: rpm –i somefile.rpm (install) rpm –e somefile (remove) rpm –U somefile (upgrade, remove old)
E N D
RedHat Package Management RPM and YUM in RedHat Enterprise, Fedora, Suse and Centos
RPM • rpm command installs "packages" from *.rpm files at any source location. • Basic commands: rpm –i somefile.rpm (install) rpm –e somefile (remove) rpm –U somefile (upgrade, remove old) rpm –F somefile (update, keep old) rpm -qa | grep "somefile" (query installed packages) rpm -qa --last (query installed packages in installed sequence) rpm -qf /path/to/filet (Find out what package a file belongs) rpm -qc --last (Find out what package a config file belongs) rpm -qcf /path/to/file (Display list of configuration files for a command) • rpmbuild is used to build rpms from source directories, used for kernel compilation. • RPMs are digitally signed with a GPG key by the vendor to ensure trustworthiness.
Examples • rpm –ivh (install), rpm –uvh (upgrade) • rpm –e (erase) • rpm –qa | grep <package name> • rpm –q, rpm –qi <package name> • rpm –qf (associated package files) • rpm –qdf (associated package) documentation) • rpm –qlp (all files in a package) • rpm –qRp (list packag dependencies • rpm –Vp <package name>, rpm –Va (verify package) • rpm –Vf <filename> (verify file ownership)
YUM • yum is a frontend to the rpm command. It has the advantage of seeking the most recent updates on the Internet (if desired) and resolving most dependencies automatically. • yum is setup to work off of Internet "repositories" on the Internet. Files containing these locations are listed in /etc/yum.repos.d/*.repo • You can add your own *.repo file directories in the same format and import gpg keys using the rpm –import command to insure integrity of the site. Internet is usually required for how to configure the latest repositories. Remember just as in Windows, make sure you can trust the .rpm source site.
YUM • Basic commands: yum search somefile (look for the package) yum info somefile (get info on the package) yum list somefile (get installed and available versions) yum list installed (same as rpm -qa) yum list available (what's available in repository) yum grouplist "some search string" (look for like packages to search string) yum install somefile (install the package and any dependencies) yum localinstall /path/to/somefile (yum install off local media) yum remove somefile (uninstall the package) yum upgrade somefile (upgrade the package removing prior versions) yum update somefile (update the package keeping prior version) yum provides somefile (what packages are associated with a file) yum repolist all (list defined repositories) yum clean all (clean yum download directories)
GUI • Check System/Administration/Software Sources, Software Update
Yum and rpm files • See /etc/rpm directory • See /etc/yum directory • See /etc/yum.conf • See /var/cache/yum
Examples • yum install <packagename> • yum remove <packagename> • yum update <packagename> • yum search <packagename> • yum info <packagename> • yum list <packagename>. yum list installed • yum provides <filename> (list package owner) • yum –enablerepo=<old repo> • yum shell (interactive shell)