ubuntu常见错误

http://blog.csdn.net/pipisorry/article/details/50752792

Could not get lock /var/lib/dpkg/lock

通过终端安装程序sudo apt-get install xxx时出错:
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it

出现这个问题可能是有另外一个程序正在运行,导致资源被锁不可用。而导致资源被锁的原因可能是上次运行安装或更新时没有正常完成,进而出现此状况,解决的办法其实很简单:

在终端中敲入以下两句
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock

Sub-process /usr/bin/dpkg returned an error code (1)

安装java如果使用oracle-java7-installer就会一起出错,dpkg错误:
ImportError: No module named 'ConfigParser'
dpkg: error processing package python-samba (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of samba-common-bin:
 samba-common-bin depends on python-samba; however:
  Package python-samba is not configured yet.

dpkg: error processing package samba-common-bin (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
              E: Sub-process /usr/bin/dpkg returned an error code (1)
解决方案:
$ sudo mv /var/lib/dpkg/info /var/lib/dpkg/info_old //现将info文件夹更名
$ sudo mkdir /var/lib/dpkg/info //再新建一个新的info文件夹
$ sudo apt-get update
apt-get -f install
$ sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info_old//执行完上一步操作后会在新的info文件夹下生成一些文件,现将这些文件全部移到info_old文件夹下
$ sudo rm -rf /var/lib/dpkg/info //把自己新建的info文件夹删掉
$ sudo mv /var/lib/dpkg/info_old /var/lib/dpkg/info //把以前的info文件夹重新改回名字
[ dpkg:处理 xxx (--configure)时出错解决办法]
[ Sub-process /usr/bin/dpkg returned an error code (1)的解决方法]

Ubuntu Software Center has closed unexpectly解决方案

打开软件中心Ubuntu Software Center的时候
出现crash report :The application Ubuntu Software Center has closed unexpectly。

ubuntu software center has closed unexpectedly. no module named xapian

解决1:

sudo rm /var/lib/apt/lists/* -vf
sudo apt-get update

解决2:

之前lz将系统默认的python改成了python3导致的,改回来就可以了

sudo rm /usr/bin/python

sudo cp /usr/bin/python_bak /usr/bin/python

[Ubuntu Software Center Closed Unexpectedly]


sorry, ubuntu14.04 has experienced an internal error ubuntu-sso-login crashed

with import error in __main__

也可能是之前lz将系统默认的python改成了python3导致的,改回来就可以了

from:http://blog.csdn.net/pipisorry/article/details/50752792

ref:


你可能感兴趣的:(ubuntu)