85

Basically, I want to run add-apt-repository ppa:(whatever) without the "press Enter to continue" prompt. How would I do this?

Essentially, I want to deploy adding a repository in a shell script without user input.

2
  • 13
    Just add -y at the end of the command add-apt-repository -y .... Jun 5, 2013 at 0:25
  • 1
    man add-apt-repository and you will see the -y switch that @UriHerrera said.
    – NickTux
    Jun 5, 2013 at 1:33

1 Answer 1

121

The script goes like this

#! /bin/sh
sudo add-apt-repository ppa:(Your ppa here) -y

BTW you will still have to enter password.

3
  • what error are you getting? Feb 21, 2014 at 10:05
  • 1
    aditya, you man Its Working :D , just now checked... Feb 21, 2014 at 10:07
  • 2
    You should run the script as root, so you don't need sudo and thus no password
    – rubo77
    Nov 26, 2019 at 21:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .