本文转载自:http://blog.csdn.net/zjhsucceed_329/article/details/8036781
版权声明:本文为博主原创文章,未经博主允许不得转载。
ubuntu-10.10嵌入式开发环境搭建
1、先安装ubuntu-10.10
2、想使用root用户登陆的,操作如下
给root用户设定一个密码
zjh@zjh:~# sudo passwd root
3、配置apt源(163的源要快些)
root@zjh:~# gedit /etc/apt/sources.list
将sources.list文件的内容替换为
deb http://mirror.lupaworld.com/ubuntu/ maverick main restricted
deb-src http://mirror.lupaworld.com/ubuntu/ maverick main restricted
deb http://mirror.lupaworld.com/ubuntu/ maverick-updates main restricted
deb-src http://mirror.lupaworld.com/ubuntu/ maverick-updates main restricted
deb http://mirror.lupaworld.com/ubuntu/ maverick universe
deb-src http://mirror.lupaworld.com/ubuntu/ maverick universe
deb http://mirror.lupaworld.com/ubuntu/ maverick-updates universe
deb-src http://mirror.lupaworld.com/ubuntu/ maverick-updates universe
deb http://mirror.lupaworld.com/ubuntu/ maverick multiverse
deb-src http://mirror.lupaworld.com/ubuntu/ maverick multiverse
deb http://mirror.lupaworld.com/ubuntu/ maverick-updates multiverse
deb-src http://mirror.lupaworld.com/ubuntu/ maverick-updates multiverse
deb http://extras.ubuntu.com/ubuntu maverick main
deb-src http://extras.ubuntu.com/ubuntu maverick main
deb http://mirror.lupaworld.com/ubuntu/ maverick-security main restricted
deb-src http://mirror.lupaworld.com/ubuntu/ maverick-security main restricted
deb http://mirror.lupaworld.com/ubuntu/ maverick-security universe
deb-src http://mirror.lupaworld.com/ubuntu/ maverick-security universe
deb http://mirror.lupaworld.com/ubuntu/ maverick-security multiverse
deb-src http://mirror.lupaworld.com/ubuntu/ maverick-security multiverse
更新源
root@zjh:~# apt-get update
4、更新系统(包括更新内核)
root@zjh:~# apt-get dist-upgrade
root@zjh:~# apt-get autoremove
5、解决root用户登陆没声音的问题
System->Preferences -> Startup Applications
单击Add,填写如下
6、使用中文输入法
System->Preferences->Keyboard Input Methods
Input Method->Chinese->拼pinyin,Add
默认情况下,ubuntu-10.10不会开机自启动ibus,解决如下
System ->Preferences->Startup Applications
Click the button: Add
Name: ibus daemon
Command: /usr/bin/ibus-daemon -d
Comment: start ibus daemon when gnome start
7、安装VMware Tools
VM->Install VMware Tools
root@zjh:~# cp /media/VMware Tools/VMwareTools-8.8.4-743747.tar.gz .
root@zjh:~# tar -zxvf VMwareTools-8.8.4-743747.tar.gz
root@zjh:~# cd vmware-tools-distrib/
root@zjh:~/vmware-tools-distrib# ./vmware-install.pl
接下来一路yes和回车直到安装完毕。
删除无用的文件
root@zjh:~# rm -rf VMwareTools-8.8.4-743747.tar.gz vmware-tools-distrib/
重启系统
8、设置windows与ubuntu共享目录
Vmware Workstation菜单vm->settings
Options->shared folderss
Always enabled
Add->next
Browse选择你要共享的windows目录
Next->finsh
Ubuntu的/mnt/hgfs/目录就会出现windows共享的目录(若不成功重装VMTools)
9、安装vim
root@zjh:~# apt-get install vim
修改vim配置文件
root@zjh:~# vi /etc/vim/vimrc
在最后添加
set nu "显示行号"
set tabstop=4 "制表符宽度"
set cindent "C/C++语言的自动缩进方式"
set shiftwidth=4 "C/C++语言的自动缩进宽度"
此后输入vi就等于是输入vim
10、安装命令tree (list contents of directories in a tree-like format.)
root@zjh:~# apt-get install tree
11、安装命令chkconfig (enable or disable system services)
root@zjh:~# apt-get install chkconfig
查看系统服务
root@zjh:~# chkconfig --list
acpi-support 0:off 1:off 2:on 3:on 4:on 5:on 6:off
acpid 0:off 1:off 2:off 3:off 4:off 5:off 6:off
alsa-mixer-save 0:off 1:off 2:off 3:off 4:off 5:off 6:off
anacron 0:off 1:off 2:off 3:off 4:off 5:off 6:off
on表示在对应的启动级别开机自启动
12、安装patch命令
root@zjh:~# apt-get install patch
13、安装curl命令
root@zjh:~# apt-get install curl
14、安装Git
root@zjh:~# apt-get install git
15、安装tftp
root@zjh:~# apt-get install tftp-hpa tftpd-hpa xinetd
(tftpd为服务器端)
修改配置文件
root@zjh:~# vi /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/home/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="-l -c -s"
TFTP_DIRECTORY指定tftp-server的根目录,参数-c指定了可以创建文件
设置/home/tftpboot的权限
root@zjh:~# chmod 777 /home/tftpboot/
service tftpd-hpa start 启动tftp服务
16、安装nfs
root@zjh:~# apt-get install nfs-kernel-server
修改配置文件
root@zjh:~# vi /etc/exports
/home *(rw,sync,no_root_squash)
rw:allow both read and write requests on this NFS volume. The default is to disallow any request which changes the filesystem. This can also be made explicit by using the ro option.
sync:reply to requests only after the changes have been committed to stable storage (see async above).
no_root_squash:turn off root squashing. This option is mainly useful for diskless clients.
17、安装samba
root@zjh:~# apt-get install samba
配置samba
root@zjh:~# vi /etc/samba/smb.conf
在最后添加
[home]
path = /home
browseable = yes
writeable = yes
valid user = root
添加samba用户并设置密码
root@zjh:~# smbpasswd -a root
Windows访问ubuntu的/home
Win键+r打开运行对话框
输入\192.168.80.128,回车
192.168.80.128为ubuntu的IP地址,然后输入用户名和密码
18、使用SecureCRT通过ssh登陆ubuntu
首先在ubuntu上安装ssh
root@zjh:~# apt-get install openssh-server
安装完毕后,ssh已配置为开机自启动
重启ubuntu,就能使用SecureCRT通过ssh登陆ubuntu了。
打开SecureCRT,选择Quick Connect,Hostname输入ubuntu的IP地址,Username 输入root,点击connect,等一下提示输入密码,输入密码点击OK
19、安装g++开发C++
root@zjh:/home/workspace# apt-get install g++
20、安装eclipse开发Java和C/C++
所需包及下载地址
eclipse-java-helios-SR2-linux-gtk.tar.gz
cdt-master-7.0.2.zip (用于开发C/C++的插件)
1)、安装jdk
解压jdk包
root@zjh:/mnt/hgfs/F/software/jdk# tar -zxvf jdk-7u5-Linux-i586.tar.gz -C /opt/
配置环境变量
root@zjh:/mnt/hgfs/F/software/jdk# vi /etc/profile
在最后添加
export PATH=/opt/jdk1.7.0_05/bin:$PATH
使配置生效
root@zjh:/mnt/hgfs/F/software/jdk# . /etc/profile
查看jdk版本
root@zjh:/mnt/hgfs/F/software/jdk# java -version
java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b06)
Java HotSpot(TM) Client VM (build 23.1-b03, mixed mode)
2)、安装eclipse
解压eclipse包
root@zjh:/home/workspace# tar zxvf eclipse-java-helios-SR2-linux-gtk.tar.gz -C /opt/
创建桌面快捷方式
root@zjh:/home/workspace# ln -s /opt/eclipse/eclipse /root/Desktop/eclipse
重启ubuntu,此时可以用eclipse开发java了。
3)、安装cdt插件
将cdt-master-7.0.2.zip复制到一个空目录,进入该目录
root@zjh:/home/cdt# unzip cdt-master-7.0.2.zip
解压后将看到features plugins两个目录,将这两个目录里的所有内容复制到/opt/eclipse目录下对应的目录里
root@zjh:/home/cdt# cp features/* /opt/eclipse/features/
root@zjh:/home/cdt# cp plugins/* /opt/eclipse/plugins/
此时就可以用eclipse开发C/C++了。
21、解决配置内核make menuconfig出现的问题
'make menuconfig' requires the ncurses libraries
root@zjh:/home/workspace/linux-2.6.35.13# apt-get install libncurses5-dev
22、安装pthread函数手册
root@zjh:~# apt-get install manpages-posix manpages-posix-dev
23、安装wireshark
root@zjh:~# apt-get install wireshark