11

As you've probably noticed - I am a Ubuntu noob (I just got it yesterday.)

I have installed some programs through Terminal before, about 5-10 - so using Terminal doesn't scare me. But, I'm getting a new computer soon (yes, yes, I know I should've waited and did this on the new computer instead, but I was so excited! I'm sure you can relate ;A;) and I've heard it's hard and time consuming to move apps over to another hard disk, and it would be easier just to install them again. So, I will... but I don't really remember what I have installed and want an easy way to do this.

Is there any way to have a list of installed programs in Terminal or somewhere - and possibly even the apt-get commands to reinstall?

Jorge Castro
  • 71,754
Mochan
  • 1,688
  • 1
    wow, from a noon to semi expert. Now you have got 1k++ points. Very nice. How's your way thru ubunto now? I find it difficult to migrate from windows, but what can I do, still trying. – M J Mar 23 '14 at 05:12
  • Haha indeed. It's been good so far. Now I'm using only Ubuntu and not Windows. Try your best, there are many willing people here to help you :) Good luck. – Mochan Mar 25 '14 at 06:00

3 Answers3

8

The magic keyword you are looking for is migration. You have the same question as someone who wants to move his current installation to a new computer.

Here is a quick explanation how to do it: http://eggsonbread.com/2010/01/28/move-ubuntu-to-another-computer-in-3-simple-steps/

If you just want to get the list of currently installed programs, you just need the first command:

sudo dpkg --get-selections | sed "s/.*deinstall//" | sed "s/install$//g" > ~/pkglist

This will store your currently installed packages in the file ~/pkglist (~ stands for your home directory). You can open and review it with any text editor or in the terminal with

cat ~/pkglist
mcbetz
  • 3,059
  • 2
    Btw, if you want to paste the command in your terminal, you have to use ctrl+shift+v – mcbetz Jul 21 '12 at 09:07
  • Oh ok, thanks. I usually Right-Click > Paste while in Terminal, but I didn't know that, thanks! And thank you so much for the link! If I had reputation I'd vote you up... but well, I'm still a noob ^^'' – Mochan Jul 22 '12 at 00:07
8

All you have to do is

dpkg --get-selections > list.txt

If you're trying to reinstall all these packages in another computer, just do

sudo dpkg --set-selections < list.txt && sudo apt-get -u dselect-upgrade
notablytipsy
  • 2,927
  • I tried this, and it just upgraded a python package. Is that what the second one was supposed to do? But great answer, thanks! – Mochan Jul 22 '12 at 00:03
  • After you save the package list, if you enter the second command, it will install all the packages in list.txt that are not currently in your computer. So, if you start with computer with newly-installed Ubuntu, and type the second commadn (and, of course, have a copy of list.txt), all the packages you had previously installed will be installed. – notablytipsy Jul 22 '12 at 03:43
  • You can Get detail by typing (apt list apt) Listing... Done _ apt/trusty-updates 1.0.1ubuntu2.11 i386 [upgradable from: 1.0.1ubuntu2.6]) it will show which package is upgrade able and which one is up2date. Simple list with packages version – Ramesh Chand Feb 08 '16 at 13:35
2

Open the dash, select the apps lens, and click on the installed section to see them all.

Also, reading your question more carefully, to get a text list, try dpkg --get-selections.

Eliah Kagan
  • 117,780
Jazz
  • 2,737
  • Great answer, thanks so much. Also, is there any way to transfer packages, or would that be another question? Thanks guys! – Mochan Jul 22 '12 at 00:05
  • 1
    See asymptotically's suggestion about re-installing the package list. – Jazz Jul 22 '12 at 22:05