系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
-
去也无踪
- 帖子: 28
- 注册时间: 2013-11-16 20:03
#1
帖子
由 去也无踪 » 2013-12-02 19:26
在一次修改了
文件内容重启后,登录账户后桌面环境崩溃,只出现如下提示。确认后一直黑屏。请问,除了重装以外还有其他的修复方法么?谢谢。

- 提示信息
-
mobilefzb
- 帖子: 224
- 注册时间: 2010-05-18 22:23
#2
帖子
由 mobilefzb » 2013-12-02 21:16
这个是一个默认的配置,看看能否帮助你……
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ "$PS1" ]; then
if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
# The file bash.bashrc already sets the default PS1.
# PS1='\h:\w\$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
# The default umask is now handled by pam_umask.
# See pam_umask(8) and /etc/login.defs.
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
-
去也无踪
- 帖子: 28
- 注册时间: 2013-11-16 20:03
#3
帖子
由 去也无踪 » 2013-12-02 21:18
mobilefzb 写了:这个是一个默认的配置,看看能否帮助你……
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ "$PS1" ]; then
if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
# The file bash.bashrc already sets the default PS1.
# PS1='\h:\w\$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
# The default umask is now handled by pam_umask.
# See pam_umask(8) and /etc/login.defs.
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
多谢,就如主贴所说。点击“ok”后一直黑屏。任何按键无效.....

-
onlylove
- 论坛版主
- 帖子: 5371
- 注册时间: 2007-01-14 16:23
#4
帖子
由 onlylove » 2013-12-02 21:19
可以重装桌面环境……或者你把你修改的地方还原回去试试
#include <stdio.h>
void main()
{
double world;
unsigned letter;
short stay;
long memories;
printf("I miss you.\n");
}
-
去也无踪
- 帖子: 28
- 注册时间: 2013-11-16 20:03
#5
帖子
由 去也无踪 » 2013-12-02 21:24
onlylove 写了:可以重装桌面环境……或者你把你修改的地方还原回去试试
一直黑屏着,无任何输入的界面。如何修改?包括使用快捷键启动终端。
-
poloshiao
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
#6
帖子
由 poloshiao » 2013-12-02 21:25
按一下 alt + F2
輸入 gksudo nautilus
出現檔案管理程式
檢視 / 顯示隱藏檔 打勾
打開 /etc 目錄
看看 有沒有
profile
profile~
兩個檔案
如果有
把 profile 改爲 profile.backup
把 profile~ 改爲 profile
儲存 重新開機
備註
當你執行
gksudo nautilus
沒有出現 檔案管理程式
可能還沒安裝 gksu 套件
sudo apt-get install gksu
備註
如果你已經修改 /etc/profile 兩次
這個方法可能就無效了
-
去也无踪
- 帖子: 28
- 注册时间: 2013-11-16 20:03
#7
帖子
由 去也无踪 » 2013-12-02 21:29
poloshiao 写了:按一下 alt + F2
輸入 gksudo nautilus
出現檔案管理程式
檢視 / 顯示隱藏檔 打勾
打開 /etc 目錄
看看 有沒有
profile
profile~
兩個檔案
如果有
把 profile 改爲 profile.backup
把 profile~ 改爲 profile
儲存 重新開機
備註
當你執行
gksudo nautilus
沒有出現 檔案管理程式
可能還沒安裝 gksu 套件
sudo apt-get install gksu
多谢,记下了。等会儿试试。
-
onlylove
- 论坛版主
- 帖子: 5371
- 注册时间: 2007-01-14 16:23
#8
帖子
由 onlylove » 2013-12-02 21:39
ctrl+alt+f2也不好用么?那应该有恢复模式吧?我记得是开机三个启动项的第二个,不过那个能不能用apt就不知道了
#include <stdio.h>
void main()
{
double world;
unsigned letter;
short stay;
long memories;
printf("I miss you.\n");
}
-
去也无踪
- 帖子: 28
- 注册时间: 2013-11-16 20:03
#9
帖子
由 去也无踪 » 2013-12-02 21:41
onlylove 写了:ctrl+alt+f2也不好用么?那应该有恢复模式吧?我记得是开机三个启动项的第二个,不过那个能不能用apt就不知道了
刚开始尝试使用Linux,完全没试过。不过,也记下了。感谢一下。
-
poloshiao
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
#10
帖子
由 poloshiao » 2013-12-02 21:52
ctrl+alt+f2也不好用么?
我是寫
alt + F2
補充說明
1. 當你使用 gedit 修改 profile
gedit 會自動幫你把修改前的檔案 存入 profile~
2. 如果你修改好幾次 那 profile~ 就是最後一次修改前的內容了
-
eexpress
- 帖子: 58428
- 注册时间: 2005-08-14 21:55
- 来自: 长沙
#11
帖子
由 eexpress » 2013-12-02 22:03
grub的recovery模式可以进去不。
如果不行,livecd进去,再chroot改文件。
如果不确定哪个文件出错,估计没戏了。
● 鸣学
-
去也无踪
- 帖子: 28
- 注册时间: 2013-11-16 20:03
#12
帖子
由 去也无踪 » 2013-12-02 22:53
eexpress 写了:grub的recovery模式可以进去不。
如果不行,livecd进去,再chroot改文件。
如果不确定哪个文件出错,估计没戏了。
请问如何进入recovery模式?
livecd又如何?
-
jinjiachen
- 帖子: 2148
- 注册时间: 2012-12-16 15:43
- 系统: debian
#13
帖子
由 jinjiachen » 2013-12-03 8:46
去也无踪 写了:eexpress 写了:grub的recovery模式可以进去不。
如果不行,livecd进去,再chroot改文件。
如果不确定哪个文件出错,估计没戏了。
请问如何进入recovery模式?
livecd又如何?
livecd是用镜像做的 可以写在光盘或优盘上