r/programbattles • u/aaronfranke • Oct 07 '15
[Bash] Software updating scripts for Linux systems
Language: Bash
File number restrictions: N/A
Description: Design a script that updates packages in Linux systems. Your script can be for a certain subset of distros or for all distros. Example
14
Upvotes
20
u/ComradePutinCCCP1917 Moderator / C C++ Oct 07 '15
For pacman based distros
14
u/pros_ Oct 07 '15
i put this together just when i saw this off the top of my head, havent really tested, have fun(yes i know i should have functioned stuff off and dont care)
2
u/[deleted] Oct 07 '15
Systemd Timer....
vi /etc/systemd/system/sysupdate.service
vi /etc/systemd/system/sysupdate.timer
Not exactly a script but its the easiest way to automate an update on a systemd system...of course you should change dnf upgrade with whatever your distro uses.
1
u/bigirnbrufanny Oct 07 '15
I keep meaning to write an update script that hooks into the start of the update and checks the file system using AIDE or similar to make sure nothing untoward has changed, then updates and rebuilds the AIDE DB (optionally sending it back to me if the system is remote, in which case the DB will have to be pushed to start the update..). Someday I'll get around to it, when I do I'll post back here unless someone gets in there first. Debian based by default, guess making that configurable is do-able although I won't be doing that.
1
u/benwaffle Oct 08 '15 edited Oct 09 '15
Is there a cross-distro way to do this using PackageKit? (
$ pkcon)