So you don't want your user to have to type in a password to use sudo? You could add a line like this into /etc/sudoers
or a file in /etc/sudoers.d/
username ALL=(ALL) NOPASSWD: ALL
Or to just allow a few programs like reboot
and apt-get
:
username ALL=(ALL) NOPASSWD: /sbin/reboot, /usr/bin/apt-get
Might want to look into some apt-get
options too like:
-q, --quiet
Quiet; produces output suitable for logging, omitting progress
indicators. More q's will produce more quiet up to a maximum of 2.
You can also use -q=# to set the quiet level, overriding the
configuration file. Note that quiet level 2 implies -y; you should
never use -qq without a no-action modifier such as -d, --print-uris
or -s as APT may decide to do something you did not expect.
Configuration Item: quiet.
-y, --yes, --assume-yes
Automatic yes to prompts; assume "yes" as answer to all prompts and
run non-interactively. If an undesirable situation, such as
changing a held package, trying to install a unauthenticated
package or removing an essential package occurs then apt-get will
abort. Configuration Item: APT::Get::Assume-Yes.
--force-yes
Force yes; this is a dangerous option that will cause apt to
continue without prompting if it is doing something potentially
harmful. It should not be used except in very special situations.
Using force-yes can potentially destroy your system! Configuration
Item: APT::Get::force-yes.
Or you could blindly pipe a few newlines or "q"'s into apt-get
, I used to install one package that would ignore apt
options like -y
and wait for a keypress (probably in it's preinst or postinst script). Could try something like:
{
sleep 20
echo
echo "q"
} | apt-get upgrade
And if you're installing the exact same packages in every machine, you don't need to update
and upgrade
each one over the internet, you can download all the required .deb
files once with:
sudo apt-get install --download-only [packages]
or
sudo apt-get upgrade --download-only
then install them all from a local / shared folder with
sudo dpkg -iR /folder_of_debs
sudo sh -c 'apt-get update && apt-get upgrade -y && reboot'
?