DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a Pentium System on which I have been running Debian Sarge. After removing/installing many packages many times, finally I have the system ready the way I wanted.
Now I want the exact similar configuration on my AMD system. Basically, I want to install all the packages that are there on my Pentimum system.
I know I can get list of all packages that are installed on my system by the command:
Code:
dpkg -l
But then that way I will have to
Code:
apt-get install <all the packages listed in the file>
which will be like typing too much.
Is there any convenient way by which I can achieve the above. Is there a way by which we can specify apt-get to install all the packages whose names are there in a particular file. I cud think of only this method.
One thing you might try is to just image your current drive and put it on the other drive. When you boot up the new machine, it'll upchuck because of different hardware, but you can rerun base-config and dpkg-reconfigure xserver-xfree86. That might get you there...
One thing you might try is to just image your current drive and put it on the other drive. When you boot up the new machine, it'll upchuck because of different hardware, but you can rerun base-config and dpkg-reconfigure xserver-xfree86. That might get you there...
Thanks for info. Actually, I thought the something like that, but I would like to prefer a fresh installation of packages rather than copying the image entirely.
To make a local copy of packages: dpkg --get-selections >myselections.txt
To transfer to another computer, copy the text file and then: dpkg --set-selections <myselections.txt
To install, run dselect, and choose Install or apt-get dselect-upgrade
Hope that helps...
Great...Actually I also just discovered the --get-selections option, but then I don;t know how to install after redirecting to the file. But I am glad that you found it how to install them(apt-get dselect-upgrade).
Thanks a lot.....
Great...Actually I also just discovered the --get-selections option, but then I don;t know how to install after redirecting to the file. But I am glad that you found it how to install them(apt-get dselect-upgrade).
Thanks a lot.....
Will try it and see how it goes.
Don't forget the dselect updateafter the --set-selections to get the dpkg/apt databases in sync.
Don't forget the dselect updateafter the --set-selections to get the dpkg/apt databases in sync.
thanks for the info, Happy Tux. Just to summarize and confirm here are the steps that I need to do:
On Source machine:
#dpkg --get-selections >myselections.txt
Transfer the myselections.txt file on the destination computer
On Destination machine:
#dpkg --set-selections <myselections.txt
#apt-get dselect-upgrade
#dselect update
I hope I did not miss any step. Let me know if it is ok.
thanks for the info, Happy Tux. Just to summarize and confirm here are the steps that I need to do:
You have the last two mixed up other than that it is correct.
On Source machine:
#dpkg --get-selections >myselections.txt
Transfer the myselections.txt file on the destination computer
On Destination machine:
#dpkg --set-selections <myselections.txt
#dselect update
#apt-get dselect-upgrade
You have the last two mixed up other than that it is correct.
On Source machine:
#dpkg --get-selections >myselections.txt
Transfer the myselections.txt file on the destination computer
On Destination machine:
#dpkg --set-selections <myselections.txt
#dselect update
#apt-get dselect-upgrade
You have the last two mixed up other than that it is correct.
On Source machine:
#dpkg --get-selections >myselections.txt
Transfer the myselections.txt file on the destination computer
On Destination machine:
#dpkg --set-selections <myselections.txt
#dselect update
#apt-get dselect-upgrade
Ok, so I tried the method as suggested by you guys and it seemed to work pretty well. The only question that I have is, does this method purge the packages also or it just adds the missing package. Because I doubt that my target machine has few extra packages installed which are not there in my source machine. In short does this method perform both the operations like install and purge.???
I want my two system to be identical in terms of packages irrespective of thier starting state. Also do I have to run the command
Code:
#dselect update
on my source machine also before I get the list of packages by the command
Code:
#dpkg --get-selections >myselections.txt
For Example,
On my source the package nvi was not there
but on my destination the package nvi was there
Does this mean that the above method just checks for the missing package and not for additional packages installed on destination system and purges them??
Thanks.
Last edited by kushalkoolwal; 02-15-2006 at 06:39 PM.
For Example,
On my source the package nvi was not there
but on my destination the package nvi was there
Does this mean that the above method just checks for the missing package and not for additional packages installed on destination system and purges them??
Thanks.
It was my understanding that it did what you wanted but if what you say is correct then obviously it does not. I only ever used it on machines with just a base install then transfer the packages.txt and do the upgrade, I think I am out of ideas on this one.
You could probably write a script to compare what's on the system to what's on the list, then make a new list of the differences and go into dselect to delete them.
You could probably write a script to compare what's on the system to what's on the list, then make a new list of the differences and go into dselect to delete them.
Will the diff or cmp command do the trick? I haven't done this before so was kind of wondering.
diff worked okay, except that it didn't really tell me which file had the extra packages... But I guess you could search your system to see if they're installed with dpkg -l filename to make sure that's the right system.
The part that didn't make any sense to me is that some of the files were marked as "deinstall" but then when I used dselect to remove them, they remained in the database the next time I did dpkg --get-selections >myselections.txt, still listed as "deinstall", although they were removed...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.