Linux

解压命令:参考http://www.cnblogs.com/eoiioe/archive/2008/09/20/1294681.html


获取进程id和线程id:http://blog.chinaunix.net/uid-24567872-id-100482.html


ubuntu常见错误--could not get lock /var/lib/dpkg/lock -open

最近研究ubuntu,用apt-get命令安装一些软件包时,总报错:E:could not get lock /var/lib/dpkg/lock -open等

出现这个问题的原因可能是有另外一个程序正在运行,导致资源被锁不可用。而导致资源被锁的原因,可能是上次安装时没正常完成,而导致出现此状况。

解决方法:输入以下命令

sudo rm /var/cache/apt/archives/lock

sudo rm /var/lib/dpkg/lock




14.10 openjdk  :

pc:~$ sudo apt-get install openjdk-7-jdk
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?
pc:~$ sudo rm /var/cache/apt/archives/lock
pc:~$ sudo rm /var/lib/dpkg/lock


rm: cannot remove ‘/var/cache/apt/archives/lock’: No such file or directory
pc:~$ sudo apt-get install openjdk-7-jdk
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
pc:~$ sudo dpkg --configure -a
Setting up xserver-common (2:1.16.0-1ubuntu1.2) ...
Setting up linux-image-extra-3.16.0-29-generic (3.16.0-29.39) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.16.0-29-generic /boot/vmlinuz-3.16.0-29-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.16.0-29-generic /boot/vmlinuz-3.16.0-29-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-29-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.16.0-29-generic /boot/vmlinuz-3.16.0-29-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.16.0-29-generic /boot/vmlinuz-3.16.0-29-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.16.0-29-generic /boot/vmlinuz-3.16.0-29-generic
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-3.16.0-29-generic
Found initrd image: /boot/initrd.img-3.16.0-29-generic
Found linux image: /boot/vmlinuz-3.16.0-23-generic
Found initrd image: /boot/initrd.img-3.16.0-23-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
dpkg: unrecoverable fatal error, aborting:
 unable to install updated status of `linux-image-extra-3.16.0-29-generic': No such file or directory
pc:~$ sudo apt-get install linux-image-extra-3.16.0-29-generic

Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-image-extra-3.16.0-29-generic is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

pc:~$ sudo dpkg --configure -a
pc:~$ sudo apt-get install linux-image-extra-3.16.0-29-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-image-extra-3.16.0-29-generic is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
pc:~$ sudo apt-get install openjdk-7-jdk








  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值