There were 2 things that I did to solve this issue.
First, thanks to @KGIII I removed Applications menu entries using App Editor. I found out that the "duplicats" were actually Nautilus file manager, and not the Pantheon Files.
Then I just removed Nautilus from my system using apt purge nautilus
.
Now, I do not have any "duplicates" in both the Applications menu and the "Open with" menu.
The only thing that I would like to learn is how Nautilus was installed on my system. I did not install it explicitly by myself, I think it had to come in as a dependency of some other package. However, am I able to know for sure how it got installed?
defaults.list
for duplicates. It's in /usr/share/pantheon/applications. Before editing that file, back it up.defaults.list
file. I found 2 entries with "Files" in it:inode/directory=io.elementary.files.desktop
andx-scheme-handler/trash=io.elementary.files.desktop
. I'm not sure what they even mean, so I didn't touch those. I am not sure if this is the cause since I see 4 copies of Files entry in my menu, not 2.