A simple package update automation for GNU- Linux distros using apt commands:
- Place the 'update.sh' file in
/usr/bin/folder. - Open terminal and run
update.sh
This updates the packages everytime you run the command in the terminal.
Automating the updation (Using cronjobs)
- Run
crontab -ein the terminal. - Add this line at the end
0 13 * * * /usr/bin/update.sh >/dev/null 2>&1- ctrl(command) + x to save,
- 'Y' to confirm,
- Enter to exit.
This executes the job in background, in this case the job is running update.sh, everday at 1 pm.
![[cron.png]](https://github.com/madhanmohans/linux-pkg-update-automation/raw/main/cron.png)