You can also use apt-get instead. apt-get remove --purge sun-java5-jdk apt-get install sun-java5-jdk [although the newer one is 6, if you need the class Console] You won't have to confirm anything, apt will do it for you.