Debian/Linux学习笔记 - 安装、网络、图形、中文

来源:互联网 发布:网络视频会议摄像头 编辑:程序博客网 时间:2024/05/17 00:16
Modified 2007/03/14, by berlin
 
说明
1. 这是份不完整的debian/linux学习笔记,目的是为健忘的笔者保留一份记录,所有的配置都以命令行操作为纲。
2. 涉及的工具、命令、术语不作注解,完整的Debian/Linux安装与使用参见肥肥世家Debian/Linux学习笔记

软件及网络环境
系统:Debian/Linux
内核:Linux 2.6.8
网络:SWUST实验室网络

网络设置
根据上网方式不同,有两种常见的网络配置方式
第一种:用ISP提供的用户名/密码上网,SWUST寝室上网方式
root@debian# pppoeconf             # 根据提示,输入ISP提供的用户名/密码
root@debian# pon dsl-provider     # 连接网络
root@debian# poff               # 断开网络
 
第二种:设置DNS、route、ifconfig,以下配置根据实际网络不同,ip地址应有所不同,以下是以SWUST实验室网络配置为例:
root@debian# vi /etc/resolv.conf
nameserver 202.115.160.33      #首选DNS服务器
nameserver 202.98.96.68        #备用DNS服务器
root@debian# route -n           # 显示当前的路由配置
root@debian# route del default     # 删除默认路由
root@debian# route add default gw 202.115.35.1     # 增加新的默认路由
root@debian# ifconfig eth0 222.196.35.121       # ipv4设置
root@debian# nslookup baidu.com          #检查配置是否运行正常,若正常,显示DNS ip及域名对应ip
 
以上网络配置在系统重启后就还原为默认配置,通过修改相应配置文件可保存网络设置:
root@debian# vi /etc/resovle.conf
nameserver 202.115.160.33  #首选DNS服务器
nameserver 202.98.96.68   #备用DNS服务器
root@debian# vi .bash_profile
route add default gw 222.196.35.1
root@debian# vi /etc/network/interfaces
auto eth0
iface eht0 inet static
       address        222.196.35.121
       netmask       255.255.255.128
       network        222.196.35.0
       broadcast      222.196.35.255
       gateway        222.196.35.1
root@debian# nslookup baidu.com   #检查配置是否运行正常,若正常,显示DNS ip及域名对应ip
 
[注意]:笔者配置时出现过一个问题,无论如何修改/etc/resovle.conf文件,几秒后总被改写为原有配置,经查明,是/etc/init.d/dns-clean 这个守护进程作怪,通过如下操作可解决:
root@debian# mv dns-clean dns-clean.old     # .old 是被推荐的一种更名方式
 
更新系统
配置完网络后,更新/etc/apt/source.list,笔者使用的是geekbone的Deb源
root@debian# vi /etc/apt/source.list
deb ftp://mirrors.geekbone.org/debian stable main non-free contrib            # 添加这行,保存并退出
root@debian# apt-get update
root@debian# apt-get dist-upgrade
 
[注意] deb source的常见选择有stable、testing、unstable,表软件的不同状态,笔者在加入如下两行:
root@debian# vi /etc/apt/source.list
deb ftp://mirrors.geekbone.org/debian testing main non-free contrib
deb ftp://mirrors.geekbone.org/debian unstable main non-free contrib
后出现不同的问题,第一行是apt-get update 操作命令获取debian srouce 出错;第二行导致需要内核重编译,最后导致整个系统处于不稳定状态,问题尚未解决,请慎重使用。

安装图形界面

root@debian# apt-get install x-window-system-core
root@debian# apt-get install xserver-xfree86
root@debian# apt-get install kde
 
中文方案
root@debian# apt-get install ttf-arphic-uming
root@debian# dpkg-reconfigure locales                             # 选择几种常用中文编码: GBK/GB2312/Unicode, etc.
root@debian# vi .bashrc
LANG=zh_CN.GBK
root@debian# mount -t vfat -o codepage=936,iocharset=cp936 /dev/hda6 /cdrom #显示中文目录
 
原创粉丝点击