Problem
When running apt-get install
in an non-interactive SSH session, the session never closes. Example:
ssh user@target "sudo apt-get -y install my_package"
The my_package
does get installed properly, but the SSH session just dangles open.
Question
Is there any flag to pass SSH to get apt-get
to work?
Additional Information
Context
Remote installation is used for automated deployment of a package on an integration server. As soon as we push some code changes to a repository, a job pulls in the code, builds the package, and deploys it on integration to check that everything works well (as far as deployment is concerned).
Already Tried & Notes
- The same SSH session executing
apt-get update
closes cleanly. Note thatapt-get update
is not interactive, whereasapt-get install
is. This may suggest that interactivity is an issue. - A command like
ssh user@target "sudo apt-get install my_package && echo Hello"
never reaches theecho
. debconf
complains that it cannot find a nice frontend (Display, Readline), and it falls back to Teletype (although Readline is available).- In relation to debconf's frontend, passing
-t
to force TTY with SSH does not help. NeitherDEBIAN_FRONTEND=noninteractive
. - All was done on Ubuntu 12_04 LTS.