How can I uninstall Directx 9?
To the best of my knowledge you can’t. Once installed, it becomes part of the operating system. If you need to uninstall then a Google search for “DirectX Uninstall” returns several hits, but I can’t speak for their quality. Ultimately, the approach I would try would be be to re-install the operating system and then not install DirectX 9.
Become a Patron of Ask Leo! and go ad-free!
Update: Check out this article: “A Cabinet file cannot be trusted” – Why? for pointers to several resources concerning that apparently common DirectX-related issue.