0

I was trying to install libmemcached-dev for php, and I encountered an error:

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

Then I typed the sudo dpkg --configure -a, on the first try it gives an internal error and said that to report it. Then I tried it again(3-4 times): sudo dpkg --configure -a, and my laptop always goes hang. And before it goes completely unresponsive, luckily the print screen works and here is the text:

[sudo] password for japjap:
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
japjap@laptop:~$ sudo dpkg --configure -a
Setting up linux-image-4.4.0-47-generic (4.4.0-47.68) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
initrd.img(/boot/initrd.img-4.4.0-47-generic
) points to /boot/initrd.img-4.4.0-47-generic
 (/boot/initrd.img-4.4.0-47-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-4.4.0-47-generic.postinst line 491.
vmlinuz(/boot/vmlinuz-4.4.0-47-generic
) points to /boot/vmlinuz-4.4.0-47-generic
 (/boot/vmlinuz-4.4.0-47-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-4.4.0-47-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-47-generic /boot/vmlinuz-4.4.0-47-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-47-generic /boot/vmlinuz-4.4.0-47-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-47-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-47-generic /boot/vmlinuz-4.4.0-47-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-47-generic /boot/vmlinuz-4.4.0-47-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-47-generic /boot/vmlinuz-4.4.0-47-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-47-generic /boot/vmlinuz-4.4.0-47-generic

Anybody can help how I can solve this? I can't install anything.

First 20 lines of my /etc/default/grub

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

Update:

df -h

Filesystem      Size  Used Avail Use% Mounted on
udev            946M     0  946M   0% /dev
tmpfs           194M  6.2M  187M   4% /run
/dev/sda1       228G  8.9G  207G   5% /
tmpfs           966M  536K  965M   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           966M     0  966M   0% /sys/fs/cgroup
tmpfs           194M   64K  193M   1% /run/user/1000

lsblk

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 232.9G  0 disk 
├─sda1   8:1    0   231G  0 part /
├─sda2   8:2    0     1K  0 part 
└─sda5   8:5    0     2G  0 part [SWAP]
sr0     11:0    1  1024M  0 rom  

sudo blkid

/dev/sda1: UUID="6416ac0d-4822-47aa-9035-a3fadf5033b2" TYPE="ext4" PARTUUID="118168b7-01"
/dev/sda5: UUID="437c42c7-26b8-4fb9-8fd7-10267ba9276a" TYPE="swap" PARTUUID="118168b7-05"

cat /etc/fstab

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sdb1 during installation
UUID=6416ac0d-4822-47aa-9035-a3fadf5033b2 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sdb5 during installation
UUID=437c42c7-26b8-4fb9-8fd7-10267ba9276a none            swap    sw              0       0

Update:

free

              total        used        free      shared  buff/cache   available
Mem:        1976820      860788       80364      140768     1035668      766212
Swap:       2024444        2508     2021936

sudo apt-get autoclean
[sudo] password for japjap: 
E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the download directory
Chai T. Rex
  • 5,193

2 Answers2

0

You're having driver issues.

Boot with the nomodeset grub option.

To perform this from the Grub Menu hit e on the ubuntu option. Then add the nomodeset parameter to the line that says, quiet splash. After the edit hit F10 to boot.

Then edit the /etc/default/grub file and add this argument to the boot defaults.

Change from:

# For full documentation of the options in this file, see:                                                                          
#   info -f grub -n 'Simple configuration'                                                                                          

GRUB_DEFAULT="saved"
GRUB_SAVEDEFAULT="true"
#GRUB_HIDDEN_TIMEOUT="0"                                                                                                            
GRUB_HIDDEN_TIMEOUT_QUIET="true"
GRUB_TIMEOUT="10"
GRUB_RECORDFAIL_TIMEOUT="$GRUB_TIMEOUT"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

Change to:

# For full documentation of the options in this file, see:                                                                          
#   info -f grub -n 'Simple configuration'                                                                                          

GRUB_DEFAULT="saved"
GRUB_SAVEDEFAULT="true"
#GRUB_HIDDEN_TIMEOUT="0"                                                                                                            
GRUB_HIDDEN_TIMEOUT_QUIET="true"
GRUB_TIMEOUT="10"
GRUB_RECORDFAIL_TIMEOUT="$GRUB_TIMEOUT"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"

The only line to be concerned with is the one highlighted in bold.

Editor examples

Use your favorite edit to edit the file. These are examples to edit the file:

$ sudo nano /etc/default/grub

or

$ sudo pksudo gedit /etc/default/grub

After making the change update your grub with:

$ sudo update-grub
$ sudo update-grub

This will resolve your laptop's lockup (due to hardware and drivers conflict) and allow you to complete the sudo dpkg --configure -a command you're having problems with.

L. D. James
  • 25,036
  • I tried this info -f grub -n, this is the result info: option requires an argument -- 'n' Try --help for more information. – Dumb Question Nov 12 '16 at 13:48
  • Should I restart my computer and press e ? – Dumb Question Nov 12 '16 at 13:50
  • The block of information you are looking at is referring to contents in a file that needs to be changed. You can edit the file with this command: sudo nano /etc/default/grub. Save the changes and continue with what is provided in the answer. – L. D. James Nov 12 '16 at 13:52
  • Hello, it's been awhile and still hangs here is the screen shot http://imgur.com/a/Ylvem – Dumb Question Nov 12 '16 at 14:37
  • @DumbQuestion Will you edit your question and show the content (at least the first 20 lines of your /etc/default/grub file? I'm sure the problem lies there. – L. D. James Nov 12 '16 at 15:42
  • question updated – Dumb Question Nov 13 '16 at 04:41
  • @L.D.James how did you get to conclusion that you did? Did I miss an important clue? Inquiring minds want to know :-) See my answer. – heynnema Nov 13 '16 at 16:38
  • @heynnema By experiencing lockups on numerous computers that was resolved with the steps. Also by assisting numerous others having lockups. Outside the steps I provided (from as I mentioned, personal experience), the results wouldn't be total system lockup (an unresponsive computer that can only be recovered by rebooting). There would be error messages that could be read and addressed and fixed. The process of testing lots of things such as installing aptitude in lieu of using apt doesn't appear to address the actual on-responsive... locked up system. .. – L. D. James Nov 13 '16 at 17:01
  • ...the broken packages (to me) will cause errors with specific applications, not a total system's lockup as in the case with the user. Also the image shows the lockup happens during the kernel update, whereas the programs he's trying to install are not in the immediate operation. – L. D. James Nov 13 '16 at 17:03
  • @DumbQuestion Did you run sudo update-grub after making the change you posted to your question? Also if you are still getting the lockup, is it happening at the same places as the image in your original post". If so, there is an alternate method that can be used to update your grub (where the problem is happening). – L. D. James Nov 13 '16 at 17:12
  • yes I use sudo update-grub – Dumb Question Nov 14 '16 at 01:09
  • @DumbQuestion Now I need to know if you are getting the same error message or a different error message (when it locks up). Also, when you used sudo update-grub did the update complete, then a reboot? Your original image shows grub being updated when the computer locks up. – L. D. James Nov 14 '16 at 01:44
  • No I did not reboot it after I used sudo update-grub, I tried sudo dpkg --configure -a then after that rebooted because it became very sluggish – Dumb Question Nov 14 '16 at 03:30
  • @DumbQuestion The grub changes won't take effect until a reboot. By the way, from your recent comment it appears that the "lockup/unresponsive" problem you were having has been cured. I'm sure it's a result of the steps in the answer. Now, will you perform the "configure-a" command, update the text to your question before rebooting? You couldn't do that before without an image. Originally you were having problems with the updates. After the system is sufficiently updated the newer drivers will provide more support for your hardware and you'll start to game better performance. – L. D. James Nov 14 '16 at 03:38
  • I tried the configure -a many times now, still the same. – Dumb Question Nov 15 '16 at 01:46
0

It looks like a Software Update failed, and left you partially updated. We'll try and fix this the short way...

From the Unity dashboard, start Synaptic. Go to the edit menu and choose Fix broken packages. Quit Synaptic.

update: If you can't use Synaptic, do this:

  1. boot the system to the GRUB menu
  2. choose Advanced Options
  3. choose Recovery mode
  4. choose dpkg - fix broken packages
  5. when you return to the menu, choose root access
  6. type reboot
  7. once rebooted, open terminal, type sudo dpkg --configure -a
  8. whether step 7 works or not, perform commands 1-5, below

From the Unity dashboard, start terminal. Enter the following commands, one at a time (best to use copy and paste):

sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get update
sudo apt-get -f install
sudo apt-get upgrade
heynnema
  • 70,711
  • I do not have synaptic only synaptic_synaptic.png – Dumb Question Nov 14 '16 at 01:13
  • In terminal, type sudo apt-get install synaptic – heynnema Nov 14 '16 at 01:23
  • ps: if for some reason it errors when you try to install Synaptic, just go ahead with the other steps. – heynnema Nov 14 '16 at 01:30
  • this image appears again http://imgur.com/a/XXb7W and my laptop goes very sluggish until I turn off it again. – Dumb Question Nov 14 '16 at 03:02
  • How much RAM? How much swap? Edit your question to include the output, in terminal, of df -h and lsblkand sudo blkid and cat /etc/fstab. Were you able to run Synaptic and fix broken packages? Go ahead and try and run steps 2-5. Please answer all my questions, and give all requested output. Report back. – heynnema Nov 14 '16 at 04:25
  • my question has been updated, and I can't install Synaptic this is the error: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. – Dumb Question Nov 14 '16 at 14:33
  • Thanks for updating your question with that info. All of it looks fine, except your swap is a little small. You forgot to tell me how much RAM you have (type free in terminal), and whether steps 2-5 worked for you. If they don't, we'll have to try something else. – heynnema Nov 15 '16 at 00:45
  • I updated my question, step 2 does not work. – Dumb Question Nov 15 '16 at 01:46
  • Please see the update in my answer on what to do next. – heynnema Nov 15 '16 at 02:21
  • I tried rebooting to grub menu but, the only appearing is Grub loading... then I held shift but it returns to normal state. – Dumb Question Nov 15 '16 at 13:05
  • Don't you normally see the GRUB menu when you turn on the computer? If not, try holding down EITHER the LEFT SHIFT key, or the ESC key, during boot and you should see it. Then use the UP/DOWN arrow keys to select ADVANCED OPTIONS, then hit the ENTER key. – heynnema Nov 15 '16 at 16:02
  • I tried left shift key and I only saw the Grub loading then after that it continued to start at normal state no Grub menu at all. – Dumb Question Nov 16 '16 at 01:38
  • Did you try the ESC key? – heynnema Nov 16 '16 at 01:54
  • yes, I tried autoremove part, did not work, E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. – Dumb Question Nov 16 '16 at 15:21
  • You're still not being clear on if you see the normal GRUB menu at boot time... either normally, or by holding down LEFT SHIFT key, or by tapping the ESC key a few times at boot time. We need to complete step 4 in my updated instructions. If we can't get that done, I can't help any further. – heynnema Nov 16 '16 at 15:32
  • Yes it works, it says that Killed then I pressed enter then I went back to grub menu and rebooted it. – Dumb Question Nov 16 '16 at 15:35
  • Again, you're not being clear. Were you able to do step 4? What does "that Killed" mean? What happened at step 7? If step 7 worked, did you do the 5 sudo apt-get commands? Please be concise. – heynnema Nov 16 '16 at 15:42
  • Yes, I did step 4, the "Killed" is appeared after a long time of updates that step 4 do. Step 7 did not worked. – Dumb Question Nov 17 '16 at 13:01
  • @LDJames I'm out of ideas. Somebody with more expertise on dpkg and apt-get will be required to help more. Can you help? – heynnema Nov 17 '16 at 15:19
  • Should I reinstall ubuntu? – Dumb Question Nov 19 '16 at 05:27
  • Yes, reinstall. Sorry we couldn't repair it any other way. We tried! – heynnema Nov 19 '16 at 13:07
  • How to reinstall? I can't find this link useful https://help.ubuntu.com/community/UbuntuReinstallation, because this link https://help.ubuntu.com/community/UbuntuInstaller that indicates in the first link is broken. – Dumb Question Dec 06 '16 at 10:09
  • http://askubuntu.com/questions/667143/how-to-reinstall-messed-up-14-04-without-losing-personal-data – heynnema Dec 06 '16 at 15:32