Ubuntu – On Ubuntu, is there a way to find out what files are NOT associated with installed apt packages


I know in RedHat, you can use find / –exec rpm -qf {} \; |grep "is not" to find files that are not associated with packages. One reason I need this is to find files that are installed from source so I know what packages I need to build from source and make everything go through the package manager. I'm coming into managing a system that someone else was loose with on the package management side of things and I need to ensure that the security is good so no stray rootkits, etc are installed.

Best Answer

The same method, different command:

$ dpkg -S /etc/profile
dpkg-query: no path found matching pattern /etc/profile
$ dpkg -S /etc/ssh/ssh_config 
openssh-client: /etc/ssh/ssh_config