This is a semi-random collection of posts on nearly all things Slackware and Linux-related -- at least as I see it.
A Script for Keeping Slackware Up-to-date...
My last blog post explained how to use lftp to maintain a local mirror to keep Slackware -stable up-to-date. The next logical step is to write a script to do that.
I started a thread on LQ seeking feedback on the method and the script and the result was a wonderful discussion with a useful script at the end.
Be sure to check out H_TeXMeX_H's alternative script in the same thread. He took my original idea and did something pretty cool with it.
Here's the script:
It has MD5 checking, and in my tests so far, it works well. I created an error by adding some text to one of the packages text files and the script exits correctly on the failed MD5 check.
I've also added GPG signature checking for the individual packages based on code posted by GazL in the thread above. Naturally, this requires: having one's own GPG key, importing the proper Slackware GPG key, and signing the Slackware key with one's own.
I started a thread on LQ seeking feedback on the method and the script and the result was a wonderful discussion with a useful script at the end.
Be sure to check out H_TeXMeX_H's alternative script in the same thread. He took my original idea and did something pretty cool with it.
Here's the script:
It has MD5 checking, and in my tests so far, it works well. I created an error by adding some text to one of the packages text files and the script exits correctly on the failed MD5 check.
I've also added GPG signature checking for the individual packages based on code posted by GazL in the thread above. Naturally, this requires: having one's own GPG key, importing the proper Slackware GPG key, and signing the Slackware key with one's own.
Code:
#!/bin/bash #update_slackware.sh #Note: run this script as root from the local ./patches directory. #Synchronize the local mirror with the remote mirror: lftp -c "open slackware.mirrors.tds.net/pub/slackware/slackware64-13.0/patches/ ; mirror -e -n packages" #Download the most recent CHECKSUMS.md5 file: rm -f CHECKSUMS.md5 lftp -c "open slackware.mirrors.tds.net/pub/slackware/slackware64-13.0/patches/ ; get CHECKSUMS.md5" #Check for MD5 checksum errors and exit if some are found. if grep "\./packages/" CHECKSUMS.md5 | md5sum -c | grep -v OK$ then echo "Script aborting. Try manually downloading the file(s) listed above" exit 1 fi echo "No errors found; checking package signatures and updating packages." #Check GPG signatures and upgrade Slackware with downloaded packages: cd packages for package in *.t?z.asc do if gpg --verify "$package" then upgradepkg ${package%.asc} else echo "ERROR: ${package%.asc} doesn't match signature file. Skipped!" 1>&2 fi done #Find configuration files that need attention: echo "Checking for new configuration files:" find /etc -name "*.new"
Total Comments 2
Comments
-
The general catch of Slackware, IMO is that you actually free to update whenever you want. And since that, I guess most users won't need that if they doing this manually.
But that looks nice though i didn't test it Thanks!Posted 02-04-2010 at 09:40 AM by Web31337 -
Quote:
Thanks for looking!
-DrewPosted 02-04-2010 at 12:06 PM by Lufbery