Define a list of non-OS packages installed on a RedHat Linux computer

I am tasked with identifying new (non-operational) software installed on multiple Red Hat Enterprise Linux (RHEL) computers. Can anyone suggest an effective way to do this? The way I did this manually compares the list of installed software with the list on the Red Hat FTP server for the corresponding operating system:

ftp://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/SRPMS/

The problems I encounter with this method is tedious / timeconsuming, and only the source packages are listed (for example, I cannot tell if avahi-glib is installed as part of the avahi package). If someone could suggest a more efficient way to identify software that does not ship with the operating system on the RHEL machine, it would be very helpful!

Here's what I came up with as a more efficient method (although I still haven't figured out the last part, and there may be more efficient methods). If someone can help me with the last step of this method or can share the best method, we will be very grateful!

New method (work in progress):

  • Copy the package list from the Red Hat FTP site to a text file (OSPackages.txt).

  • To fix the problem of listing only RPM versions, also copy the list of files from the corresponding corresponding version in http://vault.centos.org to a text file and combine this data with OSPackages.txt.

  • Do rpm -qa> list1, yum -y list installed> list2, ls / usr / bin> list3, ls / usr / share> list4, ls / usr / lib> list5.

  • Use cat to merge all listX files together in InstalledPackages.txt.

  • Use sorting to sort unique entries, for example: sort -u -k 1 InstalledPackages.txt> SortedInstalledPackages.txt

  • SortedInstalledPackages.txt OSPackages.txt, (-I regexp), ( ). " ", . OSPackages.txt, .

. , , , : diff Linux?

diff ( ) , , . , , . 6?

+1
4

rpm -qa --last | less

rpms .

+5

yum , . ​​ , , , , .

, rpm, , /sbin/lib .. - , "" , .

+1

:

yum repolist | tail -n +3 | grep -v 'repolist:' | cut -f1 -d' '

, Red Hat. . , Fedora, :

yum list installed  --disablerepo="*" --enablerepo="fedora*"

, .

for p in $PACKAGES; do rpmls $p; done

:

yum list installed   --disablerepo="*" --enablerepo="fedora*" \
 | cut -f1 -d' ' \
 | ( while read p; do rpmls $p; done ) \
 | cut -c13-

, , .

rpm:

rpm -qal

.

+1

redhat /var/log/installer/initial -status.gz Ubuntu, tmp , grep -v tmpfile.

, , Linux, Ubuntu:

https://gist.github.com/sysadmiral/d58388e315a6c6384053aa6b0af66c5f

Ubuntu Debian, aptitude. Redhat/CentOS, , .

. , .. script, .

Personal disclaimer : please forgive the use of the tee. I was still learning the ropes when I wrote this, and never updated the code for the sake of nostalgia.

+1
source

Source: https://habr.com/ru/post/1606458/


All Articles