Post Reply  Post Thread 
aptoncd, how to clone your Linux system
Author Message
ggarron
Administrator
*******


Posts: 28
Group: Administrators
Joined: Dec 2007
Status: Offline
Reputation: 0
Post: #1
aptoncd, how to clone your Linux system

This comes from a question a member of our community made, here is his question.

Quote:
it would be a Good Thing to have a nifty tool in the spirit of aptoncd that will let you automate the process of getting your system back to where it was, or cloning an existing system. What I'd like to see would basically work like:

1. Build a list of packages installed on the system;
2. Remove from the list any packages unchanged from the original install medium;
3. Pull down copies of those packages and cache them (not in the /var/cache/apt tree);
4. Build a DVD or CD, or set thereof, to hold the packages (an external hard-drive option would be lovely);
5. Finally, also back up your /etc/apt/ directory to the same media.

This way, reinstalling/cloning your current system is easy:

1. Do a default/simple/quick install of your distro onto the PC;
2. Put the (first) disk with your packages into the drive;
3. Run a shell script that whacks over your saved /etc/apt onto the system and then installs all the debs via dpkg or similar)

This way, I could easily give my new-to-Linux friends who've commented on my specific install a no-brainer way to recreate it; install and then update from the media. No network immediately needed, which would solve problems with things like initially quirky wireless chips (e.g., Broadcom).


The complete comment is here:

Well I do not have automate way to do this, but after searching around I have found this.

First get to know which packages are installed on your Linux

Code:
aptitude search '~i' > /tmp/installed.txt


This is going to list all packages installed on your Linux, the ones installed by you and the ones automatically installed as dependencies, those ones identified with an A.

Get the names of the packages

Code:
cat installed.txt | awk '{print $1,$2,$3}' > /tmp/installed2.txt


This is going to erase the comments' column.

Code:
grep -v A installed2.txt | awk '{print $2}' > /tmp/installed3.txt


This is going to copy only the "installed by you" packages and not dependencies. You can work just with this file, and let the cloned Linux to resolve the dependencies and download them from the web, but if you have slow or no Internet, it is better to carry the dependencies also, so lets add them.

Code:
grep A installed2.txt | awk '{print $3}' >> /tmp/installed3.txt


Now on installed3.txt we have all the packages needed to recreate our Linux, lets now download them, to create then the CD or DVD.

Download the desired packages

Code:
for i in $(cat /tmp/installed3.txt) ; do packages+="$i " ; done
aptitude download $packages


Once that is done, we can use again, How to: aptoncd

This post was last modified: 01-04-2008 06:48 AM by ggarron.

12-30-2007 07:48 AM
Visit this user's website Find all posts by this user Quote this message in a reply
simonambat
Junior Member
**


Posts: 1
Group: Registered
Joined: Aug 2008
Status: Offline
Reputation: 0
Post: #2
RE: aptoncd, how to clone your Linux system

Replicating Ubuntu linux on different hardware

In my project, 18 LAMP based web application is to be hosted in 18 locations on Ubuntu based Desktop servers. These 18 locations are independent and without internet connection.

For this I have done the following:

1. I Have installed Ubuntu 8.04 server on a PC (say,A) which has internet connection.
2. Since I wanted desktop also on the same machine, I installed ubuntu 8.04 desktop on PC A with ubuntu desktop 8.04 using 'apt-get'.
3. I installed some more packages with apt-get using internet on PC A.
4. I have loaded my LAMP based application also on to this PC A.
5. Using APTonCD, I have made copy of all the packages in the PC A.


Now I want to install all the applications (server, desktop, other applications) to 18 PCs where there is no internet connection.

For this I have loaded Ubuntu server on one of the new PC, say B.

Now, how can I load all the packages from the APTonCD to this PC B.
since desktop is not loaded to this PC, it does not have APTonCD package installed.
Once this is successful, I can do the samein all 18 machines.
Kindly help me to do this.

Thanks is advance
Simon Ambat

08-19-2008 12:38 PM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: