最近Ubuntu更新比较频繁(实际上一直都更新频繁,你就当更新及时吧 ),总有那么一两次更新老半天还没完成。最近更新问题就比较多,比如更新flash控件就会一直停在那里,无法完成也无法取消。再比如下载30多M的内核,居然也会下载失败,或此时咱要安装个啥软件会等不了那么久,咱就会强制结束。

强制结束后问题就来了,无法再次更新,在终端使用apt-get update或upgrade会提示is locked:

1
2
3
xxx@expired:~$ sudo apt-get upgrade
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?

解决方法便是:

1.删除lock

1
sudo rm  /var/lib/dpkg/lock

2.更新软件库设置

1
sudo dpkg --configure -a

完成后就继续更新吧。前面说的flash无法通过Ubuntu的更新管理或apt-get更新问题,还是自己到adobe网站下载so文件,然后手动替换吧,方法可以参考:Ubuntu安装flash控件,新版本的flash已经把32位和64位版本合在一起了,所以下载会得到install_flash_player_11_Linux_x86_64.tar.gz,本次更新还涉及到其他一些文件,可以看压缩包里的readme.txt.

xxx@expired:~/Downloads$ cat readme.txt
Adobe Systems Incorporated
Flash Player 11 for Linux
Version 11.2.202.243
2012

Adobe recommends that all users upgrade to the latest version of Adobe Flash
Player for the most recent features, bug fixes, and security fixes. For
more information on the new features in Flash Player 9, please visit
http://www.adobe.com/products/flashplayer/. For more information on system
requirements, fixed issues, and known issues, see the release notes at
http://www.adobe.com/go/flashplayer_releasenotes.
o Unpack the tar.gz file. Once unpacked you will see the following:

  • libflashplayer.so
  • /usr
    o Identify the location of the browser plugins directory, based on your Linux distribution and Firefox version
    o Copy libflashplayer.so to the appropriate browser plugins directory. At the prompt type:
  • cp libflashlayer.so
    o Copy the Flash Player Local Settings configurations files to the /usr directory. At the prompt type:
  • sudo cp -r usr/* /usr