I am trying to create an alias/bash script that will use apt to fully upgrade all applications on my computer as a background process.
But for some reason, later parts of the standard out appear to be printing to the main commandline, even if I spawn an entirely different bash instance and disown my script
bred@loaf:~$ alias aptup='sudo apt-get update > ~/aptlog && sudo apt-get dist-upgrade >> ~/aptlog && sudo apt-get upgrade >> ~/aptlog &'
bred@loaf:~$ aptup
[1] 24361
bred@loaf:~$ Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
Entering ResolveByKeep
^C
[1]+ Done sudo apt-get update > ~/aptlog && sudo apt-get dist-upgrade >> ~/aptlog && sudo apt-get upgrade >> ~/aptlog
bred@loaf:~$ alias aptup="sudo bash -c 'apt-get update > ~/aptlog && apt-get dist-upgrade >> ~/aptlog && apt-get upgrade >> ~/aptlog & disown'"
bred@loaf:~$ aptup
bred@loaf:~$ Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
Entering ResolveByKeep
^C
bred@loaf:~$
Note the "^C" is me using Ctrl+C to exit the process and regain control because the task is done.
EDIT: Also, I should be running the
--yes --force-yes
tags on each of the upgrade commands so that apt has permission to do upgrades if there are any. But the same result occurs nonetheless
&> ~/aptlog
? – Zanna Aug 20 '17 at 06:41