LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   [SOLVED]List explicitly installed packages / Equivalent of Gentoo world file? (https://www.linuxquestions.org/questions/fedora-35/%5Bsolved%5Dlist-explicitly-installed-packages-equivalent-of-gentoo-world-file-4175430366/)

epsilon72 10-03-2012 06:07 PM

[SOLVED]List explicitly installed packages / Equivalent of Gentoo world file?
 
Hi, I'm a Gentoo user looking to learn more about Fedora.

Question: Can Fedora show you a list of packages that have been explicitly installed on the system? Such a list would not include packages that have been installed as dependencies of other packages.

In Gentoo, you can do this simply by taking a look at your /var/lib/portage/world file. (In a .deb based distro you can use aptitude search '~i !~M')

Here's a small snippet of mine, as an example. All of these have been explicitly installed by me:
Code:

sys-kernel/gentoo-sources
sys-power/cpufrequtils
sys-process/htop
sys-process/lsof
sys-process/vixie-cron
www-client/chromium
www-client/epiphany-extensions
www-client/firefox
www-client/links
www-client/opera
www-plugins/adobe-flash
x11-apps/mesa-progs
x11-apps/xclock
x11-base/xorg-x11
x11-drivers/nvidia-drivers
x11-misc/numlockx
x11-terms/xterm

So, can Fedora do the same thing with yum or rpm?

GlennsPref 10-03-2012 07:36 PM

Hi, Fedora uses thr RedHat Package manager, and has a database.

I'm not sure if

rpm -Va | grep (keyword) will be satisfactory to list new installs.

rpm has 9 attributes it uses to catagorise packages...
Quote:

Finally, every file installed by RPM is examined. No less than nine different attributes of each file can be checked. Here is the list of attributes:
Owner Group Mode MD5 Checksum Size Major Number Minor Number Symbolic Link String Modification Time
ref. http://www.rpm.org/max-rpm/ch-rpm-verify.html

http://www.rpm.org/max-rpm/s1-rpm-qu...y-queries.html, Finding Recently Installed Packages, Part 1 & 2, near bottom of page...

http://www.rpm.org/max-rpm/s1-rpm-ve...to-verify.html

With Mandriva I learned about msec, which uses sec-tool (available for Fedora) to verify and report on any changes to the filesystem and more. Have a look, I generally make between 60 and 80 changes when first configuring the program. Then I get reports on scans that run differently depending on Daily, weekly, monthly and Manual tests.
https://fedorahosted.org/sectool/wiki/WhySectool

Hope this helps.

edit,
you may set this up early, list the packages and sort a to z and redirect (print) to file
Code:

rpm -qa | sort | less > ~/fresh-rpm-installed-list-`date +%Y-%m-%d-%H`.txt
to compare with any new lists you generate in the future with diff (kdiff3).

Easy, huh?

GlennsPref 10-03-2012 08:42 PM

Here is yet another way to list packages...
Code:

rpm -qav --last
# query, all, verbose, list by date
dosen't answer this question,
Quote:

list of packages that have been explicitly installed on the system?
, but getting closer.

hth, Glenn

epsilon72 10-06-2012 01:07 AM

The folks at the fedora support forums were able to get this sorted out. There's three things you can use:

First and foremost, this perl script is awesome
Code:

#!/usr/bin/perl

my %out;
foreach (split(/\n/, `yumdb search command_line "*install*"`)) {
    if (/command_line =.*install (.*)/) {
        $out{$_} = 1 foreach split(/ /, $1);
    }
}
foreach (sort keys %out) {
    print "$_\n" if !/^-/;
}

You can also use the command
Code:

$ show-installed
Which is part of the yum-utils package (installed by default)

You can also use this command with slightly different output (shows the command line used but multiple packages per line)
Code:

yumdb search  command_line "*install*" | grep command_line | sort | uniq


All times are GMT -5. The time now is 04:30 AM.