现在的位置: 首页 > 综合 > 正文

ubuntu server 12.04 安装后相关设置

2013年10月19日 ⁄ 综合 ⁄ 共 871字 ⁄ 字号 评论关闭

1,设置root用户密码

sudo passwd root

2,设置sudo命令不需输入密码

    运行visudo命令,添加如下内容,保存退出

username ALL=(ALL:ALL) NOPASSWD:ALL

3,修改ip地址和dns

    修改/etc/network/interfaces文件,添加或修改eth0的部分为如下内容,其中各ip地址根据实际情况修改下。

auto eth0
#iface eth0 inet dhcp  //注释掉这一行
iface eth0 inet static   //指定为static
address 192.168.1.103   //IP地址
gateway 192.168.1.1   //网关
netmask 255.255.255.0   //子网掩码

    修改/ect/resolv.conf文件,添加如下内容,dns地址修改为实际的地址

nameserver 8.8.8.8
nameserver 8.8.4.4

4,挂载光驱

sudo /dev/cdrom /media/cdrom

5,apt代理设置

    修改/etc/apt/apt.conf文件,添加如下内容:

Acquire::http::Proxy "http://10.1.27.102:8080";

6, GPG KEY错误解决

W: GPG error: http://ppa.launchpad.net jaunty Release: The following signatures couldn't be verified because
the public key is not available: NO_PUBKEY 12DE1BCB04E5E17B5

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 12DE1BCB04E5E17B5

7,手动添加最新git源

deb http://ppa.launchpad.net/git-core/ppa/ubuntu precise main 
deb-src http://ppa.launchpad.net/git-core/ppa/ubuntu precise main

抱歉!评论已关闭.