装了centos后,感觉有好多地方让人不是很适应,我做了6点修改
一,修改下载源
centos默认下载源是163的,我想找个离自己比较近的,这样下载东西来比较快。
- vi /etc/yum.repos.d/CentOS-Base.repo
- [base] //将[base]下的baseurl和mirrorlist注释掉在加上以下内容
- baseurl=http://ftp.sjtu.edu.cn/centos/5.5/os/$basearch/
- [updates] //同base
- baseurl=http://ftp.sjtu.edu.cn/centos/5.5/updates/$basearch/
- [addons]
- baseurl=http://ftp.sjtu.edu.cn/centos/5.5/addons/$basearch/
- [extras]
- baseurl=http://ftp.sjtu.edu.cn/centos/5.5/extras/$basearch/
- [centosplus]
- baseurl=http://ftp.sjtu.edu.cn/centos/5.5/centosplus/$basearch/
- [contrib]
- baseurl=http://ftp.sjtu.edu.cn/centos/5.5/contrib/$basearch/
- rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 //导入key
centos的yum还有一个加速工具yum-fastestmirror
yum install yum-fastestmirror
二,给firefox安装flash插件
当firefox提示没有安装flash时,你可以点下载插件并且安装,自动安装失败后,会要求你手动安装,你将install_flash_player_10_linux.tar.gz下载下来,并解压,tar zxvf install_flash_player_10_linux.tar.gz。
每个用户的根目录下面都有一个.mozilla隐藏文件夹,将flash插件copy到plugins下面不行了。
[zhangy@localhost ~]$ cp libflashplayer.so /home/zhangy/.mozilla/plugins
三,添加一些环境变量
/sbin和/usr/sbin是不在系统的环境变量里面的,但是有些常用的命令在这二个文件夹中,所以为了方便,我要把这二个加入到环境变量里面去
1,用export命令
export PATH=$PATH:/sbin:/usr/sbin
用这种方法有一个缺点,重起后上面加的环境就不存在了
2,在/etc/profile
vi /etc/profile 搜索一下export,在它的前面加一行PATH=$PATH:/sbin:/usr/sbin
3,在/etc/bashrc
每个用户文件夹下都有一个.bashrc文件
- [zhangy@localhost ~]$ cat .bashrc
- # .bashrc
- # Source global definitions
- if [ -f /etc/bashrc ]; then
- . /etc/bashrc
- fi
- # User specific aliases and functions
都会调用/etc/bashrc文件,我们可以在/etc/bashrc的最后面加上export PATH=$PATH:/sbin:/usr/sbin
四,自动挂载ntfs分区
经常要用到windows下面的东西,所以每次都要去挂载,其实挺烦的,所以我把它设置成启动就能挂载
- [zhangy@localhost ~]$ cat /etc/fstab
- LABEL=/ / ext3 defaults 1 1
- tmpfs /dev/shm tmpfs defaults 0 0
- devpts /dev/pts devpts gid=5,mode=620 0 0
- sysfs /sys sysfs defaults 0 0
- proc /proc proc defaults 0 0
- /dev/sda5 /mnt/usb ntfs-3g defaults,iocharset=utf8 0 0
在/etc/fstab下面加上/dev/sda5 /mnt/usb ntfs-3g defaults,iocharset=utf8 0 0就行了。
五,去掉tab提示时,嘟嘟声,这个声音特别的让人烦
1,rmmod 方法
rmmod pcspkr 关闭声音
modprobe pcspkr 开启声音
上面的这个只是暂时,重起后就会失效
2,修改.bashrc或者/etc/bashrc,在最后面加上以下内容
setterm -blength 0
xset -b
六,修改sudo,用sudo的时候,不用在提示输入密码
vi /etc/sudoers
- ## Allows people in group wheel to run all commands
- # %wheel ALL=(ALL) ALL //这个要输入密码的
- ## Same thing without a password
- %wheel ALL=(ALL) NOPASSWD: ALL //这个不需要
[root@localhost zhangy]$ gpasswd -a zhangy wheel 将用户加入到wheel组中
sudoers
来源: http://blog.51yip.com/linux/1127.html