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

Re: Who installed package "foo"?



On 02/11/2020 12:31, Victor Sudakov wrote:
David Wright wrote:
On Mon 02 Nov 2020 at 09:52:53 (+0700), Victor Sudakov wrote:
Dan Ritter wrote:

When I want to figure out what package has installed package "foo" as a
dependency, is there a less barbaric method than

apt-get -s remove foo

In addition to the other answers I see, you probably have a
record of when it happened in /var/log/history.log

You probably mean /var/log/apt/history.log.*

Unfortunately the information about "foo" seems to have already been rotated away.

$ grep -e '^Package:' -e 'Depends: .*\<foo\>' /var/lib/dpkg/status | grep -B1 -e 'Depends:' | less

Oh, parsing a text file is to my liking, thank you for the hint.

apt-cache has already been mentioned, but I think with a few more options it will output what you want without having to pipe multiple commands:

apt-cache rdepends --installed --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances <package>

Add --no-recommends to the options if you prefer.

--
John


Reply to: