【问题收录】Ubuntu(14.04)那些我遇到的各种事

来源:互联网 发布:Linux解压缩gzip 编辑:程序博客网 时间:2024/06/16 01:03

1.“启动会话失败”的解决方法

1.1问题描述

在登录的时候输入密码总是出现启动会话失败的提示

1.2 解决方案

按住 ctrl + Alt + F1 进入到tty

输入你自己的用户名
输入相应的密码

之后输入如下命令:

sudo apt-get install ubuntu-session

这个办法应对于删东西时auto-remove把session删了的情况

最后:

sudo shutdown -r now

或者是:

sudo reboot



Ubuntu Recovery Mode

怎么进入到安全模式:
在电脑启动的时候按住shift键,就可以进入到recovery mode

(注:图片来自网上)

这里写图片描述

点击进入到recovery mode 之后我们可以看到下面的界面:

这里写图片描述

resume Resume normal boot
继续正常模式启动,这个模式是提供给那些不小心误入此选项的使用者使用,可以使他们继续之前正常的启动模式

clean Try to make free space
清理软件包,尝试清除硬盘中不必要的档案的存放空间

dpkg Repair broken packages
修护损害的安装包

fsck Check all file systems
硬盘检查与修护坏道/逻辑坏道 进行磁盘/硬盘 扫描修复,适合不正常的开机使用

grub update grub bootloader
更新grub 引导

network Enable networking
带网络连接的shell界面,直接以文字模式启动,并且开启网络连线支援

root Drop to root shell prompt
最高的管理员的shell界面

system-summary System summary
查看系统的信息/资料


* 3. Starting the Winbind daemon winbind [fail] 解决方案*

首先可以选择进入tty模式,或者是recovery mode
输入;

sudo dpkg --configure -asudo apt-get -f install

如果失效,输入下面的语句

strace -f dpkg --configure winbind 2>&1 | grep execve

重启:

sudo reboot

参考连接: https://ubuntuforums.org/showthread.php?t=1593333



4. Starting SMB/CIFS File and Active Directory Server. [FAIL]

安装smaba:

sudo apt-get smaba

Starting SMB/CIFS File and Active Directory Server. [FAIL]

解决方案:

echo manual |sudo tee /etc/init/samba-ad-dc.override


5. 安装桌面环境

如果某些情况下Ubuntu的桌面环境垮了,或者说在安装完系统之后没有出现桌面环境,这个时候我们需要重新安装整个图形界面,和桌面环境。

一般这种情况,我是进入到recovery mode 中选择root选项直接安装的,或者是在tty这个模式下安装的
安装桌面系统:

sudo apt-get install gdm

或者安装一个轻量级的

sudo apt-get install lightdm

安装完这个时候的呢,你会得到一个图形界面,但是并没有其他东西,也就是说你能看到一个桌面,但是这个桌面上什么 也没有,没有状态栏,没有桌面图标,等等,就是一个非常干净的桌面,这个时候我们可以为我们的Ubuntu安装桌面系统

一般我采取的命令就是下面这个

sudo apt-get install ubuntu-desktop

还有不同的版本可以自己选择

輕巧的桌面環境Xfce

ubuntu:~$ sudo apt-get install xubuntu-desktop

KDE桌面環境

ubuntu:~$ sudo apt-get install kubuntu-desktop

亲测有效

当然还有其他的方法,然而可能是因为我之前少了什么库,所以没有成功。主要是自己拿自己的电脑开刀,各种删,我也不知道少了什么。

参考其他的人的方法如下操作:

 sudo apt-get install gnome-applets gnome-panel gnome-session gnome-terminal nautilus metacity gdm firefox

或者是:

  sudo apt-get install gnome-desktop

参考文献:

http://blog.lefthander.tw/2010/03/ubuntu-server.html

http://blog.csdn.net/taozpwater/article/details/8847528



6. Install with sudo app-get install doesn’t work, “Not using locking for read only file /var/lib/dpkg/lock”

当我们在安装某个东西的时候如果提示出:

W: Not using locking for read only lock file /var/lib/dpkg/lock E:
Unable to write to /var/cache/apt/ E: The package lists or status file
could not be parsed or opened.

这个时候的解决办法就是:

sudo mount -o remount,rw /


7. apt-get update fails to fetch files, “Temporary failure resolving …” error

参考文献

https://askubuntu.com/questions/91543/apt-get-update-fails-to-fetch-files-temporary-failure-resolving-error

我进入到recovery mode模式下修复了一下我可能出问题的包就好了。

然后:

sudo apt-get clean

之后是:

sudo apt-get update

如果我们知道我们要添加的源我们可以下面这么做

假设我们要添加一个临时的DNS 的服务器到我们的系统中,我们可以这么做:

假设我们添加Google的DNS服务器:

echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null

之后更新一下;

sudo apt-get update

如果永久的添加一个已知的DNS的服务到我们的系统,我们可以这么做:

echo "nameserver 8.8.8.8" | sudo tee /etc/resolvconf/resolv.conf.d/base > /dev/null

这个时候我们需要更新安装包的下载源的文件:
我们可以这么做

sudo vi /etc/apt/sources.list

假设那个旧的源是

deb http:/archive.canonical.com/ natty backports

我们可以直接替换掉旧的这个下载源的网站。

或者根据之前我们做的操作,对这行注释,就是加一个#上去。

#deb http:/archive.canonical.com/ natty backports

保存我们的文档,之后重新更新:

sudo apt-get update && sudo apt-get upgrade

参考文献:
https://askubuntu.com/questions/91543/apt-get-update-fails-to-fetch-files-temporary-failure-resolving-error

http://blog.csdn.net/ville_zeng/article/details/8869981#comments



8. Failed to get canonical path of /cow

问题描述:

对于ubuntu 14.04来说:

mount /dev/sda1 /mntchroot /mntupdate-grub2

Ubuntu16.04

mount /dev/sda1 /mntfor dir in /dev /dev/pts /proc /sys /run; do    mount --bind $dir /mnt$dirdonechroot /mntupdate-grub2

参考文献

https://askubuntu.com/questions/254491/failed-to-get-canonical-path-of-cow



这里写图片描述