You probably encuntered the case where a package was not installed and the system was recommending you to install it using
apt-get install mypackage.
I am looking for a quick keyboard shortcut for executing this last line. Obviously UP arrow would not bring it because it was not a command executed by you and only the last output line of the previous executed program.
Any ideas on how to get this behaviour in bash?