On Ubuntu and Debian, often if I try to run a program I will get a message that says something to the effect of: You don't have that program. To get it type sudo -apt -get -install  programName(or some variation on that). Then I usually type exactly the command that was just suggested. Is there a hotkey that will automatically type the suggested command for me, e.g., I type something like AltUp and sudo -apt -get -install programName is automatically typed?
Hotkey for doing sudo suggestions
sudo;keyboard shortcuts
Just follow this link to bind commands.https://stackoverflow.com/questions/4200800/in-bash-how-do-i-bind-a-function-key-to-a-commandBind to any key you want: sudo apt-get -install !:0!:0 is the last command run, !:1 the first param, etc. !! is the last command line. This is all buried in the bash docs.Hope that answers everything.Caveat: I tested this code with echo !:0 not sudo apt-get -install !:0 for obvious reasons. I ran ls first and then pressed the F1 key (where I bound it).  I got it to say echo !:0, then expand to echo ls, and then write the letters ls to the terminal. I see no reason why this won't work for you though.