Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there some simple yum command so I can know what is current and what is future version of package for updating.

I now about:

yum list updates

But that only prints new version of packages...

share|improve this question

2 Answers 2

up vote 3 down vote accepted

To list all installed packages, you can use:

# yum list installed

For specific package, try this:

# yum info httpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.vietoss.com
 * epel: ftp.cuhk.edu.hk
 * extras: mirror.vietoss.com
 * rpmforge: ftp-stud.fht-esslingen.de
 * updates: mirror.vietoss.com
Installed Packages
Name       : httpd
Arch       : x86_64
Version    : 2.2.3
Release    : 43.el5.centos
Size       : 3.3 M
Repo       : installed
Summary    : Apache HTTP Server
URL        : http://httpd.apache.org/
License    : Apache Software License
Description: The Apache HTTP Server is a powerful, efficient, and extensible
           : web server.

Available Packages
Name       : httpd
Arch       : x86_64
Version    : 2.2.3
Release    : 53.el5.centos.3
Size       : 1.2 M
Repo       : updates
Summary    : Apache HTTP Server
URL        : http://httpd.apache.org/
License    : Apache Software License
Description: The Apache HTTP Server is a powerful, efficient, and extensible
           : web server.

# yum list httpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.vietoss.com
 * epel: ftp.cuhk.edu.hk
 * extras: mirror.vietoss.com
 * rpmforge: ftp-stud.fht-esslingen.de
 * updates: mirror.vietoss.com
Installed Packages
httpd.x86_64                                         2.2.3-43.el5.centos                                            installed
Available Packages
httpd.x86_64                                         2.2.3-53.el5.centos.3                                          updates  
share|improve this answer
    
Well it's part of sollution, I wanted something like listing of versions of packages before and after update, I even done some script, it doesn't work yet... gist.github.com/1378729 –  XoR Nov 19 '11 at 11:10
    
Do you mean you have updated and you want to know the previous installed version? –  quanta Nov 19 '11 at 15:54
    
No I want to have some handy command that will list versions of local package and what new version that will be installed on update. This just partially solves problem, because it's not handy one line listing per package... –  XoR Nov 20 '11 at 19:02
    
Did you try yum info, yum list? –  quanta Nov 21 '11 at 2:34

If you wanted to script this more, it may be easier to get out of rpm directly. You can get a list of packages you have installed and their version by doing: rpm -qa --queryformat "%{NAME} %{VERSION}\n".

You can run rpm --querytags to find out all the stuff you can put in the %{VARIABLES}. The format takes arguments like a printf would (things like the \n for newline or \t for tab for example).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.