安装后许多软件都没有,需要进行安装。
官方指南:https://help.ubuntu.com/lts/serverguide/index.html
1.修改网络配置文件
用ifconfig查看本地网卡,获得网卡名称 p2p1,如果只有lo,则执行 dmesg | grep eth。
修改/etc/network/interfaces文件,这个配置更新过,加入了dns的配置
sudo vim /etc/network/interfaces
iface eth0 inet static
address 192.168.3.3
netmask 255.255.255.0
gateway 192.168.3.1
#dns-search example.com
dns-nameservers 223.5.5.5 223.6.6.6
文件内容(其中p2p1是通过ifconfig获得的网卡名称,或者是通过第四步获得的网卡名称)
2.配置DNS
Ubuntu 14.04 重启后DNS配置被重写,所以不能直接修改/etc/resolv.conf。
有两种方法:
sudo vim /etc/resolvconf/resolv.conf.d/base
nameserver 223.5.5.5
nameserver 223.6.6.6
sudo vim /etc/network/interfaces
dns-nameservers 8.8.8.8
修改好保存,然后执行
resolvconf -u
3.修改主机名
sudo vim /etc/hostname
以上修改完后需要重启系统
sudo reboot
4.更新source.list.
编辑完源source.list后,一定要update:
sudo apt-get update
一些APT命令 修改apt源,即添加APT服务器地址
/etc/apt/sources.list
#apt-get update 使修改生效
检索软件信息
#apt-cache pkgnames 显示所有可以安装的软件
#apt-cache pkgnames | grep g++
#apt-cache policy 软件名称 查看该软件是否安装 安装
#apt-get install 名称
重新安装
#apt-get install --reinstall 名称
卸载
#apt-get remove 名称
清理
#apt-get clean 清楚deb包 获取源码包
#apt-get source 名称 下载并在当前目录下解压
构建编译环境
#apt-get build-dep 名称 安装关联的软件包
编译源码包
#dpkg-buildpackage 生成可执行文件和deb
安装
#dpkg –I *.deb
5.安装openssh
由于我们只是需要服务端,所以只要安装服务端即可。
安装openssh
#sudo apt-get install openssh-server
检查结果
#ps –ef | grep ssh
若未找到, #/etc/init.d/ssh restart
使用SecureCRT连接
更多的关于openssh的内容见:http://os.51cto.com/art/201104/256070.htm
6.安装man
由于ubuntu server 默认没有man,所以需要手动安装。
sudo apt-get install man
我们还要安装一些man的文档:
sudo apt-get install manpages
sudo apt-get install manpages-dev // C API
sudo apt-get install manpages-posix // posix function
sudo apt-get install manpages-posix-dev // posix develop documents
sudo apt-get install glibc-doc // C API
sudo apt-get install stl-manual // STL
sudo apt-get install libstdc++6-4.7-doc // C++ API,建议先安这个试,再试4.1,版本还有4.3等等
sudo apt-get install manpages-zh // 中文文档
7.安装vim
sudo apt-get install vim
8.安装编译环境
sudo apt-get install build-essential
9.安装GDB
由于build-essential中没有包含gdb,要独立安装
sudo apt-get install gdb
10.安装valgrind
sudo apt-get install valgrind
11.安装压缩工具zip
sudo apt-get install zip
或
sudo apt-get install bzip2
12.windows和linux互传文件
- 通过Samba:
参考这三篇文章:
- http://www.cnblogs.com/bohaoist/p/4813676.html
- https://help.ubuntu.com/lts/serverguide/samba-introduction.html
- http://www.cnblogs.com/phinecos/archive/2009/06/06/1497717.html
- 通过lrzsz:
#sudo apt-get install lrzsz
#rz 向Linux服务发送文件
#sz 文件名 Linux服务器向客户端发送文件
13.安装git
参考:https://help.ubuntu.com/lts/serverguide/git.html
安装:
sudo apt-get install git 配置
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
14.安装curl
sudo apt-get install curl
15.安装vim插件(可以百度一下)
懒人必备spf13-vim:https://github.com/spf13/spf13-vim
http://www.wklken.me/posts/2013/06/11/linux-my-vim.html
SHELL配置:https://github.com/robbyrussell/oh-my-zsh
参考这篇文章:
需要安装的插件
- exuberant-ctags (使用apt)
- cscope (使用apt)
- taglist
- omnicppcomplete
- a
- winmanager
- minibufExplorer
- grep
安装说明
Ctags,cscope使用apt安装
其他的需要下载,解压到~/.vim即可
分析.vimrc文件(示例)
16.Ubuntu Desktop常用软件
- http://www.cnblogs.com/bohaoist/p/4967050.html