Dear Centos community, I am new to centos/redhat and I would like to know on a centos system, can I use yum alone to do all package management? I don't want to learn two systems and confuse myself, I understand yum is much better than rpm if is the case?
Thank you!
Jim
On Sat, 13 Feb 2010, Jim Green wrote:
yum is simply a layer built on top of rpm. it's nice if you can do everything you want with yum, but it doesn't hurt to learn the basics of rpm anyway.
rday --
======================================================================== Robert P. J. Day Waterloo, Ontario, CANADA
Linux Consulting, Training and Kernel Pedantry.
Web page: http://crashcourse.ca Twitter: http://twitter.com/rpjday ========================================================================
On Sat, 2010-02-13 at 10:00 -0600, Jim Green wrote:
I expect that you will get a bunch of replies on this.
The short form is that yum lives on TOP of RPM. It is not a replacement for RPM.
Yum does most of the thinking for you as far as dependency management. It is much more user-friendly, and is the preferred mechanism for software installation and maintenance because it does the dependency resolution for you, and saves much in the way of headaches, elevated stress, confusion, and RSI from excessive keyboard use.
All that being said, there are times when you do want to use RPM by itself, without Yum. If you stay with CentOS and/or RedHat long enough, you will run across this situation now and then.
On 13 February 2010 10:13, Ron Loftin reloftin@twcny.rr.com wrote:
Thank Robert and Ron, Could you list an example where I need to use rpm command alone? I used rpm to install stand alone package if that is the case.
Jim
On Sat, 13 Feb 2010, Jim Green wrote:
i suspect there are yum alternatives for some of these but here's some stuff i like:
$ rpm -qa # list all installed packages $ rpm -qR <pkgname> # list dependencies of package $ rpm -ql <pkgname> # display list of files in package $ rpm -qf <filename> # what package is <filename> from?
and many others.
rday --
======================================================================== Robert P. J. Day Waterloo, Ontario, CANADA
Linux Consulting, Training and Kernel Pedantry.
Web page: http://crashcourse.ca Twitter: http://twitter.com/rpjday ========================================================================
On 13 February 2010 10:27, Robert P. J. Day rpjday@crashcourse.ca wrote:
yum list installed
$ rpm -qR <pkgname> # list dependencies of package
yum deplist <pkgname>
$ rpm -ql <pkgname> # display list of files in package
$ rpm -qf <filename> # what package is <filename> from?
yum provides <filename>
this kind of exercise is fun. I came from debian and it is fun to make matches:)
Jim Green wrote:
I use rpm for basic stuff because it runs faster. For example:
$ time yum list installed ... real 0m17.069s user 0m0.857s sys 0m0.675s
$ time rpm -qa ... real 0m4.714s user 0m4.457s sys 0m0.120s
Yum tends to take a while to read in its databases before it processes your command. So for simple commands, it is faster to use rpm. On slow boxes, it can be significantly faster.
On Mon, 15 Feb 2010, Bowie Bailey wrote:
naw -- The 'speed' issue here comes down to a scripting language v a compiled one -- librpm underneath on each in CentOS 5. Here is a more apple to apples comparison on those timings on the work being done
[herrold@centos-5 clang]$ time rpm -qa --nosignature \ --nodigest > /dev/null
real 0m0.329s user 0m0.208s sys 0m0.076s [herrold@centos-5 clang]$ time yum list installed > /dev/null
real 0m4.252s user 0m1.948s sys 0m0.132s [herrold@centos-5 clang]$
-- Russ herrold
If you need information on a specific package then you'll likely need to use rpm directly. For the most part, anytime I need to install a package I use yum. This includes installing a standalone package. I use rpm mainly during troubleshooting. For example, to list package contents, scripts, or extract portions of a package.
On 13 February 2010 10:35, Kwan Lowe kwan.lowe@gmail.com wrote:
Thank Kwan, I get a much better feel of when to use rpm/yum now.
This one illustrates the kind of information you rather get with the rpm command (here the installed size):
# List RPMS ordered by size (biggest last) rpm -q -a --qf '%10{SIZE}\t%{NAME}\n' | sort -k1,1n
Useful when you need to make room in an /usr partition for example
At Sat, 13 Feb 2010 10:00:14 -0600 CentOS mailing list centos@centos.org wrote:
yum is layered on top of RPM. That is, yum uses rpm itself to actually manage packages. yum adds several additional features/functions:
1) It deals with dependencies (rpm only complains about dependencies, but makes no attempt on its own to resolve dependencies).
2) It deals with updates from one (or more) repositories. A repository is a collection of RPMs, from which updates and/or dependencies can be resolved as well as a source of packages to install.