Page 1 of 9 123 ... LastLast
Results 1 to 10 of 84

Thread: HOWTO: Backup all installed programs/packages

  1. #1
    Join Date
    Apr 2006
    Location
    Coventry
    Beans
    1,379
    Distro
    Ubuntu 9.10 Karmic Koala

    HOWTO: Backup all installed programs/packages

    PROBLEM: Lets say you have set up your *buntu box. Now you want to backup all the installed deb files so that you can restore them quickly and efficiently.

    UPDATE: Why would you want this?
    When I was using windows I had a directory of EVERY Single program that I had downloaded. For one thing it would be easier to install everything as I would not have to go online and hunt for them. Further it would be useful where a computer does not have internet connection. In ubuntu "hunting" for programs is a rare occurrence thanks to the fantastic package managing system. However, I personally have about 20-30 programs that I have either compiled from source (using checkinstall, so that that a deb package is created and they are added to APT), or downloaded debs from obscure locations. Now each of these debs I will save in a directory so that in the future I do not have to go hunting for them. However, this command I have outlined backs up ALL packages, including the ones in the package manager. So, why would you want that?

    Firstly, this is VERY useful if lets say you have setup a very basic installation with all updates, and all non-free video/audio/etc codecs. Further you have installed some basic useful software. Now lets say you want to install the SAME setup on your grandmothers computer, except she does not have internet connection, or at the time you go to set it up she does not have a net connection. Using this script you can have all your debs in one simple location, so you will not have to redownload everything.

    Secondly, lets assume you work for a school, or a company, and you need to install the SAME ubuntu installation on 30 computers. Wouldn't it be easier to simply put all these debs in a central server and issue the dpkg -i *.deb command. This way you don't have to individually select the packages AND the packages don't have to download.

    Thirdly, (and this is purely personal) I like to be able to have all my installed packages at hand. This command doesn't take much effort, and for me it only requires 1.4 gb of space, so for a bit of piece of mind I can easily have all my packages on hand.

    There is no real reason to do this if you are already doing a full system backup (e.g. an image of your Ubuntu partition using partimage). This is just something I discovered and feel could be beneficial to other users.

    These commands will do that for you.

    Open a terminal and paste the following into it:

    Code:
    $ sudo apt-get install dpkg-repack fakeroot
    $ mkdir ~/dpkg-repack; cd ~/dpkg-repack
    $ fakeroot -u dpkg-repack `dpkg --get-selections | grep install | cut -f1`
    (the last command will take some time)

    Now if you scroll to your home folder, you should find a folder called "dpkg-repack" which should have all the deb files of all your installed packages.


    RE-INSTALL

    If you want to re-install the packages, navigate to the folder with the packages and input the following command in the terminal:
    Code:
    sudo dpkg -i *.deb
    Thanks to https://answers.launchpad.net/aptonc...n/15592/+index (Rafael)

    NB: I know AptonCD does this but what prompted me to use this method was that I had done the sudo apt-get clean command which had erased all the files in the /var/cache/apt directory, rendering AptonCD useless (as all it does is take the files from there and put it in the list). So I find this method is more efficient, and easier for me to control!
    Last edited by abhiroopb; June 7th, 2008 at 07:11 PM. Reason: How to re-install

  2. #2
    Join Date
    Jul 2007
    Location
    Virginia, US
    Beans
    Hidden!

    Re: HOWTO: Backup all installed programs/packages

    This is pretty cool, This will save some time when restoring my computer if I have screwed up the file system.

    If you don't mind I am going to link this in the forums of the Backup Program that I use, QuickStart. http://quickstart.phpbb.net/index.php

    Question: Do you have to save this in your home folder or can you change the path to an external drive?
    Registered Linux User: 453202 Registered Ubuntu User:17339
    WARNING: Don't take code or candy from strangers.

  3. #3
    Join Date
    Apr 2006
    Location
    Coventry
    Beans
    1,379
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Backup all installed programs/packages

    you should be able to do it anywhere you like. Haven't tested that though.

    Just change: mkdir ~/dpkg-repack; cd ~/dpkg-repack

    to wherever your external directory is (e.g. mkdir /media/external/dpkg-repack; cd /media/external/dpkg-repack)

    I don't really want to create a username but would it be ok if I were to suggest requests for QuickStart? It seems like a great program!
    Last edited by abhiroopb; June 5th, 2008 at 04:51 PM. Reason: Question

  4. #4
    Join Date
    Jul 2007
    Location
    Lungsod Pasig, Pilipinas
    Beans
    1,128
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: HOWTO: Backup all installed programs/packages

    How do I restore these back-ups (from say, /media/Storage/dpkg-repack) after I've reinstalled?
    I am a Man of Truth. I am a Free Human Person. I am a Peacemaker.
    ** Independent Multimedia Artist in Pasig **

  5. #5
    Join Date
    Apr 2006
    Location
    Coventry
    Beans
    1,379
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Backup all installed programs/packages

    Thanks I added it.

  6. #6
    Join Date
    Oct 2007
    Beans
    832
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HOWTO: Backup all installed programs/packages

    Quote Originally Posted by abhiroopb

    Code:
    $ sudo apt-get install dpkg-repack fakeroot
    $ mkdir ~/dpkg-repack; cd ~/dpkg-repack
    $ fakeroot -u dpkg-repack `dpkg --get-selections | grep install | cut -f1`
    Code:
    dpkg -i *.deb
    Quote Originally Posted by Het Irv View Post
    This is pretty cool.

    If you don't mind I am going to link this in the forums of the Backup Program that I use, QuickStart. http://quickstart.phpbb.net/index.php
    Hey Irv,

    This is 'pretty cool' as you say.

    Thanks for posting the link to here in the QuickStart forum. I'm always interested in back-up methods.

    Do I understand this correctly in that this will create the .deb files again from the apps that are installed? Even if they were deleted using apt-get clean?

    If this is something you want Irv, I don't see why we can't do it. If 'abhiroopb' would like to come over to our forum, we could talk with him some more and get his input for the addition.

    Drop me a note in the QS forum Irv and let me know.

    Thanks... mdpalow
    Last edited by mdpalow; June 5th, 2008 at 06:51 PM.

  7. #7
    Join Date
    Apr 2006
    Location
    Coventry
    Beans
    1,379
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Backup all installed programs/packages

    Yes this basically scans ALL installed deb packages (including those NOT installed through synaptic/apt) and downloads them to a local folder. Also I really liked the QuickStart script, although there are numerous additions/changes I would like to suggest. This is a bad time for me to work on anything though, if you would be willing to wait a couple of weeks I'd be glad to add my input.

  8. #8
    Join Date
    Nov 2007
    Location
    PA
    Beans
    190
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: HOWTO: Backup all installed programs/packages

    This will only backup programs not personal data, right?

  9. #9
    Join Date
    Apr 2006
    Location
    Coventry
    Beans
    1,379
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Backup all installed programs/packages

    Quote Originally Posted by Promaster91 View Post
    This will only backup programs not personal data, right?
    A debian file is much like an exe file in windows or a dmg file in OSX. So it is basically an installer. What this does is looks through ALL the installed programs in you're computer and downloads them to a local directory.

    So to answer your question it does not touch any data of any kind. It simply downloads your installed programs.

  10. #10
    Join Date
    Sep 2007
    Beans
    Hidden!

    Question Re: HOWTO: Backup all installed programs/packages

    What is all this?:
    Code:
    dpkg-deb: ignoring 1 warnings about the control file(s)
    
    warning, './dpkg-repack-20691/DEBIAN/control' contains user-defined field 'Original-Maintainer'

    It's doing it's thing now.

    Have a good day.
    Bruce

    EDIT: Once it's done can I just copy the directory to a DVD?
    Last edited by Bruce M.; June 5th, 2008 at 08:13 PM. Reason: EDIT

Page 1 of 9 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •