maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   MeeGo / Harmattan (https://talk.maemo.org/forumdisplay.php?f=45)
-   -   Hack to backup apps packages (https://talk.maemo.org/showthread.php?t=87057)

minimos 2012-09-26 18:20

Hack to backup apps packages
 
I think I found a simple way of saving a copy of any installation package (whether coming from Nokia Store or manual apt-get command), at installation time.
It is a one line hack, so I'm not going to wrap it into a user-installable package.

So, open a terminal session as root, go to /etc/apt/apt-conf.d/, launch your favorite editor and create a file named "02backup" containing the following:
Code:

Dpkg::Pre-Install-Pkgs {"BKPDIR=/home/user/MyDocs/AptBackup/; mkdir -p $BKPDIR; while read pkg; do cp $pkg $BKPDIR; done"};
That's all.
Since the next installation, a directory /home/user/MyDocs/AptBackup/ should be created and all packages should be copied there.
I haven't tested with packages that download dependencies, but I believe also said dependencies will be 'backupped'.
Note: you may want to disable this feature if you are going to upgrade to a newer PR release, otherwise your upgrade will be slow and your storage getting filled.

ibrakalifa 2012-09-26 18:25

Re: Hack to backup apps packages
 
http://talk.maemo.org/showthread.php?p=1262280
noob question, is it has same goal? Thx btw, :)

minimos 2012-09-26 20:16

Re: Hack to backup apps packages
 
Quote:

Originally Posted by ibrakalifa (Post 1272601)
http://talk.maemo.org/showthread.php?p=1262280
noob question, is it has same goal? Thx btw, :)

It seems that backdeb tries to repackage an app, kind of 'regenerating' the installation package.
What I'm proposing instead is to save the original package 'as is' at installation time (plus, no special action is needed to do that).

cynik606 2012-09-27 09:00

Re: Hack to backup apps packages
 
Great! Thx.

mapl 2012-09-27 11:23

Re: Hack to backup apps packages
 
How about making a backup of INSTALLED apps?

minimos 2012-09-27 13:09

Re: Hack to backup apps packages
 
Quote:

Originally Posted by mapl (Post 1272899)
How about making a backup of INSTALLED apps?

You use the application mentioned in ibrakalifa's post.
Other choice could be to reinstall app (remove & reinstall if from Store, or 'apt-get --reinstall install' from command line)

khan.orak 2012-10-30 21:49

Re: Hack to backup apps packages
 
I try to cd to /etc/apt/apt-conf.d/ as Root but it says

sh: can't cd to /etc/....

I made the file using nano nd tried to copy it to the said location using FileBox. but it says Permission denied

any help?

minimos 2012-10-30 23:58

Re: Hack to backup apps packages
 
Quote:

Originally Posted by khan.orak (Post 1287764)
I try to cd to /etc/apt/apt-conf.d/ as Root but it says

sh: can't cd to /etc/....

You must have mistyped something, there are no problems in accessing /etc/ directory, even as non-root.

khan.orak 2012-10-31 00:36

Re: Hack to backup apps packages
 
Okay got it, it's actually apt.conf.d and not apt-conf.d

mubuntu 2013-02-10 05:01

Re: Hack to backup apps packages
 
1 Attachment(s)
Quote:

Originally Posted by minimos (Post 1272599)
I think I found a simple way of saving a copy of any installation package (whether coming from Nokia Store or manual apt-get command), at installation time.
It is a one line hack, so I'm not going to wrap it into a user-installable package.

So, open a terminal session as root, go to /etc/apt/apt-conf.d/, launch your favorite editor and create a file named "02backup" containing the following:
Code:

Dpkg::Pre-Install-Pkgs {"BKPDIR=/home/user/MyDocs/AptBackup/; mkdir -p $BKPDIR; while read pkg; do cp $pkg $BKPDIR; done"};
That's all.
Since the next installation, a directory /home/user/MyDocs/AptBackup/ should be created and all packages should be copied there.
I haven't tested with packages that download dependencies, but I believe also said dependencies will be 'backupped'.
Note: you may want to disable this feature if you are going to upgrade to a newer PR release, otherwise your upgrade will be slow and your storage getting filled.

Here is a Debian package that achieves the exact same thing (I just found this thread). Thanks minimos for this great idea!

P.S. You can append filenames with .deb after they are copied to the AptBackup folder. This will cause filebox, etc to show the proper icon.


All times are GMT. The time now is 09:17.

vBulletin® Version 3.8.8