Thursday, October 02, 2008

How to clone your linux machine

So, you've had your Linux box running for some years, and it's aquired a bit of chuff over the years. You want to streamline, so where do you go. A rebuild. Maybe, but how do you know what you've got installed.

Well, if you run ubuntu, then you run these:

aptitude search '~i' | awk '{print $1,$2,$3}' |grep A | awk '{print $3}' > installed.txt

aptitude search '~i' | awk '{print $1,$2,$3}' |grep -v A | awk '{print $2}' >> installed.txt

This picks up the dependancies for all your packages, and then all your manually installed packages.

Rebuild the system, (optionally) edit the file to remove the things you no longer need, then run:
for i in $(cat installed.txt) ; do packages+="$i " ; done
aptitude install $packages

Go make coffee.

Once finished you should be up and running with a re-built system.

Now all you have to do is re-build and install everything that wasn't done through aptitude. You did back up you /src directory didn't you?

No comments:

Top Tracks of 2012

Well, it's that time of year. Once again I can abuse my html knowledge and shove a few YouTube videos into a blog post to illustrate wha...