> Am 16.12.2018 um 00:07 schrieb Gordon Messmer <gordon.messmer at gmail.com>: > > On 12/15/18 1:05 PM, Frank Cox wrote: >> Ultimately it would be very useful to have some kind of a tool that would generate a report from the rpms installed on a system and tell you exactly what depends on what else. Among other things you could use that report to remove stuff that's not needed in any installation. > > > While not a simple answer, this bash function will provide what you're looking for: > > whatrequires () { (rpm -q --qf '%{NAME}\n' "$1" ; rpm -q --provides "$1" ) | tr \\n \\0 | xargs -0 rpm -q --whatrequires ; } >or this one :-) rpm -ev --test PACKAGENAME will list all packages that require PACKAGENAME -- LF
On 12/17/18 3:50 AM, Leon Fauster via CentOS wrote:> > or this one :-) > rpm -ev --test PACKAGENAME > will list all packages that require PACKAGENAMETrue.? I considered that, and then decided that I could never recommend using "rpm -e" as a test, even with the --test flag, due to the risk of operator error.? Though if you put it in an alias, I suppose that the risk is minimal and the answer is simpler.? :)
> On 12/17/18 3:50 AM, Leon Fauster via CentOS wrote: >> >> or this one :-) >> rpm -ev --test PACKAGENAME >> will list all packages that require PACKAGENAME > > > True.? I considered that, and then decided that I could never recommend > using "rpm -e" as a test, even with the --test flag, due to the risk of > operator error.? Though if you put it in an alias, I suppose that the > risk is minimal and the answer is simpler.? :)It's not really dangerous even without --test, because if it has dependencies the remove is not done, you just get an error. Regards, Simon