In this tutorial you will learn how to repair Vagrant generated message “default: dpkg-preconfigure: unable to re-open stdin: No such file or directory”.
Code used during this tutorial:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# Vagrant Repair "default dpkg-preconfigure unable to re-open stdin No such file or directory" message # ==> default: dpkg-preconfigure: unable to re-open stdin: No such file or directory cd ~/vagrant/ubuntu-trusty32/ vi Vagrantfile vi provision-shell/bootstrap.sh vagrant up --provider virtualbox vagrant provision vi provision-shell/bootstrap.sh vagrant provision # Optional vagrant destroy -f vagrant up --provider virtualbox # Useful links https://gist.github.com/rrosiek/8190550 http://stackoverflow.com/questions/10508843/what-is-dev-null-21 http://serverfault.com/questions/500764/dpkg-reconfigure-unable-to-re-open-stdin-no-file-or-directory |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
#!/bin/bash # Repair "==> default: stdin: is not a tty" message sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile # In order to avoid the message # "==> default: dpkg-preconfigure: unable to re-open stdin: No such file or directory" # use " > /dev/null 2>&1" in order to redirect stdout to /dev/null # For more info see http://stackoverflow.com/questions/10508843/what-is-dev-null-21 echo 'Provisioning virtual machine...' # Git echo 'Installing Git...' #sudo apt-get -y install git sudo apt-get -y install git > /dev/null 2>&1 echo 'Removing Git...' #sudo apt-get -y purge git sudo apt-get -y purge git > /dev/null 2>&1 |
Useful links:
https://gist.github.com/rrosiek/8190550
http://stackoverflow.com/questions/10508843/what-is-dev-null-21
http://serverfault.com/questions/500764/dpkg-reconfigure-unable-to-re-open-stdin-no-file-or-directory