Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
74
rated 0 times [  74] [ 0]  / answers: 1 / hits: 72142  / 3 Years ago, wed, september 22, 2021, 5:03:29

I am executing the following command over ssh in a testing environment, as root:



ssh <remote_srv> "apt-get autoremove"


In my sshd_config I have "PermitRootLogin without-password" and I have added the id_rsa.pub of root to the authorized_keys file on the remote server.



Nevertheless I get following errors:



debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype


I have looked this up in de man pages of ssh, but couldn't wrap my mind around the explanation on pseudo-terms and ttys.



Is there anybody who can explain above errors? I guess it's a missing option, but which?



Both platforms are Ubuntu 14.04 LTS.


More From » ssh

 Answers
3

I believe it has something to do with the fact that apt-get autoremove is being run in a non-interactive shell. See Is it possibe to answer dialog questions when installing under docker?



The solution appears to be to prefix the command with DEBIAN_FRONTEND=noninteractive:



ssh <remote_srv> "DEBIAN_FRONTEND=noninteractive apt-get autoremove"

[#23850] Wednesday, September 22, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sharall

Total Points: 407
Total Questions: 127
Total Answers: 121

Location: Saint Helena
Member since Fri, Mar 26, 2021
3 Years ago
;