I need to feed apt a group of packages at a time.
I need to know how to do the following psuedo code in a bash function:
for every 5 packages in package list {
apt install -y 5 packages ;
sleep 10
}
Edit: the reason I need to do this is that, during setup stage, the daemon server throws an error and causes a timeout if there is more than 5 packages. this leads to most packages having broken installations. I would have to run apt install 40 times due to the large number of installs. that is why I ask this question.
use
xargs
If you need the
sleep
, you can usesh -c
: