您的位置:首页 > 其它

Debian 完整开发平台搭建说明

2013-04-21 13:44 190 查看
作者:java211

转自:/article/7857656.html

本说明整理适用于Debian 5.0 系统,资料来自互联网

从Debian的官方网站下载(网络安装版的ISO镜像):

debian-500 -i386-netinst.iso

设置网络环境

// 设置DNS,直接编辑/etc/resolv.conf 可以同时设置多个DNS

nameserver 202.103 .96.68

nameserver 202.103 .96.112

// 设置IP,直接编辑/etc/network/interfaces

auto lo eth0

iface lo inet loopback

// 采用固定IP:

iface eth0 inet static

address 192.168 .0.10

netmask 255.255 .255.0

broadcast 192.168 .0.255

gateway 192.168 .0.1

// 采用DHCP:

auto eth0

iface eth0 inet dhcp

// 激活和终止网络接口

ifdown eth0

ifup eth0

// 上面的设定只有重启网络后才会生效:

/etc/init.d/networking restart

Debian 更新工具

apt-get update // 更新源列表

apt-cache search xxx // 在源中搜索xxx软件

apt-get install xxx // 从源中安装xxx软件

apt-get download xxx // 从源中下载xxx debian deb包

apt-get source xxx // 从源中下载xxx的源码包

apt-get remove xxx // 删除包

// 清除:当使用 apt-get install 指令安装套件,下载下来的 deb 会放置于

// /var/cache/apt/archives, 使用 apt-get clean 指令可以将之清除.

apt-get clean

//设定更新源 ,在/etc/apt/sources.list中添加更新源:

deb http://debian.cn99.com/debian/ stable main non-free contrib

deb http://debian.cn99.com/debian-non-US/ stable/non-US main contrib non-free

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

// 从源获得最新软件列表:

# apt-get update

# apt-get install apt-spy // 安装 apt-spy

# mv sources.list sources.list.bak // 备份老大源列表

#man apt-spy // 获取详细的使用方法

// 更新您的镜像列表文件 /var/lib/apt-spy/mirrors.txt

# apt-spy update

// 在亚洲寻找速度最快的stable版镜像, 并生成sources.list文件

# apt-spy -d stable -a Asia

# cp /etc/apt/sources.list.d/apt-spy.list /etc/apt/sources.list

// 更新源:

# apt-get update

安装Telnet,SSH

// 安装telnet:

# apt-get install telnetd

# /etc/init.d/openbsd-inetd start

// 安装 openssh server:

# apt-get install openssh-server

# /etc/init.d/ssh restart

安装vsftpd

# apt-get install vsftpd

// 编辑/etc/vsftpd.conf

激活

local_enable=YES

write_enable=YES

// 启动 vsftpd

/etc/init.d/vsftpd restart

安装编辑工具vim:

# apt-get install vim-full

// 编辑/etc/vim/vimrc文件

打开syntax on、set nu

安装编译,工程构建,调试工具

/*

* 说明:

* build-essential: 基本编译环境 (gcc, g++, libc, make等)

* autoconf: 自动配置工具

* automake: make相关

* gdb: 调试工具

*/

apt-get install build-essential

apt-get install autoconf

apt-get install automake

apt-get install gdb

安装开发文档:

/*

* 说明:

* manpages-dev: C/C++man帮助手册

* Binutils: 链接器(ld)、汇编器(as)、反汇编器(objdump)和档案的工具(ar)

* glibc-doc: GUN C标准库文档

* stl-manual: 标准C++ STL模板文档

*/

apt-get install manpages-dev

apt-get install binutils-doc

apt-get install cpp-doc

apt-get install gcc-doc

apt-get install glibc-doc

apt-get install libstdc++6 -4.3 -doc

apt-get install stl-manual

在VMware中增加新硬盘:

关闭VM中正在运行的虚拟系统

在虚拟机系统名称上点击右键-> Vitual Machine Settings

在虚拟机edit页新增一个磁盘。

可以看见Hardware中出现了一块新的硬盘HardDisk2.

启动虚拟机,进入/dev目录下ls,查看刚加的硬盘名称。如: /dev/sdb

对/dev/sdb进行分区:fdisk /dev/sdb

Command (m for help): m Help info

Command (m for help): n Add a new partition

Command (m for help): w Write table to disk and exit

格式化硬盘为ext3分区格式:mke2fs -j /dev/sdb1

检查新分区是否存在:fdisk -l

修改/etc/fstab,使得刚新建的分区可以开机自动挂载。

# <file system> <mount point> <type> <options> <dump> <pass>

/dev/sdb1 /oracle ext3 errors=remount-ro 0 1

重新启动,查看结果:df -h

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/liuchangyu23/archive/2009/09/02/4511102.aspx
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: