H265 videos won't play in totem after installing all codecs

Packages do not affect what is in cache. Thus it is up to the user to remind themselves to occasionally clean up their own cache and other things that remain under or in the users home directory.

I thought about something like post-install command, that would clean the cache after installing certain plugins. Not sure it is the correct way to do things in such systems.