| Author |
Message |
|
|
Post subject: Script to 'undo' dist-upgrade
Posted: Feb 26, 2007 - 05:53 AM
|
|
Joined: Dec 10, 2006
Posts: 139
Location: Cape Cod
Status: Offline
|
|
Hello all
This seems too obvious an idea not to have already been thought of and dismissed, but I don't know any better so I'll ask anyway.
Could a script de written and possibly included in du_fixes_h2.sh that would 'undo' a dist-upgrade. That is, uninstall all packages upgraded in a d-u and reinstall from /var/cache/apt/archives all removed packages and their original config files that would hopefully have backups somewhere? The idea being that this could reverse a problem d-u to a previous, working state.
It just seems that this could solve some serious problems for some users when the day comes that a d-u breaks X or networking or anything else that would prohibit a user running only sidux on their machine from accessing the forums for help.
Don't know enough about scripting to know if this is too daunting a task, or if apt doesn't make info accessible enough as to what it's doing, or if this is a really dumb idea for some glaring reason I missed.
But I figured I'd throw the question out there anyway.
Thanks |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: Script to
Posted: Feb 26, 2007 - 07:06 AM
|
|
Joined: Nov 28, 2006
Posts: 4277
Status: Offline
|
|
Simple answer: no
That's not how apt works. You can downgrade specific packages to fix issues, and that happens now and then, but that's about it.
Feel free to try it though, I can guarantee you that I never will. Each and every package upgraded would always have to be logged each and every time, and of course if the user uses apt-get clean, forget it, all gone.
That's not how you deal with issues, backup and restore fixes everything. Separate root and home allows you to never lose any real data or configurations between backups.
I've restored 2 times the last year, takes about 15 minutes to do, perfect, like it was before the problem.
Just use good backup practice, and you'll be fine. There's a reason I put a backup script in my sig. |
_________________ sidux Maintenance script: dist-upgrade, kernel install, general utilities: smxi
Backup script [using rdiff-backup]: rd-h2.sh
|
| |
|
|
|
 |
|
|
Post subject: RE: Script to
Posted: Feb 26, 2007 - 09:14 AM
|
|
Joined: Dec 10, 2006
Posts: 139
Location: Cape Cod
Status: Offline
|
|
h2
Quote:
Feel free to try it though, I can guarantee you that I never will
I can barely write these posts, let alone a script to do this.
Just thought it was an interesting idea.
Figured it wasn't practical.
Thanks for responding |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: Script to
Posted: Feb 26, 2007 - 09:31 AM
|
|
Joined: Nov 28, 2006
Posts: 4277
Status: Offline
|
|
| Nothing wrong with asking though. I get lots of ideas from people, the ones that are workable I try to implement, the ones that aren't practical I don't, but don't let that stop you from asking. |
_________________ sidux Maintenance script: dist-upgrade, kernel install, general utilities: smxi
Backup script [using rdiff-backup]: rd-h2.sh
|
| |
|
|
|
 |
|
|
Post subject: RE: Script to
Posted: Feb 26, 2007 - 09:52 AM
|
|
Joined: Nov 25, 2006
Posts: 2555
Status: Offline
|
|
| Actually technically that would even be possible, all dpkg actions are indeed logged - but you're forgetting maintainer scripts and eventual data format changes in newer versions that would silently upgrade existing files while upgrading, but not being readable by older versions (or things like ucf). Even leaving this aside, the first task on that road would be to invest in advanced log parsing abilities so you can reliably identify upgrades and distinguish those against previous upgrades, a lot of work for a very dodgy results (officially downgrades are not supported in dpkg and rpm, it works quite often but given complex dependency chains or heavy maintainerscript interaction that is quickly becoming futile - and even dangerous). |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: Script to
Posted: Feb 26, 2007 - 03:17 PM
|
|
Joined: Dec 02, 2006
Posts: 1905
Status: Offline
|
|
| Most likely best course of action in event of a b0rked d-u is to just restore from a backup. Maintaining regular backups is a key thing and a good habit to get into. |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: Script to
Posted: Feb 26, 2007 - 11:33 PM
|
|
Joined: Dec 10, 2006
Posts: 139
Location: Cape Cod
Status: Offline
|
|
|
Quote:
but you're forgetting maintainer scripts and eventual data format changes in newer versions that would silently upgrade existing files while upgrading, but not being readable by older versions
slh
You're kind to say I 'forgot' something I was just to dim to think of myself.
Actually, this is just the sort of thing I was referring to with the line: "or if this is a really dumb idea for some glaring reason I missed"
Oh well, back to the laboratory to see what other addle-brained ideas I can concoct. |
|
|
| |
|
|
|
 |
|
|