Answers to: backup/restore third party ppa'shttp://linuxexchange.org/questions/619/backuprestore-third-party-ppas<p>I use a couple of third party launchpad ppa repositories (mercurial, tortoisehg, medibuntu, etc.). I was wondering if there was a way (preferable a script) that would allow me to back up the ppa's and then later restore them? This would be very handy after a clean install of my system. Currently I can backup my package listing through synaptic but I can't restore it because I have to have the ppa's in place first.</p>enFri, 21 May 2010 12:29:13 -0400Answer by hilyardhttp://linuxexchange.org/questions/619/backuprestore-third-party-ppas/676<p>I would suggest learning and using PERL. I'm not good enough to tell you off the top of my head, but scripts that do similar things as you ask are available online and can be modified to suit. I'm learning this useful tool (PERL) myself -- not so much because I want to, but because it makes life easier. </p>hilyardFri, 21 May 2010 12:29:13 -0400http://linuxexchange.org/questions/619/backuprestore-third-party-ppas/676Answer by Garethhttp://linuxexchange.org/questions/619/backuprestore-third-party-ppas/658<p>Just copy the /etc/apt/sources.list file to a location, then after install copy it back and you will have all your ppa's referenced.</p> <pre><code>cp /etc/apt/sources.list /media/{external_device} </code></pre> <p>A lot easier than re-adding the PPA's after. This also has the advantage that it will also retain any additional, non-launchpad repositories you may have added.</p>GarethWed, 19 May 2010 11:20:20 -0400http://linuxexchange.org/questions/619/backuprestore-third-party-ppas/658Answer by guerdahttp://linuxexchange.org/questions/619/backuprestore-third-party-ppas/634<p>If you use the command <code>add-apt-repository</code>, all your custom ppa are added to the folder <code>/etc/apt/sources.list.d/</code>.</p> <p>It contains all information for this ppa. So just back up this folder, restore it and you're done:</p> <ol> <li><code>tar -cvjf mysweetppas.tar.bz2 /etc/apt/sources.list.d/</code></li> <li><code>sudo tar -xvjf mysweetppas</code></li> <li><code>sudo apt-get update</code></li> </ol> <p>To re-use the ppa you defined in <code>/etc/apt/sources.list</code>, you can do the following as root (!):</p> <ol> <li><code>cp /etc/apt/sources.list /media/[your external drive]/</code></li> <li><code>cat /media/[your external drive]/sources.list &gt;&gt; /etc/apt/sources.list</code></li> <li><code>apt-get update</code></li> </ol> <p>Note that you will have duplicates in your sources list! So review it before installing new software!</p> <p>Good luck!</p>guerdaMon, 17 May 2010 13:09:35 -0400http://linuxexchange.org/questions/619/backuprestore-third-party-ppas/634Answer by Troyhttp://linuxexchange.org/questions/619/backuprestore-third-party-ppas/633<p>I ended up writing a small shell script that uses:</p> <pre><code>sudo add-apt-repository ppa:&lt;repository-name&gt; </code></pre> <p>The information was from <a href="https://help.ubuntu.com/community/Repositories/CommandLine" rel="nofollow">here</a>. For this to work you need to install:</p> <pre><code>sudo apt-get install python-software-properties </code></pre> <p>After a clean install I'll be able to run the shell script and the ppa's that I use will be updated.</p>TroyMon, 17 May 2010 12:07:23 -0400http://linuxexchange.org/questions/619/backuprestore-third-party-ppas/633