what will happen if I put my update and upgrade command on /etc/rc.local??
after reading some forums and all I understand that we can use crontab and so on. But what will happen if I do it in this way.
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
rc.local gives you no guarantees that the network is available, so your command will likely fail without doing what you expect it to do.
There is a proper way to get unattended upgrades working, which is configured in
/etc/apt and activated by
sudo dpkg-reconfigure --priority=low unattended-upgrades
Note that automatic updates work best when you also have automatic backups in place.
My answer is offered in the spirit of KISS, and is this:
Don't try to automate your updates & upgrades - not in
rc.local, not in
cron, and not even in
systemd. Why? As the bumper sticker says, "Shit Happens".
Also - there are times when a
reboot is required to load a new kernel - not doing so can cause strange and errant behavior with some apps. Unfortunately, the system will not tell you when a kernel update was made, and so you either guess when it's needed, or you
reboot after each
update && upgrade. Some of the Debian distros have a
reboot-required flag, but last I checked the Raspbian crowd hasn't ported this.
update && upgrade is inviting trouble - trouble that may take much more time and effort to unwind than 100 manual
update && upgrade.
If you want a notification or reminder to
update && upgrade at a certain date & time, this can be arranged in numerous ways. If you want an event-based reminder, consider setting up
apt-listchanges to send you a daily email (or redirect it to your