1

Given a set of apt commands and packages to apply (e.g. install foo bar baz, autoremove quux blerg bang), is there a way to calculate the diff of the system state that will be produced if I run the commands?

By "system state" I don't merely mean whether a given package will install/remove other packages, but what kinds of actual changes get produced -- files being deleted or moved, scripts getting run, et cetera.

2 Answers 2

1

You can run apt-get in simulate mode, e.g.:

with

sudo apt-get --simulate install foo bar baz

or without sudo also

apt-get --simulate install foo bar baz

This won't change anything on your system but will print out what will apt-get do when you run that command.

2
  • That will tell me what other packages will be installed, but I'm interested at a more granular level: what files get changed, added, removed, et cetera. Jan 9, 2014 at 14:38
  • @JohnFeminella I don't think that there is a software for that, at least I never heard about such.
    – falconer
    Jan 9, 2014 at 14:51
1

You are probably looking for more debugging. The problem with this is... that the information is way too much to be useful for anyone without knowledge of what he's reading. But here it is:

sudo apt-get -o Debug::pkgDPkgProgressReporting=true -o Debug::pkgPackageManager=true -o Debug::pkgDPkgPM=true install package

But hey, there's a bunch of other ways you can do this. For example:

apt-get --print-uris install package
## This will print a lot of url. Download them.
wget uris
dpkg-deb -c *.deb

This will show you the contents. You will need to evaluate the control scripts (post/pre inst/rm) separated.

6
  • That was very helpful, thanks! This is still at the package-level though, rather than at the file level. Jan 9, 2014 at 15:09
  • @JohnFeminella if you want, you could use dpkg --no-act some-1.0.deb, but again, it would be more information that is really helpful
    – Braiam
    Jan 9, 2014 at 15:30
  • See also debian-administration.org/articles/491
    – Panther
    Jan 9, 2014 at 18:05
  • @bodhi.zazen not sure how that is relevant.
    – Braiam
    Jan 9, 2014 at 18:08
  • Guess it depends on what the OP wants exactly. The above link gives info from the changelogs and where to go for additional info. Frankly, I am not sure how running diff on binaries/libs helps either. Perhaps the OP would like gentoo ;p
    – Panther
    Jan 9, 2014 at 18:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .