Auto yes to the License Agreement on sudo apt-get -y install oracle-java7-installer
问题 The Oracle Java package for Ubuntu interactively asks about the License Agreement. So I have to say 'OK' and then 'yes' every time, but I'd like to automate it. What I do is this: sudo add-apt-repository -y ppa:webupd8team/java sudo apt-get update sudo apt-get -y install oracle-java7-installer Is there a simple way to automate the agreement process without using expect? 回答1: try this out: sudo add-apt-repository -y ppa:webupd8team/java sudo apt-get update echo debconf shared/accepted-oracle