ubuntu服务系统安装初始化配置

安装完ubuntu后,对系统做如下初始化配置

修改ip地址:

root@s100:~# vim  /etc/network/interfaces 
auto eth0
iface eth0 inet static
address 192.168.182.100
netmask 255.255.255.0
gateway 192.168.182.2
dns-nameservers 192.168.182.2

  修改完ip地址后重启网卡使配置生效

root@s100:~# /etc/init.d/networking restart

  

修改操作系统字符集

root@s100:~# vim /etc/default/locale 
LANG="en_US.UTF-8"
LANGUAGE="en_US:en"

  

修改软件源,这里修改为163的源

root@s100:/etc/apt# cp  sources.list  sources.list.bak 
root@s100:/etc/apt# vim  sources.list
deb http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse

  修改好软件源后要记得更新软件源仓库

root@s100:/etc/apt# apt-get  update
root@s100:/etc/apt# apt-get  upgrade

  有了软件源就可以下载软件包了,比如这里下载一个ssh远程连接的软件包openssh-server

#先在源上搜索是否由需要下载的软件包
root@s100:~# apt-cache search  openssh-server
#源上有需要的软件包后,就可以使用apt-get下载了
root@s100:~# apt-get  install  openssh-server

  

修改主机名

root@s100:~# vim  /etc/hostname 
s100
#重启主机使配置生效

  

上面系统初始化配置完成后就可以让这个主机作为模板机,那么在虚拟机中就可以使用这个模板机来连接克隆需要的主机。

 

posted @ 2018-04-16 11:34  goser  阅读(793)  评论(0编辑  收藏  举报