Wednesday, February 3, 2016

apt - How can I solve Unable to lock the administration directory (/var/lib/dpkg/)

I am really New to UBUNTU 14.04 and whenever I try to update or install anything I get this error:


sudo apt-get update [sudo] password for trojanfm:
E: Could not ge lock /var/lib/apt/lists/lock - open (11: Resource temporarily
unavailable)
E: Unable to lock directory /var/lib/apt/lists/
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?

kernel - Major issues trying to clean up /boot

12.04 LTS here, first off let me start with a uname -a output for you





3.2.0-35-generic-pae #55-Ubuntu SMP Wed Dec 5 18:04:39 UTC 2012 i686 i686 i386 GNU/Linux




So my boot partition was at 100%. A huge no-no, so I wanted to clean it up in order for me to upgrade vmware tools on this machine. I ran the usual



dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-    9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge


However when I try that I kept getting issues about unmet dependencies..





Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-generic : Depends: linux-headers-generic (= 3.2.0.37.44) but 3.2.0.38.46 is to be installed
linux-headers-generic : Depends: linux-headers-3.2.0-38-generic but it is not going to be installed
linux-image-generic : Depends: linux-image-3.2.0-37-generic but it is not going to be installed

linux-image-generic-pae : Depends: linux-image-3.2.0-37-generic-pae but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).




If I tried to install anything of course it would fail with not enough space left on /boot. So I moved some older kernels to /tmp for the time being. Here is my /tmp



drwxr-xr-x  2 root root     4096 Jan 14 19:34 hsperfdata_root
-rw-r--r-- 1 root root 7906868 May 29 2012 initrd.img-2.6.28-19-server.old.0
-rw-r--r-- 1 root root 17083030 Oct 26 10:57 initrd.img-3.2.0-27-generic
-rw-r--r-- 1 root root 17096219 Oct 26 11:00 initrd.img-3.2.0-27-generic-pae

-rw-r--r-- 1 root root 17085508 Dec 31 08:20 initrd.img-3.2.0-33-generic
-rw-r--r-- 1 root root 17099160 Dec 31 08:20 initrd.img-3.2.0-33-generic-pae
-rw-r--r-- 1 root root 17091480 Dec 31 08:23 initrd.img-3.2.0-34-generic
drwxr-xr-x 10 root root 4096 Feb 22 11:07 mkinitramfs_LzTuqq
-rw------- 1 root root 0 Feb 22 11:07 mkinitramfs-OL_lNbawL
-rw------- 1 root root 2249889 Jul 6 2012 System.map-3.2.0-27-generic
-rw------- 1 root root 2311276 Jul 6 2012 System.map-3.2.0-27-generic-pae
-rw------- 1 root root 2251905 Oct 18 13:27 System.map-3.2.0-33-generic
-rw------- 1 root root 2313292 Oct 18 13:41 System.map-3.2.0-33-generic-pae
-rw------- 1 root root 2252451 Nov 15 07:04 System.map-3.2.0-34-generic

-rw------- 1 root root 4855808 Jul 6 2012 vmlinuz-3.2.0-27-generic
-rw------- 1 root root 5010688 Jul 6 2012 vmlinuz-3.2.0-27-generic-pae
-rw------- 1 root root 4861280 Oct 18 13:27 vmlinuz-3.2.0-33-generic
-rw------- 1 root root 5015328 Oct 18 13:41 vmlinuz-3.2.0-33-generic-pae
-rw------- 1 root root 4862688 Nov 15 07:04 vmlinuz-3.2.0-34-generic
drwx------ 2 root root 4096 Jan 14 19:34 vmware-root


So now I try to aptitude safe-upgrade to see if it will fix the issues with the kernels and it did seem to install 3.2.0-38 but 3.2.0-37 is just not in /boot so I think that's the issue.




Here is what is in my boot (49% used after moving those to /tmp and now %69 used after aptitude safe-upgrade).



-rw-r--r-- 1 root root   795776 Jul  6  2012 abi-3.2.0-27-generic
-rw-r--r-- 1 root root 800453 Jul 6 2012 abi-3.2.0-27-generic-pae
-rw-r--r-- 1 root root 797027 Oct 18 13:27 abi-3.2.0-33-generic
-rw-r--r-- 1 root root 801704 Oct 18 13:41 abi-3.2.0-33-generic-pae
-rw-r--r-- 1 root root 797082 Nov 15 07:04 abi-3.2.0-34-generic
-rw-r--r-- 1 root root 797121 Dec 5 13:52 abi-3.2.0-35-generic
-rw-r--r-- 1 root root 801798 Dec 5 14:06 abi-3.2.0-35-generic-pae
-rw-r--r-- 1 root root 797231 Jan 8 17:48 abi-3.2.0-36-generic

-rw-r--r-- 1 root root 801908 Jan 8 18:03 abi-3.2.0-36-generic-pae
-rw-r--r-- 1 root root 797340 Feb 19 08:29 abi-3.2.0-38-generic
-rw-r--r-- 1 root root 802017 Feb 19 08:44 abi-3.2.0-38-generic-pae
-rw-r--r-- 1 root root 147463 Jul 6 2012 config-3.2.0-27-generic
-rw-r--r-- 1 root root 147401 Jul 6 2012 config-3.2.0-27-generic-pae
-rw-r--r-- 1 root root 147497 Oct 18 13:27 config-3.2.0-33-generic
-rw-r--r-- 1 root root 147435 Oct 18 13:41 config-3.2.0-33-generic-pae
-rw-r--r-- 1 root root 147514 Nov 15 07:04 config-3.2.0-34-generic
-rw-r--r-- 1 root root 147514 Dec 5 13:52 config-3.2.0-35-generic
-rw-r--r-- 1 root root 147452 Dec 5 14:06 config-3.2.0-35-generic-pae

-rw-r--r-- 1 root root 147514 Jan 8 17:48 config-3.2.0-36-generic
-rw-r--r-- 1 root root 147452 Jan 8 18:03 config-3.2.0-36-generic-pae
-rw-r--r-- 1 root root 147497 Feb 19 08:29 config-3.2.0-38-generic
-rw-r--r-- 1 root root 147435 Feb 19 08:44 config-3.2.0-38-generic-pae
drwxr-xr-x 3 root root 5120 Feb 22 11:25 grub
-rw-r--r-- 1 root root 17092973 Dec 31 10:09 initrd.img-3.2.0-35-generic
-rw-r--r-- 1 root root 17101417 Dec 31 10:09 initrd.img-3.2.0-35-generic-pae
-rw-r--r-- 1 root root 17093970 Jan 18 06:52 initrd.img-3.2.0-36-generic
-rw-r--r-- 1 root root 17103977 Jan 18 06:52 initrd.img-3.2.0-36-generic-pae
-rw-r--r-- 1 root root 17090717 Feb 22 11:23 initrd.img-3.2.0-38-generic

-rw-r--r-- 1 root root 17098330 Feb 22 11:25 initrd.img-3.2.0-38-generic-pae
drwxr-xr-x 2 root root 12288 Jul 2 2009 lost+found
-rw-r--r-- 1 root root 176764 Nov 27 2011 memtest86+.bin
-rw-r--r-- 1 root root 178944 Nov 27 2011 memtest86+_multiboot.bin
-rw------- 1 root root 2252128 Dec 5 13:52 System.map-3.2.0-35-generic
-rw------- 1 root root 2314162 Dec 5 14:06 System.map-3.2.0-35-generic-pae
-rw------- 1 root root 2252687 Jan 8 17:48 System.map-3.2.0-36-generic
-rw------- 1 root root 2314721 Jan 8 18:03 System.map-3.2.0-36-generic-pae
-rw------- 1 root root 2253664 Feb 19 08:29 System.map-3.2.0-38-generic
-rw------- 1 root root 2315698 Feb 19 08:44 System.map-3.2.0-38-generic-pae

-rw------- 1 root root 4863712 Dec 5 13:52 vmlinuz-3.2.0-35-generic
-rw------- 1 root root 5017984 Dec 5 14:06 vmlinuz-3.2.0-35-generic-pae
-rw------- 1 root root 4864480 Jan 8 17:48 vmlinuz-3.2.0-36-generic
-rw------- 1 root root 5019456 Jan 8 18:03 vmlinuz-3.2.0-36-generic-pae
-rw------- 1 root root 4864128 Feb 19 08:29 vmlinuz-3.2.0-38-generic
-rw------- 1 root root 5018240 Feb 19 08:44 vmlinuz-3.2.0-38-generic-pae


No matter what I do I just cant clean out old kernels the proper way. It always gives me a dependency error and suggests to try apt-get-f install. Well even apt-get -f install gives me errors.




Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
linux-generic linux-image-generic linux-image-generic-pae
The following packages will be upgraded:
linux-generic linux-image-generic linux-image-generic-pae
3 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
4 not fully installed or removed.

Need to get 0 B/6,944 B of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
dpkg: dependency problems prevent configuration of linux-image-generic:
linux-image-generic depends on linux-image-3.2.0-37-generic; however:
Package linux-image-3.2.0-37-generic is not installed.
dpkg: error processing linux-image-generic (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of linux-generic:

linux-generic depends on linux-image-generic (= 3.2.0.37.44); however:
Package linux-image-generic is not configured yet.
linux-generic depends on linux-headers-generic (= 3.2.0.37.44); however:
Version of linux-headers-generic on system is 3.2.0.38.46.
dpkg: error processing linux-generic (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of linux-image-generic-pae:
linux-image-generic-pae depends on linux-image-3.2.0-37-generic-pae; however:
Package linux-image-3.2.0-37-generic-pae is not installed.

dpkg: error processing linux-image-generic-pae (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of linux-image-server:
linux-image-server depends on linux-image-generic-pae; however:
Package linux-image-generic-pae is not configured yet.
dpkg: error processing linux-image-server (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Errors were encountered while processing:

linux-image-generic
linux-generic
linux-image-generic-pae
linux-image-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


No matter what I try it keeps referencing those liux images /kernels.



Please help!

packaging - When to use separate PPAs?


I'm interested in setting up PPAs for a few projects that I'm working on, and I'm trying to find out how many PPAs I need. Should I create one PPA for each project, effectively having a single package in each? The fact that the name is "personal package archive" and the fact that they're created under my launchpad username make it seem like I should have all of my projects in one PPA - would that cause problems? What if it's multiple similar/related packages, such as unity lenses?


The instructions don't really say anything about how much to put in a single PPA, though they do indicate having more than one is okay.



There is no need to create multiple PPAs, unless it's necessary. For example, daily builds, and stable releases, of the same project (same package) would need to be separate PPAs, since you can't have multiple versions of the same package, in a single archive. However, just making packages of various things you find an interest in, or as a point of staging packages you wish to propose for inclusion in the Ubuntu or Debian archives, does not require multiple PPAs.


The best thing you can do is organize in a way that minimizes any potential damage to users' systems who decide to add your PPA. Packaging of libraries and applications that exist in Ubuntu already, can greatly increase potential for damage, especially if you start adding extra patches and such.


ubuntu touch - Problem creating lxc container on BQ M10



I attempted to create an lxc container on my BQ Aquarius M10 as follows:



libertine-container-manager create -t lxc -d vivid -i lxc



After being asked for and entering my password the following was the result:



Traceback (most recent call last):
File "/usr/bin/libertine-container-manager", line 758, in
args.func(args)
File "/usr/bin/libertine-container-manager", line 387, in create
container = LibertineContainer(args.id)
File "/usr/lib/python3/dist-packages/libertine/Libertine.py", line 281, in __init__
from libertine.LxcContainer import LibertineLXC
ImportError: No module named 'libertine.LxcContainer'



Can anyone explain this?



Just to note - I am running OTA-11 and ssh'd into my tablet to get around any restricted terminal issues.



Usermode LXC is not supported on Linux 3.10, so the LXC back end of Libertine isn't even installed on that device. If you try to force the tools to perform such an unsupported option, you get an error message telling you that the back end is not available.



The solution to this problem is don't force the tools to use an unsupported option.


Upgrade to 12.10 from 12.04 not available in update manager


My update manager does not give me the option to upgrade to Ubuntu 12.10. That is, the "New distribution release '12.10' is available. Click Upgrade and follow the on-screen instructions" section is not shown.


I had the same problem upgrading to 12.04. Spent hours trying to upgrade the system, got lucky somehow, don’t definitively know how.


What I have done,



  • used Synaptic to clear package cache.

  • reloaded package list and upgraded all packages.

  • checked that ubuntu-standard and ubuntu-desktop packages are
    installed.

  • checked that the "notify me of new version" setting in update-manager is set to "all new versions"

  • update manager reports there are "no new updates"

  • sudo do-release-upgrade -d reports no release available

  • running update-manager -d does not help.

  • cat /etc/lsb-release output is: DISTRIB_ID=Ubuntu DISTRIB_RELEASE=12.04 DISTRIB_CODENAME=precise DISTRIB_DESCRIPTION="Ubuntu 12.04.1 LTS


Similar problem 1 |
Similar problem 2 |
Similar problem 3



Was able to upgrade my system by downloading the Ubuntu 12.10 desktop iso image, writing it to DVD and booting from it. The installation utility has an option to upgrade the current installation rather than reinstalling a complete new system.


I did not lose my home-folder data, however, I lost all other system configurations and had to reinstall all non-default apps. I suggest making backups before installing.


Installing Nvidia Drivers / Power Use bug


A few months back I installed Ubuntu for the first time on a new laptop and started getting accustomed to it. After doing the initial setup and installing nvidia drivers for my dedicated gpu I encountered a bug that would cause the drivers to not unload properly once prime-select was switched to intel.


https://bugs.launchpad.net/ubuntu/+source/ubuntu-drivers-common/+bug/1778011


Now as I'm looking at this, and correct me if I'm wrong, the bug seems to be resolved.


Does that mean that I have to install nvidia-390 and that will contain the bugfix or do I need to install a different driver?


Nvidia-396 which seems to be the latest stable driver returns a not found when trying to install from terminal.


Using ubuntu 18.04.01 LTS


Here's the output of inxi -G


Graphics:  Card-1: Intel UHD Graphics 620
Card-2: NVIDIA Device 1d12
Display Server: x11 (X.Org 1.19.6 )
drivers: modesetting (unloaded: fbdev,vesa)
Resolution: 1920x1080@59.98hz
OpenGL: renderer: Mesa DRI Intel UHD Graphics 620 (Kabylake GT2)
version: 4.5 Mesa 18.0.5


I figured out a fix.


While having nvidia-390 installed I couldn't install nvidia-driver-396 as the terminal would just spit out errors that I couldn't fix.


The newest drivers refused to download and install until the point where I ran


sudo apt remove nvidia-390
sudo apt-get purge nvidia*

(I also ran sudo apt-get purge bumblebee* since I wasn't sure if that had installed anything related to nvidia)


Once that was done I ran


sudo apt-get install nvidia-driver-396

And it worked perfectly. I still can't see the name of my video card in Ubuntu itself, but everything seems to be working just fine.


installation - is it necessary to delete the recovery partition?


I have Windows 7 on my HP laptop and I want to install Ubuntu.


I tried to shrink my boot and system partition, it does not allow me to shrink the partition more than 97 MB. Is it necessary to delete the recovery partition?


I want to know how to put this recovery on a CD or DVD to keep it and not to lose it.



If you want your windows 7 operational you must not touch that partition.


If you simply remove it then your windows 7 won't boot ....


If you remove it carefully you'll be unable to use the recovery tools afterwards.


You can't backup that partition in order to deport it for later use on CD.


You Have various choices :



  • Removing the partition carefully understanding that I'll disable you some features of windows such as : bitlocker and recovery tools. And you understand too that you can loose all your windows install. There is no guarantee you'll be able to run windows 7 after this procedure : http://itcookbook.net/blog/removing-windows-7-recovery-partition

  • Re install Windows 7 so that it does not create the recovery partition ... Witch is safer way to do it : Create an NTFS partition that fit all the hard drive with gparted on ubuntu live, install windows and say yes when it ask you for creating supplementary partitions. After the installation of windows install your ubuntu with shrinking the windows partition.

  • Last option : shrink the windows partition, leave recovery partition as it is and install ubuntu.


Best regards,


11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...