debian学习笔记1, su和su - root切换

1:debian的gvim和gedit图形编辑环境每次打开都会报错.


An error occurred while loading or saving configuration information for gvim. Some of your configuration settings may not work properly.


Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See  http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.)
Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See  http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.)
Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See  http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.)
Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See  http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.)
Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See  http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.)
Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See  http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.)
Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See  http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.)
Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See  http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.)


gedit error

configured D-Bus session bus daemon. See  http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.)
GConf Error: Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See  http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.)
GConf Error: Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See  http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.)
GConf Error: Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See  http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.)


2:查了半天gnome的wiki.后来经过一位好友的提醒,原来是SHELL的环境变量

su命令切换过去的:只是切换成了root身份,而SHELL环境仍然是普通用户的SHELL.

su - 命令切换过去的,把用户和SHELL环境一起切换成了root.所以要切换了SHELL环境才不会有PATH环境变量错误,这些错误包括上面的,和command not found.


3:比如 你登陆系统后 打开terminal.

rainysia@debian:/$pwd
/home/rainysia
rainysia@debian:/$su
Password:
root@debian:/# pwd
/home/rainysia

而你再用一次

root@debian:/# su -
root@debian:/# pwd
/root

来接着看环境变量, 分别

rainysia@debian:/$ echo $PATH

root@debian:/# echo $PATH

可以看出环境变量的区别了

rainysia@debian:/$echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
rainysia@debian:/$su
Password:
root@debian:/# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值