[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Is the output of 'apt-get install --simulate' stable?



I have a use case where I would like to programatically get the set of
dependencies that would be installed if a given package were
installed, without actually installing any of them and preferably
without downloading them. I can do that by parsing the output of
'apt-get install --simulate', e.g.

    $ apt-get install ruby --simulate | grep ^Inst | sed -E 's/Inst
([^ ]*) \(([^ ]*).*/\1 \2/' | sort
    fonts-lato 2.0-2
    javascript-common 11
    libjs-jquery 3.2.1-1
    libruby2.5 2.5.1-1ubuntu1
    rake 12.3.1-1
    ruby 1:2.5.1
    ruby2.5 2.5.1-1ubuntu1
    ruby-did-you-mean 1.2.0-2
    ...

While not the cleanest thing ever, this approach will work fine, as
long as the output of apt-get is stable. However, the output of
'apt-get install --simulate' appears like it is more designed to be
human-readable than easily parsable.

Is the output of  'apt-get install --simulate' stable? If not, is
there another way to accomplish this?

Thanks,
John


Reply to: