How to make each package upgrade to save it first

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help

How to make each package upgrade to save it first

Postby macias on Tue Jan 04, 2011 9:07 am

Hi,

With rolling release distro (as with LMDE) I am concerned about simple rollback. So I would like to set global (per entire system) option, that before installing any package it is copied to some directory (/packages, it is not important).

The reason: with such workflow, I could update whatever I want, and if for example the newest version of Dolphin would be worse than before I could simply go to mentioned above directory and install previous version instead (the previous version is either base version -- on ISO -- or version from previous update).

So -- is there such feature as global option to store each package before install (it have to be guaranteed, that no package is updated on-fly, i.e. without being stored before)?

Cheers,
macias
Level 1
Level 1
 
Posts: 30
Joined: Tue Dec 21, 2010 12:06 pm

Linux Mint is funded by ads and donations.
 

Re: How to make each package upgrade to save it first

Postby bobcollard on Tue Jan 04, 2011 9:16 am

The packages are already stored in: /var/cache/apt/archives
Robert Collard, Springfield, IL
Dell Inspiron 1545 Laptop, Intel Duo T3400 CPUs @2.16 Ghz. 4GB RAM
Linux Mint Debian Edition, Xfce 4.6.2 Desktop, 2.6.37-0.dmz.6-liquorix-amd64
User avatar
bobcollard
Level 5
Level 5
 
Posts: 717
Joined: Thu Oct 22, 2009 4:44 pm
Location: Springfield, IL

Re: How to make each package upgrade to save it first

Postby randomizer on Tue Jan 04, 2011 9:21 am

Until you run apt-get autoclean I'm fairly sure that no packages are removed, even if they are superseded.
User avatar
randomizer
Level 5
Level 5
 
Posts: 871
Joined: Mon May 03, 2010 7:15 am

Re: How to make each package upgrade to save it first

Postby macias on Tue Jan 04, 2011 10:01 am

Thank you very much for your help. Is there guarantee those packages will be kept (until explicit clean)? In conditions like (example) running out of disk space.

I am asking this because for rollback purpose this is essential difference, that package is probably kept <-- and --> is kept for sure 101%.
macias
Level 1
Level 1
 
Posts: 30
Joined: Tue Dec 21, 2010 12:06 pm

Re: How to make each package upgrade to save it first

Postby bobcollard on Tue Jan 04, 2011 10:04 am

macias wrote:Thank you very much for your help. Is there guarantee those packages will be kept (until explicit clean)? In conditions like (example) running out of disk space.

I am asking this because for rollback purpose this is essential difference, that package is probably kept <-- and --> is kept for sure 101%.

You could backup this folder to an external drive.
Edit: There are no guarantees.
Robert Collard, Springfield, IL
Dell Inspiron 1545 Laptop, Intel Duo T3400 CPUs @2.16 Ghz. 4GB RAM
Linux Mint Debian Edition, Xfce 4.6.2 Desktop, 2.6.37-0.dmz.6-liquorix-amd64
User avatar
bobcollard
Level 5
Level 5
 
Posts: 717
Joined: Thu Oct 22, 2009 4:44 pm
Location: Springfield, IL

Re: How to make each package upgrade to save it first

Postby macias on Tue Jan 04, 2011 11:15 am

Ok, so I have to use other way, because if there is no guarantee there is also no point in making backup (some packages could be erased between backups).

If anyone knows how to make packages stay permanently (until explicit clean), please post here.
macias
Level 1
Level 1
 
Posts: 30
Joined: Tue Dec 21, 2010 12:06 pm

Re: How to make each package upgrade to save it first

Postby oOarthurOo on Tue Jan 04, 2011 2:23 pm

http://wiki.debian.org/RollbackUpdate

Alternatively, I believe some filesystems have the ability to snapshot and rollback. You might research that, but I suspect its not a common practice yet.
oOarthurOo
Level 1
Level 1
 
Posts: 33
Joined: Wed Oct 06, 2010 3:37 pm

Re: How to make each package upgrade to save it first

Postby macias on Tue Jan 04, 2011 3:34 pm

Thank you very much for the link. This approach however relies on fact, that somebody still keeps previous version in the repo. So you have to have some good luck, and be online -- which kills the purpose of rollback (how you rollback some net package, which establishes net connection).

> Alternatively, I believe some filesystems have the ability to snapshot and rollback.

I would like to not go that far.

All I need is simple rollback -- when I update something, it is stored, and that's all. Even after a year, if I need rollback, I rely totally on myself, not any third party, I simply install the package I have on disk. KISS principle at its best I think.
macias
Level 1
Level 1
 
Posts: 30
Joined: Tue Dec 21, 2010 12:06 pm

Re: How to make each package upgrade to save it first

Postby bobcollard on Tue Jan 04, 2011 3:51 pm

If you use something like sbackup and designate this folder to be backed up, the older versions will not be removed, it will backup whatever is new and leave the rest depending upon your setup. You decide what is removed, when. It is called incremental backup.
Robert Collard, Springfield, IL
Dell Inspiron 1545 Laptop, Intel Duo T3400 CPUs @2.16 Ghz. 4GB RAM
Linux Mint Debian Edition, Xfce 4.6.2 Desktop, 2.6.37-0.dmz.6-liquorix-amd64
User avatar
bobcollard
Level 5
Level 5
 
Posts: 717
Joined: Thu Oct 22, 2009 4:44 pm
Location: Springfield, IL

Re: How to make each package upgrade to save it first

Postby oOarthurOo on Tue Jan 04, 2011 4:26 pm

macias wrote:Thank you very much for the link. This approach however relies on fact, that somebody still keeps previous version in the repo. So you have to have some good luck, and be online -- which kills the purpose of rollback (how you rollback some net package, which establishes net connection).

> Alternatively, I believe some filesystems have the ability to snapshot and rollback.

I would like to not go that far.

All I need is simple rollback -- when I update something, it is stored, and that's all. Even after a year, if I need rollback, I rely totally on myself, not any third party, I simply install the package I have on disk. KISS principle at its best I think.


Well, I've never looked into it, because it seems inadvisable to me, but if you're committed there's two ways I'd look to first.

1. Run a cron job daily that runs an rsync job to copy any new packages from /apt/cache to your backup location.
2. Create the rsync job as above, but as a shell script. Make the last line of that script execute an aptitude update at the end then exits. Give the script an alias like "safe aptitude update" and execute that instead of the normal aptitude update.
oOarthurOo
Level 1
Level 1
 
Posts: 33
Joined: Wed Oct 06, 2010 3:37 pm

Re: How to make each package upgrade to save it first

Postby macias on Wed Jan 05, 2011 8:00 am

Thank you. I think better approach would be to patch apt-get -- add an option which guarantees no package is removed during install, even if there is no space on disk (in such case download & install fails, but the old packages are intact). Since apt-get is open-source I think amount of coding is comparable, but in this approach the result would be rock-solid.
macias
Level 1
Level 1
 
Posts: 30
Joined: Tue Dec 21, 2010 12:06 pm

Re: How to make each package upgrade to save it first

Postby oOarthurOo on Wed Jan 05, 2011 10:06 am

macias wrote:Thank you. I think better approach would be to patch apt-get -- add an option which guarantees no package is removed during install, even if there is no space on disk (in such case download & install fails, but the old packages are intact). Since apt-get is open-source I think amount of coding is comparable, but in this approach the result would be rock-solid.

:?
Ok... I'm going to assume you're just naive and not a troll.

Amount of coding / knowledge is nowhere near comparable. Amount of work to support and maintain each solution is nowhere near comparable. Lastly, I'd bet my life on rsync solution, since it is a long standing, well known, thoroughly debugged program, whereas anything you manage to produce would be an unknown quantity likely to contain bugs since you have neither a deep understanding of apt-, aptitude or, judging from your regard for which is better, much experience coding.

For myself, I'd judge the cron/rsync job to take about 1 hr of work, the pre-inst / post-inst scripts calling rsyn about 2hrs, and patching apt-get :roll: about a month following by ongoing maintainance costs unless you managed to upstream your changes. For you I'd think it'd be longer, if only because you naively believe your own patches would be without bugs and not incur ongoing costs and haven't done the minimal amount of work to see about setting up a pre-inst/post-inst rsync job.

Honestly if you're this concerned about breakage maybe Testing isn't for you. Stuff breaks. It's no big deal. You fix it. Life goes on. You don't need a separate hard-drive of backups of the installation packages. Speaking of which, try imagining coding in a test to see how many versions of say evolution there are on your backups, and deleting those more than 2 versions behind. Pretty simple with a bash script.
oOarthurOo
Level 1
Level 1
 
Posts: 33
Joined: Wed Oct 06, 2010 3:37 pm

Re: How to make each package upgrade to save it first

Postby macias on Wed Jan 05, 2011 10:56 am

> Ok... I'm going to assume you're just naive and not a troll.

Was this REALLY necessary?

> Honestly if you're this concerned about breakage maybe Testing isn't for you.

Maybe it is not, switching to stable repo is easy. I will see, and then I make my pick.

> Stuff breaks. It's no big deal. You fix it.

No, I won't and it is big deal -- I am not how-cool-is-this-new-plasma guy. I have work to do. I have my projects, and I won't fix every package which was shipped with regressions. And it is not about Stable/Testing/Unstable. It is about quality and my needs. I still use KDE3.5 because KDE4.x in my opinion is several steps back. And I bet KDE4.x is for some time in Stable repo, correct?

If you think for a bit about the info I already got from all forum members here (thank you all again) you come to conclusion, that the patch is not that hard -- because storing is already there. So such option would only prevent deleting. All it takes is -- adding an option, finding all references to cleaning the cache, and adding conditional in all places except explicit clean. That's all. Job well done, zero workarounds (I have to wait for newer LMDE though).
macias
Level 1
Level 1
 
Posts: 30
Joined: Tue Dec 21, 2010 12:06 pm

Re: How to make each package upgrade to save it first

Postby bobcollard on Wed Jan 05, 2011 1:30 pm

macias wrote:> (I have to wait for newer LMDE though).

This is a rolling upgrade, you do not have to wait.
Robert Collard, Springfield, IL
Dell Inspiron 1545 Laptop, Intel Duo T3400 CPUs @2.16 Ghz. 4GB RAM
Linux Mint Debian Edition, Xfce 4.6.2 Desktop, 2.6.37-0.dmz.6-liquorix-amd64
User avatar
bobcollard
Level 5
Level 5
 
Posts: 717
Joined: Thu Oct 22, 2009 4:44 pm
Location: Springfield, IL

Re: How to make each package upgrade to save it first

Postby oOarthurOo on Wed Jan 05, 2011 1:48 pm

macias wrote:And I bet KDE4.x is for some time in Stable repo, correct?

If you're still on KDE 3.5 you definitely should avoid rolling, testing. Try debian stable or centos.

that the patch is not that hard -- because storing is already there. So such option would only prevent deleting. All it takes is -- adding an option, finding all references to cleaning the cache, and adding conditional in all places except explicit clean. That's all. Job well done, zero workarounds


If you say so. Here's the apt source package: http://packages.debian.org/source/squeeze/apt Good luck with that.

Waiting won't do you any good because apt gets updated on Testing. You'll have to apply your patch to each new release, build and install yourself. If you don't realize this... good luck with that.

For anyone else interested in achieving this, create a script, put this in it "rsync -a source/ destination/", make "aptitude update" the last command before exit, make it executable, and give it an alias like "safe-aptitude-update". Make sure to mount "desination" in fstab if it's on a separate partition. If you already have a partition or destination in mind total time is about 10 minutes.
oOarthurOo
Level 1
Level 1
 
Posts: 33
Joined: Wed Oct 06, 2010 3:37 pm

Re: How to make each package upgrade to save it first

Postby macias on Wed Jan 05, 2011 2:51 pm

> This is a rolling upgrade, you do not have to wait.

I am unable to install LMDE right now, that's why I wait.

> If you're still on KDE 3.5 you definitely should avoid rolling, testing. Try debian stable or centos.

No, no, I use openSUSE now for ~13 years, and I have enough of non-rolling distros, when you have to upgrade at some point anyway. So no, my next "upgrade" is some rolling release distro, when I won't be force to upgrade entire system ever again. LMDE looks most promising, so I'll wait for it.

The only real competitor for RR distro is PC-BSD, because of its self-contained packages (all necessary stuff is inside each package).
macias
Level 1
Level 1
 
Posts: 30
Joined: Tue Dec 21, 2010 12:06 pm

Re: How to make each package upgrade to save it first

Postby randomizer on Wed Jan 05, 2011 8:43 pm

If you are looking for the utmost stability and a rolling release then you're looking for something that probably doesn't exist. Rolling releases by their very nature compromise stability (to varying degrees) for freshness. Updates are pushed out before they have plenty of time to be thoroughly tested, but the advantage is that if something does break it can also be corrected with a shorter turnaround time than if a breakage occurred on a relatively frozen distro.

Regarding KDE versions: Squeeze, which will go Stable soon, uses KDE 4.4 by default. KDE 3.x is no longer maintained by the upstream developers. It is probably possible to use 3.5 on Squeeze, especially if you get one of the older ISOs that still used 3.5 and upgrade all packages from there except those which would force you to install 4.4.
User avatar
randomizer
Level 5
Level 5
 
Posts: 871
Joined: Mon May 03, 2010 7:15 am

Re: How to make each package upgrade to save it first

Postby macias on Thu Jan 06, 2011 3:22 am

> If you are looking for the utmost stability and a rolling release then you're looking for something that probably doesn't exist.

Rolling release is mechanism, it does not imply the source of the data. By default LMDE uses Testing repo, but it can be switched -- to Unstable (making the system even more unstable than Testing) or Stable (making system MORE stable than Testing). Besides, rolling release does not mean you have to update anything (you can install it once, and not update anything), but IF you update, you update this or that package, not entire system (at least this is my understanding).

> Regarding KDE versions:

I will evaluate other desktop environments, for lack of eye candies and high degree of configurability. I am aware though that switching from openSUSE 11.1 (3 years old now IMHO) with KDE 3.5 to completely different system with completely different DE will be painful ;-)

Thank you for the hint with KDE3.5, there are some great programs, which newer versions didn't beat so far, like Gwenview.
macias
Level 1
Level 1
 
Posts: 30
Joined: Tue Dec 21, 2010 12:06 pm

Re: How to make each package upgrade to save it first

Postby randomizer on Thu Jan 06, 2011 3:44 am

macias wrote:but IF you update, you update this or that package, not entire system (at least this is my understanding).

That's correct, providing the upgraded package doesn't require a newer version of certain dependencies than you have installed. It's much the same as a frozen release, except that frozen releases don't usually upgrade features. They release bug fixes and security patches. A frozen release typically becomes more stable as it matures, while a rolling release does not, because rather than refining what is already installed you receive packages with much larger changes more rapidly. For example, Kubuntu 10.10 will almost certainly continue to receive KDE 4.5.x updates, but will never receive KDE 4.6.x updates. Arch Linux will move to KDE 4.6 almost as soon as it is released, and 4.7 after that (assuming that 4.7 is the next major release).

So yes, while the difference between the two distribution methods is mostly the mechanism for release, there's some design philosophy differences behind it as well.
User avatar
randomizer
Level 5
Level 5
 
Posts: 871
Joined: Mon May 03, 2010 7:15 am

Re: How to make each package upgrade to save it first

Postby Anixx on Thu Jan 06, 2011 10:42 am

macias wrote:I am aware though that switching from openSUSE 11.1 (3 years old now IMHO) with KDE 3.5 to completely different system with completely different DE will be painful


You can continue using OpenSUSE with KDE3. All will be OK with KDE3 repository at least for 11.4 and for the observable future. More information is here: http://en.opensuse.org/KDE3 KDE3 build status is here: https://build.opensuse.org/project/moni ... KDE%3AKDE3

It was also announced that there will be a rolling-release OpenSUSE variant soon.
Anixx
Level 1
Level 1
 
Posts: 1
Joined: Thu Jan 06, 2011 10:39 am

Linux Mint is funded by ads and donations.
 

Return to Newbie Questions

Who is online

Users browsing this forum: No registered users and 6 guests