uninstall before install

Fix #2647