dpkg-preconfigure hangs when a password is passed to sudo from the stdin
Please, have a look at http://
I'm trying to build a script that will automatize my post-installation procedures after a fresh Ubuntu installation.
The majority of the commands within that script need root priviledges to be run, hence the need to uso sudo.
Given that I want it to be as automatic as possible, I needed a way to pass my password to sudo only once, when I run the script.
To do that, I could only came up with something that seems like a hack:
'sudo' accepts '-S' as a flag indicating it should read the password from the stdin.
Within the script, the I use 'echo $1 | sudo -S command', which takes the first parameter when I run my script and passes it to sudo
It essentially works as I need, but the script hangs when trying to install the Sun Java JDK.
It shows a dialog where I should accept the Sun license, but the terminal becomes useless, and nothing works. I usually get a grey screen if I try to run the script again after that.
If you make a custom a script, with the following contents: http://
Now... I actually want to know if that is a bug that I should file and/or whether there's a better approach to do what I am trying to do.
Thanks in advance.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu debconf Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- TJ
- Solved:
- Last query:
- Last reply: