Logo 
Search:

Unix / Linux / Ubuntu Forum

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds

Can I save a list of software sources?

  Date: Jan 21    Category: Unix / Linux / Ubuntu    Views: 424
  

I've found it very useful to use dpkg with get-selections and
set-selections switches, to keep a list of my installed software
packages. Whenever I reinstall Ubuntu I can recover most if not all of
them very simply.

It occurs to me that the "if not all" above - that the reason it doesn't
reinstall everything - might be that I need to re-establish any
non-standard repositories first. I know how to do that manually, but I
don't know of any way of automating it. I imagine there probably is one.
So does anyone know:

1) Would it make a difference if I re-establish the repositories
before I run the three commands that reinstall my software?

2) How can I save the existing software sources list and reload
it later?

Share: 

 

4 Answers Found

 
Answer #1    Answered On: Jan 21    

Go to etc/apt and copy the sources.list file to your home folder where you
have read-write access.

 
Answer #2    Answered On: Jan 21    

Also copy the folder sources.list.d as it has several files foe
individual repo lines. Why they aren't included in the main
sources.list I don't know.

 
Answer #3    Answered On: Jan 21    

1) Yes, you will want to re-enable/add all of your repositories, then
run "sudo apt-get update"

2) You just need to save your sources list to an external location.
use something like:

"sudo cp /etc/apt/sources.list /media/ /backup/sources.list.bak"

You can then restore with the reverse. i.e.,

"sudo cp /media/ /backup/sources.list.bak /etc/apt/sources.list",

and you can put the command into a bash script, if preferred.

The only issue is if you are installing an new version of ubuntu, you
will want to retain the new repositories, so you would have to pipe
your text in sources.list.bak into your new sources.list via an
append... which is unfortunately a little above my pay grade without
spending some time on the web to figure out the right commands, and
I'm not sure if that is what you are after, either...


 
Answer #4    Answered On: Jan 21    

1. Yes.

2. I don't think it can be automated, because several of the repositories have
"lucid" or whatever version adjective in the name. However, you can save the
repository list (/etc/apt/sources.list) as a text file, and use that as in
indication of what you need to do.

I have run into the situation where I installed a new version, and there was not
yet a third-party repository for that version.

I always manually edit the get-selections list, so I don't re-install programs I
have lost interest in. Also, about a third of it is lib files, which are
automatically picked up as needed.

 
Didn't find what you were looking for? Find more on Can I save a list of software sources? Or get search suggestion and latest updates.




Tagged: