4

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?

3 Answers 3

2

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)
0

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

3
  • @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. Apr 29, 2011 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, 2011 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. Apr 29, 2011 at 4:05
0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .