2

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...

XoR
  • 187
  • 1
  • 6

2 Answers2

3

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  
quanta
  • 51,413
  • 19
  • 159
  • 217
  • 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... https://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 02:34
0

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).

Alex
  • 6,603
  • 1
  • 24
  • 32