1) You could clone / ghost the drive with dd
like this.
dd if=/dev/sda of=/dev/sdb
2) Another option Clonezilla
Example usages:
- Save disk image
- Restore disk image
- Disk to disk clone (Same as the above
dd
command)
- One image to multiple disks
- Create Recovery Clonezilla
3) Other possibilities based on dpkg
and rsync
and a fresh install like here. Probably more preferable due to hardware/user info/passwords, as has been indicated in other answers.
Create text file of current packages as seen (here):
sudo -i # starts a root session
# ... run whatever commands you need to mount the safe storage device ...
dpkg --get-selections > /<path to safe storage device>/dpkg-selections
# records a list of installed packages into the file named after the > sign.
# ... now run commands you need to safely unmount the storage device ...
<ctrl-D> # end the root session.
Move the file created from this to the friends computer and run the following:
sudo -i # starts a root session.
# ... commands to mount the storage device ...
dpkg --set-selections < /<path to safe storage device>/dpkg-selections
# sets the list of packages to install from the list kept previously
apt-get dselect-upgrade # actually installs the packages.
# ... now unmount the device ...
<ctrl-D> # end the root session