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>enTue, 14 Jun 2011 11:41:18 -0400Comment by rfelsburg on Troy's questionhttp://linuxexchange.org/questions/619/backuprestore-third-party-ppas#2598<p>Please accept an answer, or provide more details so we can help.</p>rfelsburgTue, 14 Jun 2011 11:41:18 -0400http://linuxexchange.org/questions/619/backuprestore-third-party-ppas#2598Answer 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