Apt-get: how to know what version will be installed?

NoOp glgxg at sbcglobal.net
Sun Nov 2 03:55:13 UTC 2008


On 10/31/2008 04:44 PM, Derek Broughton wrote:
> NoOp wrote:
> 
>> On 10/31/2008 08:56 AM, Avi Greenbury wrote:
>>> Dotan Cohen wrote:
>>>> Before installing an application with apt-get, I would like to check
>>>> which version will be installed. How does one do that?
>>>> 
>>>> Thanks in advance.
>>>> 
>>> 
>>> The top few lines of
>>> apt-cache showpkg <package name>
>>> give version information.
>>> 
>> 
>> That works well & provides required dependencies etc. However if you
>> just want a short, simple output I just use the '-s' option to simulate
>> an install. For example:
> 
> "apt-cache policy" says what you're going to get and where you're going to
> get it from.
> 
> "apt-cache madison" (believe it or not, I once understood why it was called
> that) does the same more concisely.

Actually neither do it as well as 'apt-get install -s <package>' IMO:

$ apt-cache policy atomix
atomix:
  Installed: (none)
  Candidate: 2.14.0-1
  Version table:
     2.14.0-1 0
        500 http://ftp.usf.edu hardy/main Packages
$ apt-cache madison atomix
    atomix |   2.14.0-1 | http://ftp.usf.edu hardy/main Packages
    atomix |   2.14.0-1 | http://ftp.usf.edu hardy/main Sources

Whereas:

$ sudo apt-get install -s atomix
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  atomix-data
The following NEW packages will be installed:
  atomix atomix-data
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Inst atomix-data (2.14.0-1 Ubuntu:8.04/hardy)
Inst atomix (2.14.0-1 Ubuntu:8.04/hardy)
Conf atomix-data (2.14.0-1 Ubuntu:8.04/hardy)
Conf atomix (2.14.0-1 Ubuntu:8.04/hardy)

also shows that both atomix *and* atomix-data will be installed for this
particular package. It also shows the version (Ubuntu:8.04/hardy).






More information about the ubuntu-users mailing list