LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-08-2010, 10:35 AM   #1
camera3043
LQ Newbie
 
Registered: Jan 2010
Location: Greater Switzerland
Distribution: Debian Squeeze, Mint
Posts: 11

Rep: Reputation: 0
How can I store (and/or) print a list of installed software for later use?


I am running Debian on a 4 years old pentium machine. I have recently switched from Windows to Linux, so I'm still preferring the graphical user interface (Gnome is very good for me).

Now my problem: My harddisk becomes too small for the data I am storing and processing (pics, music, videos), and I would like to fit a larger one. So afterwards, I will need to reinstall debian and all the software I now have in it. How can I store a list of the currently installed software? (I can view it with the gnome apt software manager (also with synaptic), but I did not find a way how to store or print it).

Or, could I possibly save the whole system on an external harddisk and restore from that afterwards, as I do with the data?

Thank you

camera3043
 
Old 02-08-2010, 11:56 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Use dpkg.

http://www.unixtutorial.org/2008/09/...-ubuntu-linux/


"dpkg -l | grep '^ii' > filename.txt" will output all installed packages to the designated filename.
 
1 members found this post helpful.
Old 02-08-2010, 12:08 PM   #3
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by camera3043 View Post
Or, could I possibly save the whole system on an external harddisk and restore from that afterwards, as I do with the data?
I have used "partimage" several times to move my system to a larger hard drive.
 
Old 02-08-2010, 12:47 PM   #4
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

Rep: Reputation: Disabled
#sudo apt-cache pkgnames >pkg.txt

If you are getting a new PC, then a better idea would be to copy /home
 
Old 02-08-2010, 01:12 PM   #5
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Another idea:

We will just use your big new disk for your /home partition and filesystem. The OS really does not need much space, /home does.

I think I typed all this right, but always best to take a backup of /home first

Buy a new disk. Install, partition and format it to a linux filesystem like ext3.
Logout (we don't want the GUI running).

<CTRL><ALT><F2>
Login as root (or as yourself and then do sudo -i so you become root)
Mount the new disk at /mnt/newdisk

As root:
Code:
cp -a /home/ /mnt/newdisk
All your /home files will be copied over to the new disk.
Now unmount the new disk.

Now remount the new disk on /home (your old /home is still there "underneath" the new mount, but will be replaced with by home on the new disk, so do not panic).

Code:
mount -t ext3 /dev/sdb1 /home
Obviously, change /dev/sdb1 to reflect the partition your new home is on.

<CTRL><ALT><F7> Log in as yourself.
Does everything work? (Do not check emails or the "home"s will be out of sync).

Yes? Ok to proceed then:

Take the time to do a touch NEWHOME as the presence of this file will let you know which "home" you are using, later....

Logout from the GUI.

<CTRL><ALT><F2>
You are back at your root login.

Edit /etc/fstab to mount your new disk as /home with a line like this:

Code:
/dev/sdb1  /home  ext3 defaults  0 2

<CTRL><ALT><F7> Log in as yourself.
Do you see the file NEWHOME ?
If so, your home has been migrated.

Do a mount and then df -h to see all the extra room you have in /home

If you are happy, now is the time to delete the old "home".
So logout from the GUI (you must not be logged in to the GUI for these steps).

<CTRL><ALT><F2>
You are back at your root login.
Unmount the new home on the new disk

Code:
umount /home
Now the "old" home is again visible. Check that the file NEWHOME is not there, then
Code:
cd /home
pwd  #just to double-check
rm -rF *
Now remount the new home

Code:
mount /home
<CTRL><ALT><F7> Log in as yourself.

You should be done.
df -h to see the extra space on your / directory
 
Old 02-08-2010, 01:51 PM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
To get the installed packages
Code:
dpkg --get-selections > /backup/installed-software.log
To restore them
Code:
dpkg --set-selections < /backup/installed-software.log
Code:
dselect
Select 'i' for install the software

Backup /home and /etc so the settings are saved
 
Old 02-08-2010, 02:50 PM   #7
camera3043
LQ Newbie
 
Registered: Jan 2010
Location: Greater Switzerland
Distribution: Debian Squeeze, Mint
Posts: 11

Original Poster
Rep: Reputation: 0
Thank you everybody for your quick reply.

@ David the H.: dpkg brought me exactly what I was looking for. However: I was not aware of thelarge amount of software involved with the basic OS. So, only 5% or so of the 1200 line of text represent the "user software" intentionally installed by myself, and I have to figure out ...

@ David1357: Having said the above, it might be easier to use Partimage, even if I first have to find out how.
 
Old 02-08-2010, 02:54 PM   #8
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
@ David the H.: dpkg brought me exactly what I was looking for. However: I was not aware of thelarge amount of software involved with the basic OS. So, only 5% or so of the 1200 line of text represent the "user software" intentionally installed by myself, and I have to figure out ...
install debian, and get the installed packages to a file
Then diff the 2 files
 
Old 02-08-2010, 03:10 PM   #9
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by camera3043 View Post
@ David1357: Having said the above, it might be easier to use Partimage, even if I first have to find out how.
Use System Rescue CD.

If you use System Rescue CD, there are two approaches.
  1. You can use "partimage" to create an image of your current installation and then restore it to the new hard drive
  2. You can use "dd" to copy your current installation to the new hard drive
I always use method #1 because I have plenty of storage for images and it implicitly creates a backup in case I make a mistake. However, you will find many people on this forum posting method #2 as the correct approach.

In either case, you may have to use "GParted" to resize the partition after you restore it.
 
Old 02-08-2010, 03:11 PM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Diffing the installed packages doesn't work very well if (program) version numbers change - might be o.k. in this case as the install appears to be very recent. I use
Code:
aptitude search '(~i !~M )' > myPackages
Resulting diff is usually more manageable.

Last edited by syg00; 02-08-2010 at 03:13 PM.
 
Old 02-09-2010, 12:50 AM   #11
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
No, you won't have to install all of the list yourself. The majority of them are automatically installed as dependencies for something else. Pretty much the entire "libxxx" part of the list can be ignored, for example.

Personally I think you're too worried about it. Having a list like this is good for reference, but with a good internet connection you can quickly re-install anything on an as-needed basis anyway. It's not necessary to have everything back exactly the way you had it before you can start using the system. Often it's even better to start over with a clean slate to get rid of the cruft you don't really need.

Finally, take into consideration that packages and package names do change. Any list you make is going to have obsolete entries within a couple of months of creating it.
 
  


Reply

Tags
harddisk



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
List of software installed in fedora 12 anika.ella Linux - Newbie 5 02-01-2010 10:01 AM
How can I get a list of software that was installed via rpm TruongAn Linux - Software 10 10-04-2005 11:53 AM
How to list installed software on Linux? mojavex Linux - Software 1 09-16-2005 05:40 PM
print list of installed packags? Randall Slack Slackware 3 07-30-2005 03:10 PM
How do you list what software is installed? Tiyogi Linux - Software 5 04-22-2004 08:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration