---
title: "ubuntu 安装后的一些优化"
author: "cissco"
date: "2008-12-05T18:33:35Z"
tags: ["Eclipse", "Linux", "Netbeans", "Ubuntu", "多线程"]
categories: ["操作系统"]
slug: "ubuntu"
draft: false
lastmod: "2008-12-05T22:43:43Z"
id: 287912
url: "https://cissco.iteye.com/blog/287912"
---

一、更新源

1、设置root用户密码     

```
[cissco@ubuntu ~] $ sudo passwd root
Enter new UNIX password:输入密码
Retype new UNIX password:重新输入密码
```

 2、用文本编辑器打开/etc/apt/source.list文件

```
cissco@cissco:$ sudo su root
root@cissco:~# gedit /etc/apt/source.list &
```

 3、添加源，本人是添加的江苏常州的服务器

```
deb http://ubuntu.cn99.com/ubuntu/ hardy main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ hardy-security main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ hardy-updates main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ hardy-proposed main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ hardy-backports main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ hardy main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ hardy-security main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ hardy-updates main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ hardy-proposed main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ hardy-backports main restricted universe multiverse
```

 

4、更新系统源，在终端下输入以下内容

```
root@cissco:~# apt-get update
```

 

二、ubuntu root用户中文设置 

1、先在语言支持里选中安装中文支持

2、在root目录下有个隐藏的.profile文件，按ctrl + h显示，用文本编辑器打开，找到以下内容：

```
LANG=C
LANGUAGE=C
```

   用#符号把上面代码注释掉，然后在后面添加下面代码：

```
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN:zh"
```

3、重起系统，root用户就可以显示中文了，然后输入法托盘也显示了，哈哈，就这么简单!!

 

如果你想用超级用户root，而系统是显示英文，又要让输入法托盘显示，下面我来教您怎么做

1、先在语言支持里选中安装中文支持

2、在/etc/目录下有一个enviroment文件，用文本编辑器打开，在最后面添加以下内容：

```
LANGUAGE="en_US:en"
LC_CTYPE=zh_CN.UTF-8
LANG=en_GB.UTF-8
GST_ID3_TAG_ENCODING=GBK
```

 3、重起系统，rooot用户还是照样显示英文，且输入法托盘也显示了，可以切换输入法了，哈哈，简单吧!!赶紧试试啊~

 

三、C++编程环境搭建

1、安装gcc g++ make C/C++库

```
root@cissco:~# apt-get install build-essential
```

2、安装netbeans6.5 C++，netbeans还支持多线程调试

　　到  [http://java.sun.com](http://java.sun.com)　上下载个带jdk的netbeans6.5     

```
root@cissco:~# ckmod  755 /usr/src/netbeans/netbeans-6.5-ml-linux.sh
root@cissco:~# ./netbeans-6.5-ml-linux.sh
```

3、安装eclipse C++，我用的eclipse3.4不支持多线程调试

    到 [http://www.eclipse.org](http://www.eclipse.org) 上下载eclipse，eclipse先要有jdk的支持，所以您先要安装好jdk

    然后解压，就可以双击eclipse文件，可以运行了

4、安装code::blocks，code::blocks支持多线程调试，不过一个缺点就是他的提示有时有，有时就没有

    先留着，明天再继续完善