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.

I want to install new ubuntu 11.04 released yesterday, and my system currently has ubuntu 10.10. I have installed many packages related to my college project after 10.10 installation. Is there any script/code to find which packages I have installed after linux installation or packages other than default so that I can install them in new ubuntu version in one chance rather than on requirements again?

share|improve this question

migrated from stackoverflow.com Apr 29 '11 at 7:00

This question came from our site for professional and enthusiast programmers.

add comment

3 Answers 3

up vote 2 down vote accepted

I write a little script, some times ago, to obtain what you ask. Yes, the output should be refined, but it gives you a good hint to what you need (aptitude is required).

It essentially takes all packages installed not automatically after the end of the installation of the system, conventionally marked by the grub-pc package installation.

#!/bin/bash

export LC_COLLATE=C

eval $(lesspipe)

vars=($(less /var/log/dpkg.log* | sort | 
  grep 'status installed grub-pc' | head -1))
date="${vars[0]}"
time="${vars[1]}"

join \
  <(aptitude -F%p search '?installed?not(?automatic)' |
    sort) \
  <(less /var/log/dpkg.log* |
    sort |
    awk -v date=$date -v time=$time '(($1 == date && $2 > time) || $1 > date) 
      && $3 == "install" { print $4 }' |
    sort -u)
share|improve this answer
add comment

Why not just directly upgrade your 10.10 installation to 11.04? It'll automatically upgrade all of the packages you've added.

share|improve this answer
    
@WhiteFang I have read on many forums that currently its not safe to directly upgrade so first take backup all of your data first. So I don't wanna take risk for it. –  Sushant Jain Apr 29 '11 at 3:58
    
I wouldn't recommend it. I broke a few Ubuntu installs that way, and was too lazy to fiddle with Xorg and GRUB to fix it. –  Blender Apr 29 '11 at 4:02
    
Really? We've upgraded tons of systems directly without any problems. I have seen problems in the past, and yeah it can be a pain to workaround them. It would be safest to backup and reinstall, so I understand now. –  WhiteFang34 Apr 29 '11 at 4:05
add comment

/var/cache/apt/archives contains packages installed through repository.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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