when you reinstall your ubuntu system, you can bakup your app
their location is : /var/cache/apt/archives
and you can use this script to install some commen tools:
#!/bin/bash
# error: 动态 MMap 没有空间了。请增大 APT::Cache-Limit 的大小。当前值:25165824
(echo '$a';
echo 'APT::Cache-Limit 99999999;';
echo '.';
echo 'wq')|sudo ed -s /etc/apt/apt.conf
# install vim
sudo apt-get install vim --force-yes -y
# update source.list
(echo '$a';
echo '#网易源';
echo 'deb http://mirrors.163.com/ubuntu/ karmic main restricted universe multiverse';
echo 'deb http://mirrors.163.com/ubuntu/ karmic-security main restricted universe multiverse';
echo 'deb http://mirrors.163.com/ubuntu/ karmic-updates main restricted universe multiverse';
echo 'deb http://mirrors.163.com/ubuntu/ karmic-proposed main restricted universe multiverse';
echo 'deb http://mirrors.163.com/ubuntu/ karmic-backports main restricted universe multiverse';
echo 'deb-src http://mirrors.163.com/ubuntu/ karmic main restricted universe multiverse';
echo 'deb-src http://mirrors.163.com/ubuntu/ karmic-security main restricted universe multiverse';
echo 'deb-src http://mirrors.163.com/ubuntu/ karmic-updates main restricted universe multiverse';
echo 'deb-src http://mirrors.163.com/ubuntu/ karmic-proposed main restricted universe multiverse';
echo 'deb-src http://mirrors.163.com/ubuntu/ karmic-backports main restricted universe multiverse';
echo '#台湾';
echo 'deb http://tw.archive.ubuntu.com/ubuntu/ karmic main universe restricted multiverse';
echo 'deb http://tw.archive.ubuntu.com/ubuntu/ karmic-updates universe main multiverse restricted';
echo 'deb http://tw.archive.ubuntu.com/ubuntu/ karmic-proposed universe main multiverse restricted';
echo 'deb http://tw.archive.ubuntu.com/ubuntu/ karmic-security universe main multiverse restricted';
echo 'deb http://tw.archive.ubuntu.com/ubuntu/ karmic-backports main multiverse restricted universe';
echo 'deb-src http://tw.archive.ubuntu.com/ubuntu/ karmic main universe restricted multiverse';
echo 'deb-src http://tw.archive.ubuntu.com/ubuntu/ karmic-security universe main multiverse restricted';
echo 'deb-src http://tw.archive.ubuntu.com/ubuntu/ karmic-updates universe main multiverse restricted';
echo 'deb-src http://tw.archive.ubuntu.com/ubuntu/ karmic-proposed universe main multiverse restricted';
echo 'deb-src http://tw.archive.ubuntu.com/ubuntu/ karmic-backports universe main multiverse restricted';
echo '#搜狐源';
echo 'deb http://mirrors.sohu.com/ubuntu/ karmic main restricted';
echo 'deb-src http://mirrors.sohu.com/ubuntu/ karmic main restricted';
echo 'deb http://mirrors.sohu.com/ubuntu/ karmic-updates main restricted';
echo 'deb-src http://mirrors.sohu.com/ubuntu/ karmic-updates main restricted';
echo 'deb http://mirrors.sohu.com/ubuntu/ karmic universe';
echo 'deb-src http://mirrors.sohu.com/ubuntu/ karmic universe';
echo 'deb http://mirrors.sohu.com/ubuntu/ karmic-updates universe';
echo 'deb-src http://mirrors.sohu.com/ubuntu/ karmic-updates universe';
echo 'deb http://mirrors.sohu.com/ubuntu/ karmic multiverse';
echo 'deb-src http://mirrors.sohu.com/ubuntu/ karmic multiverse';
echo 'deb http://mirrors.sohu.com/ubuntu/ karmic-updates multiverse';
echo 'deb-src http://mirrors.sohu.com/ubuntu/ karmic-updates multiverse';
echo '#北京交通大学';
echo 'deb http://mirror.bjtu.edu.cn/ubuntu/ karmic main multiverse restricted universe';
echo 'deb http://mirror.bjtu.edu.cn/ubuntu/ karmic-backports main multiverse restricted universe';
echo 'deb http://mirror.bjtu.edu.cn/ubuntu/ karmic-proposed main multiverse restricted universe';
echo 'deb http://mirror.bjtu.edu.cn/ubuntu/ karmic-security main multiverse restricted universe';
echo 'deb http://mirror.bjtu.edu.cn/ubuntu/ karmic-updates main multiverse restricted universe';
echo 'deb-src http://mirror.bjtu.edu.cn/ubuntu/ karmic main multiverse restricted universe';
echo 'deb-src http://mirror.bjtu.edu.cn/ubuntu/ karmic-backports main multiverse restricted universe';
echo 'deb-src http://mirror.bjtu.edu.cn/ubuntu/ karmic-proposed main multiverse restricted universe';
echo 'deb-src http://mirror.bjtu.edu.cn/ubuntu/ karmic-security main multiverse restricted universe';
echo 'deb-src http://mirror.bjtu.edu.cn/ubuntu/ karmic-updates main multiverse restricted universe';
echo '#电子科技大学';
echo 'deb http://ubuntu.uestc.edu.cn/ubuntu/ karmic main restricted universe multiverse';
echo 'deb http://ubuntu.uestc.edu.cn/ubuntu/ karmic-backports main restricted universe multiverse';
echo 'deb http://ubuntu.uestc.edu.cn/ubuntu/ karmic-proposed main restricted universe multiverse';
echo 'deb http://ubuntu.uestc.edu.cn/ubuntu/ karmic-security main restricted universe multiverse';
echo 'deb http://ubuntu.uestc.edu.cn/ubuntu/ karmic-updates main restricted universe multiverse';
echo 'deb-src http://ubuntu.uestc.edu.cn/ubuntu/ karmic main restricted universe multiverse';
echo 'deb-src http://ubuntu.uestc.edu.cn/ubuntu/ karmic-backports main restricted universe multiverse';
echo 'deb-src http://ubuntu.uestc.edu.cn/ubuntu/ karmic-proposed main restricted universe multiverse';
echo 'deb-src http://ubuntu.uestc.edu.cn/ubuntu/ karmic-security main restricted universe multiverse';
echo 'deb-src http://ubuntu.uestc.edu.cn/ubuntu/ karmic-updates main restricted universe multiverse';
echo '#官方源';
echo 'deb http://archive.ubuntu.com/ubuntu/ karmic main restricted universe multiverse';
echo 'deb http://archive.ubuntu.com/ubuntu/ karmic-security main restricted universe multiverse';
echo 'deb http://archive.ubuntu.com/ubuntu/ karmic-updates main restricted universe multiverse';
echo 'deb http://archive.ubuntu.com/ubuntu/ karmic-proposed main restricted universe multiverse';
echo 'deb http://archive.ubuntu.com/ubuntu/ karmic-backports main restricted universe multiverse';
echo '.'; echo 'wq') | sudo ed -s /etc/apt/sources.list
# update
sudo apt-get update
# upgrade
sudo apt-get upgrade
# install rar
sudo apt-get install rar unrar --force-yes -y
# install jdk
sudo apt-get install sun-java6-jdk --force-yes -y
# install ftp server
sudo apt-get install vsftpd --force-yes -y
(echo '$a';
echo '###Enable anonymous read';
echo 'anonymous_enable=YES';
echo 'anon_root=/';
echo 'anon_world_readable_only=YES';
echo 'anon_mkdir_write_enable=YES';
echo 'anon_upload_enable=YES';
echo '###Enable local user read and write';
echo 'local_enable=YES';
echo 'write_enable=YES';
echo '.'; echo 'wq') | sudo ed -s /etc/vsftpd.conf
/etc/init.d/vsftpd restart