Skip to main content
added 85 characters in body
Source Link
ron
  • 9.2k
  • 19
  • 82
  • 151

on an rpm based system like Redhat or Centos or Rocky,

easy way... somewhat...

  • use rpm -qa to list all installed rpms,
  • then for each rpm of what is currently installed do a rpm -ql on each
    • for example rpm -ql chrony will report /etc/chrony.conf among some ~40 other files making up that rpm
    • capture all the *.conf files from doing an rpm -ql on each rpm reported from rpm -qa and save into a single text file named {for example} valid_confs.txt.
  • run a find on your local directories that you would consider a place for any installed/removed software for which could possibly contain a .conf file
    • for any .conf files resulting from running find, do a simple cat <found .conf file> valid_confs.txt and if it is not found then you found an orphaned .conf file... more specifically a .conf file that does not directly match to installed software as rpm has it recorded for where it should be locatedlocated; if the paths mismatch but it's of an installed rpm then that will be useful as well.

on an rpm based system like Redhat or Centos or Rocky,

easy way... somewhat...

  • use rpm -qa to list all installed rpms,
  • then for each rpm of what is currently installed do a rpm -ql on each
    • for example rpm -ql chrony will report /etc/chrony.conf among some ~40 other files making up that rpm
    • capture all the *.conf files from doing an rpm -ql on each rpm reported from rpm -qa and save into a single text file named {for example} valid_confs.txt.
  • run a find on your local directories that you would consider a place for any installed/removed software for which could possibly contain a .conf file
    • for any .conf files resulting from running find, do a simple cat <found .conf file> valid_confs.txt and if it is not found then you found an orphaned .conf file... more specifically a .conf file that does not directly match to installed software as rpm has it recorded for where it should be located.

on an rpm based system like Redhat or Centos or Rocky,

easy way... somewhat...

  • use rpm -qa to list all installed rpms,
  • then for each rpm of what is currently installed do a rpm -ql on each
    • for example rpm -ql chrony will report /etc/chrony.conf among some ~40 other files making up that rpm
    • capture all the *.conf files from doing an rpm -ql on each rpm reported from rpm -qa and save into a single text file named {for example} valid_confs.txt.
  • run a find on your local directories that you would consider a place for any installed/removed software for which could possibly contain a .conf file
    • for any .conf files resulting from running find, do a simple cat <found .conf file> valid_confs.txt and if it is not found then you found an orphaned .conf file... more specifically a .conf file that does not directly match to installed software as rpm has it recorded for where it should be located; if the paths mismatch but it's of an installed rpm then that will be useful as well.
Source Link
ron
  • 9.2k
  • 19
  • 82
  • 151

on an rpm based system like Redhat or Centos or Rocky,

easy way... somewhat...

  • use rpm -qa to list all installed rpms,
  • then for each rpm of what is currently installed do a rpm -ql on each
    • for example rpm -ql chrony will report /etc/chrony.conf among some ~40 other files making up that rpm
    • capture all the *.conf files from doing an rpm -ql on each rpm reported from rpm -qa and save into a single text file named {for example} valid_confs.txt.
  • run a find on your local directories that you would consider a place for any installed/removed software for which could possibly contain a .conf file
    • for any .conf files resulting from running find, do a simple cat <found .conf file> valid_confs.txt and if it is not found then you found an orphaned .conf file... more specifically a .conf file that does not directly match to installed software as rpm has it recorded for where it should be located.