在終端執行命令
備份當前的源列表,以便日后需要時恢復:
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
編輯源列表
Ubuntu 和debian 中執行:
gedit /etc/apt/sources.list
Kubuntu 中執行:
kdesu kate /etc/apt/sources.list
Xubuntu 中執行:
gksu mousepad /etc/apt/sources.list
適用于所有版本:
sudo vim /etc/apt/sources.list
從以下各服務器列表內容中選擇一段替換文件中的所有內容,一般來說加入一至兩組即可,加多了影響更新速度。為防止非官方源中軟件包不全的問題,請在sources.list文件中尾部添加一組官方源。
# deb file:/cdrom/ etch main contrib
#deb http://mirrors.cn99.com/debian/ lenny main non-free contrib
#deb-src http://mirrors.cn99.com/debian/ lenny main non-free contrib
deb http://mirrors.163.com/debian stable contrib main non-free
deb-src http://mirrors.163.com/debian stable contrib main non-free
deb http://mirror.dlut.edu.cn/debian/ lenny main non-free contrib
deb-src http://mirror.dlut.edu.cn/debian/ lenny main non-free contrib
deb http://debian.ustc.edu.cn/debian/ lenny main non-free contrib
deb-src http://debian.ustc.edu.cn/debian/ lenny main non-free contrib
deb http:
deb-src http:
IP Address (/etc/network/interfaces)
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.18.4
netmask 255.255.255.0
gateway 192.168.18.1
DNS (/etc/resolve.conf)
domain localdomain
search localdomain
nameserver 192.168.18.1
修改好后可能需要執行:
#/etc/init.d/networking restart
甚至是重啟。
/etc/sudoers
chmod +w /etc/sudoers
vim /etc/sudoers
添加一行 username ALL=(ALL) ALL
其中username是你的用戶名,更改sudoers文件權限 chmod 0440 /etc/sudoers
c++開發環境配置
1: debian lenny 5.0 選擇文字安裝界面, 安裝到最后階段時, 選擇桌面環境和文件服務器項, 會將samba, NFS和gnome安裝好
2: 編程工具
apt-get install build-essential 安裝gcc g++ libc-dev make
apt-get install autoconf
apt-get install automake
3: 其他工具
apt-get install tcpdump
apt-get install unzip
apt-get install tree
apt-get install tofrodos 安裝dos2unix
apt-get install manpages manpages-dev 函數man手冊
4: gtk+開發庫
libgtk2.0-dev libdbus-1-dev libdbus-glib-1-dev libgconf2-dev
完整的開發環境配置(轉載)
小郭安裝Ubuntu系統時記下了環境的配置,我針對Debian對該記錄進行修改后驗證通過
1.安裝系統
別的沒什么說的,就是安的時候把網線拔了,不然到configure apt的時候會卡起很久不走的
2.配置網絡
編輯/etc/network/interface
auto eth0
iface inet eth0 static #設置靜態IP地址
address 192.168.1.235
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
如果是要設置為自動獲取ip地址就應該為
auto eth0
iface eth0 inet dhcp
保存,退出,重啟網絡
$/etc/init.d/networking restart
此時已經可以ping通局域網地址,但外網仍不行
Debian和Ubuntu一樣,設置nameserver是在/etc/resolv.conf 里面,在其中添加一行:
nameserver 192.168.1.1
3.配置apt源
vim /etc/apt/sourcelist
然后進行更新源
apt-get -s upgrade
apt-get update
4.安裝常用軟件
apt-get install openssh-server,openssh-client
apt-get install lrzsz
apt-get install tcpdump
apt-get install unzip
apt-get install tree
apt-get install valgrind
apt-get install more
apt-get install openssl ca-certificates openssl-doc
apt-get install mysqlserver,mysqlclient
6.安裝gcc
apt-get install gcc
apt-get install g++
apt-get install gdb
apt-get install make
apt-get install autoconf
apt-get install automake
apt-get install libboost-dev
apt-get install libboost-doc
apt-get install libxml2
apt-get install libmysqlclient15-dev
apt-get install manpages-dev
apt-get install glibc-doc
7.安裝Python
我使用的是Debian4.0的r4版本,默認安裝的是2.4的Python,需要更新
apt-get install python2.5
apt-get install python-docutils
apt-get install python2.5-dbg
apt-get install python2.5-dev
apt-get install python2.5-examples
8.安裝twisted
apt-get install python-twisted-bin
apt-get install python-twisted-runner
安裝完后,進入Python交互環境中,輸入
>>>import twisted.internet
結果報告說無法載入該模塊,我暈死。小郭在安裝的時候是是先安裝Zope interface,
下載地址http://zope.org/Products/ZopeInterface,下載zope.interface-3.3.0.tar.gz
安裝:
$python setup.py build
$python setup.py install
沒有安裝成功,因為需要python2.4 ,而當時他的Ubuntu的Python是2.5。
直接安裝twisted也出錯,因為沒有找到Python.h文件,所以他重新下了Python2.5進行源碼安裝
我從他那里拷貝來Twisted-8.1.0.tar.bz2(tar -jxvf)解壓后安裝
>>>import twisted.python
posted on 2009-06-10 16:38
聶文龍 閱讀(1198)
評論(0) 編輯 收藏 引用