After su-ing to root and running directly from the command line "apt upgrade", some packages upgrades result in a dialog -- white on blue text, with red block highlight for option selected with tab key) -- which after using tab to select the apporopriate option and then enter, continues with the exection of the process.

Now if the apt upgrade command is put into an executable Bourne shell script (along with other commands eg apt-file update, apt update before the apt upgrade) and the apt upgrade processs invokes dialog to get user input (keep old modified config version, replace config with new version etc) then keyboard input is ignored -- characters echo on terminal but are not seen by the dialog process.

The only thing that can be done is to go to another X terminal, kill the apt process, remove a lock file, run dpkg --configure -a, run apt-get -f upgrade etc

I suspect that the problem is possibly due to redirection of stdin and/or the tty mode being changed to raw mode when dialog is invoked.

So can apt be run from a shell script with some necessary setting so input is not lost when dialog is invoked by apt?

This problem is common to Debian, Ubuntu, and Linux Mint.

1 Answer 1


All my mistake in my shell script.

I was doing echo Y | apt upgrade which obviously causes the redirection problem when dialog gets called.

I should have been doing apt upgrade -y or wajig upgrade -y.

When I first tried apt -y upgrade it was complaining that the syntax was wrong. so had resorted to that bad hack which I had forgotten I had put in place.

Let others take note to avoid problems such as these.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .