debian lenny 5.0 源 & 网络配置 & c++开发环境配置
   
  在终端执行命令
  
  备份当前的源列表,以便日后需要时恢复:
  
  sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
  编辑源列表
  
  Ubuntu 和debian 中执行:
   gedit /etc/apt/sources.list
  
  Kubuntu 中执行:
  kdesu kate /etc/apt/sources.list
  
  Xubuntu 中执行:
  gksu mousepad /etc/apt/sources.list
  
  适用于所有版本:
  sudo vim /etc/apt/sources.list
  从以下各服务器列表内容中选择一段替换文件中的所有内容,一般来说加入一至两组即可,加多了影响更新速度。为防止非官方源中软件包不全的问题,请在sources.list文件中尾部添加一组官方源。
  # deb file:/cdrom/ etch main contrib
  
  #deb http://mirrors.cn99.com/debian/ lenny main non-free contrib
  #deb-src http://mirrors.cn99.com/debian/ lenny main non-free contrib 
  deb http://mirrors.163.com/debian stable contrib main non-free
  deb-src http://mirrors.163.com/debian stable contrib main non-free 
  deb http://mirror.dlut.edu.cn/debian/ lenny main non-free contrib
  deb-src http://mirror.dlut.edu.cn/debian/ lenny main non-free contrib 
  deb http://debian.ustc.edu.cn/debian/ lenny main non-free contrib
  deb-src http://debian.ustc.edu.cn/debian/ lenny main non-free contrib
  
  deb http://ftp.tw.debian.org/debian lenny main 
  
  deb-src http://ftp.tw.debian.org/debian lenny main
  
  以上是目前debian lenny 速度稳定的源
  
  
  IP Address (/etc/network/interfaces)
   # This file describes the network interfaces available on your system
  # and how to activate them. For more information, see interfaces(5).
  
  # The loopback network interface
  auto lo
  iface lo inet loopback
  
  # The primary network interface
  allow-hotplug eth0
  iface eth0 inet static
  address 192.168.18.4
  netmask 255.255.255.0
  gateway 192.168.18.1
  DNS (/etc/resolve.conf)
   domain localdomain
  search localdomain
  nameserver 192.168.18.1 
  修改好后可能需要执行:
  #/etc/init.d/networking restart
  甚至是重启。
   
  
  /etc/sudoers
  
  chmod +w /etc/sudoers
  vim /etc/sudoers
  添加一行 username ALL=(ALL) ALL
  其中username是你的用户名,更改sudoers文件权限 chmod 0440 /etc/sudoers
  
  
   
  
  c++开发环境配置
  
  1: debian lenny 5.0 选择文字安装界面, 安装到最后阶段时, 选择桌面环境和文件服务器项, 会将samba, NFS和gnome安装好
  2: 编程工具 
  apt-get install build-essential 安装gcc g++ libc-dev make
  apt-get install autoconf
  apt-get install automake
   
  
  3: 其他工具
  apt-get install tcpdump
   apt-get install unzip 
   apt-get install tree 
  apt-get install tofrodos 安装dos2unix
   apt-get install manpages manpages-dev 函数man手册
  4: gtk+开发库
  libgtk2.0-dev libdbus-1-dev libdbus-glib-1-dev libgconf2-dev
   
  
  
  完整的开发环境配置(转载)
  
  小郭安装Ubuntu系统时记下了环境的配置,我针对Debian对该记录进行修改后验证通过
   
  1.安装系统
  别的没什么说的,就是安的时候把网线拔了,不然到configure apt的时候会卡起很久不走的
   
  2.配置网络
  编辑/etc/network/interface
  auto eth0
  iface inet eth0 static #设置静态IP地址
  address 192.168.1.235
  netmask 255.255.255.0
  network 192.168.1.0
  broadcast 192.168.1.255
  gateway 192.168.1.1
  如果是要设置为自动获取ip地址就应该为
  auto eth0
  iface eth0 inet dhcp
  保存,退出,重启网络
  $/etc/init.d/networking restart
  此时已经可以ping通局域网地址,但外网仍不行
  Debian和Ubuntu一样,设置nameserver是在/etc/resolv.conf 里面,在其中添加一行:
  nameserver 192.168.1.1
   
  3.配置apt源
  vim /etc/apt/sourcelist
  然后进行更新源
  apt-get -s upgrade
  apt-get update
   
  4.安装常用软件
  apt-get install openssh-server,openssh-client
  apt-get install lrzsz
  apt-get install tcpdump
  apt-get install unzip 
  apt-get install tree 
  apt-get install valgrind
  apt-get install more
  apt-get install openssl ca-certificates openssl-doc
  apt-get install mysqlserver,mysqlclient
   
  5.配置vim + ctags + taglist 
  apt-get install vim
  apt-get install ctags
  在vim的主网站下载插件taglist
  http://www.vim.org/scripts/script.php?script_id=273
  然后上传进行解压
  unzip taglist.zip -d ~/.vim解开;
  :helptags ~/.vim/doc安装文档。 
  如果要配置的更详细,这个不错
  http://blog.csdn.net/wooin/archive/2007/10/31/1858917.aspx
   
  6.安装gcc
  apt-get install gcc
  apt-get install g++
  apt-get install gdb
  apt-get install make
  apt-get install autoconf
  apt-get install automake
  apt-get install libboost-dev
  apt-get install libboost-doc
  apt-get install libxml2
  apt-get install libmysqlclient15-dev
  apt-get install manpages-dev
  apt-get install glibc-doc
   
  7.安装Python
  我使用的是Debian4.0的r4版本,默认安装的是2.4的Python,需要更新
  apt-get install python2.5 
  apt-get install python-docutils 
  apt-get install python2.5-dbg 
  apt-get install python2.5-dev 
  apt-get install python2.5-examples
  
  8.安装twisted
  apt-get install python-twisted-bin
  apt-get install python-twisted-runner
  安装完后,进入Python交互环境中,输入
  >>>import twisted.internet
  结果报告说无法载入该模块,我晕死。小郭在安装的时候是是先安装Zope interface,
  下载地址http://zope.org/Products/ZopeInterface,下载zope.interface-3.3.0.tar.gz
  安装:
  $python setup.py build
  $python setup.py install
  没有安装成功,因为需要python2.4 ,而当时他的Ubuntu的Python是2.5。
  直接安装twisted也出错,因为没有找到Python.h文件,所以他重新下了Python2.5进行源码安装
  我从他那里拷贝来Twisted-8.1.0.tar.bz2(tar -jxvf)解压后安装

 

转载自:http://blog.tianya.cn/blogger/post_show.asp?BlogID=2739323&PostID=22580638