Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I want to recreate the list of installed packages I had in my 11.10 installation into my new 12.04 one. I updated to 12.04 at the same time I bought a new HD, so I can mount the old HD where the old 11.10 system was installed, read the list of installed packages in 11.10 somewhere, and do an apt-get install for each of them. How can I produce the list of installed packages from the mounted HD where my 11.10 was installed?

I can't run commands on the 11.10 system since I have already changed the HD, but if the list is somewhere in /var/cache/apt/archives I can look at the mounted HD, that would be the solution for me.

share|improve this question

marked as duplicate by psusi, Seth, belacqua, Eric Carvalho, Basharat Sialvi Jun 5 '13 at 2:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
This is not a duplicate of the above question. This question asks how to get a list of a "mounted" drive not current running OS. This question must be answered using CHRoot not the method in the other question. Please re-open this question so I may answer it correctly. –  jfreak53 Aug 3 '13 at 15:46

1 Answer 1

sudo dpkg --get-selections.

If you want these packages to be installed on 12.04, do the following

  1. On your 11.10

sudo dpkg --get-selections "*" > packages

  1. Transfer the file 'packages' to 12.04 and do

sudo apt-get update

sudo dpkg --set-selections < packages

sudo apt-get -u dselect-upgrade

You can refer to this : http://sosaysharis.wordpress.com/2012/05/02/upgrading-to-ubuntu-12-04-the-way-i-did-it/

share|improve this answer
    
I can't change the HD again. I would like to get that list from the mounted HD. –  213441265152351 May 5 '12 at 16:14
    
Well your apt's cache will have quite a lot of the packages you have installed. But I'm not sure if that will have all of them. You can find it at /var/cache/apt/archives –  harisibrahimkv May 5 '12 at 16:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.