Skip to content

Commit

Permalink
Linux: ensure non-interactive install
Browse files Browse the repository at this point in the history
apt needs -y and it also needs DEBIAN_FRONTEND=noninteractive
to avoid questions, from a root shell.

Closes #117.
  • Loading branch information
gaborcsardi committed Sep 9, 2022
1 parent 8e4a189 commit 481337f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ fn add_deb(path: &OsStr) -> Result<(), Box<dyn Error>> {
let mut args: Vec<OsString> = vec![];
args.push(os("install"));
args.push(os("--reinstall"));
args.push(os("-y"));
// https://askubuntu.com/a/668859
args.push(os("-o=Dpkg::Use-Pty=0"));
args.push(path.to_os_string());
Expand Down
1 change: 1 addition & 0 deletions src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub fn run(cmd: OsString, args: Vec<OsString>, _what: &str)

debug!("Running {:?} with args {:?}", cmd, args);
let reader = duct::cmd(cmd, args)
.env("DEBIAN_FRONTEND", "noninteractive")
.stderr_to_stdout()
.reader()?;
let lines = BufReader::new(reader).lines();
Expand Down

0 comments on commit 481337f

Please sign in to comment.