TL;DR: is there a way to "automatically" install any kept back packages? I know that apt-get dist-upgrade
is too blunt of an instrument.
Details...
I have a bash script that runs (periodically) to keep Ubuntu Desktop VMs in a consistent state.
It does the usual apt-get update
... apt-get upgrade
routine. Of course, there are the periodic kept-back packages.
I have addressed this up to now by adding the kept back packages to a manual list of apt-get install <whatever was kept back>
. I have started exploring a way to make this less manual.
About the time I found myself (seriously) pondering how to refactor sudo apt-get -V upgrade | grep '=>' | grep -Ei '([A-Z]+(-)?)+' -o | sed 'N;s/\n/ /;'
for readability, it occurred to me that perhaps there is a better way. (yes... I hadn't quite fixed the bugs in that line either)
The horribleness above was an attempt to pull out the (unversioned) kept back package names in order to pass them dynamically to apt-get install
.
So, is there a better way to identify the kept back packages and install them via apt-get install
?
sudo apt-get -V upgrade | grep '=>' | grep -Ei '([A-Z]+(-)?)+' -o | sed ':a;N;$!ba;s/\n/ /g'
isolates the names of the kept-back packages