0

I am a beginner for Ubuntu, for last few days I'm facing this upgrade problem whenever I try to upgrade to new updates, as soon as I click install updates it starts the process and then ultimately shows an error message "package operation failed", one among those is very common is the following:

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

I tried to check this issue here and found a post asking about similar problem Here

What suggested there is that I should run following code in terminal:

sudo rm /var/crash/*

I did and now I am not getting this pop up showing system program problem detected but it seems that "error code (1)" problem still exist. Today I was trying to install gcc and it shows the same error. So I request that kindly help me to resolve this issue. Thank you!

In my latest attempt of updating I got the following error messages,

admins@admins-desktop:~$ sudo apt-get install build- 
essential
Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version (12.1ubuntu2).
The following packages were automatically installed and are no longer 
required:
 apt-xapian-index gimp-data gimp-help-common gimp-help-en gir1.2- 
gmenu-3.0
libamd2.4.1 libbabl-0.1-0 libbonobo2-0 libbonobo2-common libcamd2.4.1
libccolamd2.9.1 libcholmod3.0.6 libgegl-0.3-0 libgimp2.0 libgnome-2-0
libgnome2-common libgnomevfs2-0 libgnomevfs2-common libgtkglext1
libgutenprintui2-1 libllvm3.8 libllvm4.0 libmircommon5 libopencc1
   liborbit-2-0 libpango1.0-0 libpangox-1.0-0 libpython-stdlib 
libpyzy- 1.0-0v5
         libqmi-glib1 libqt4-designer libqt4-help libqt4-opengl 
libqt4- 
scripttools
libqt4-svg libqt4-test libqtassistantclient4 libqtwebkit4 librsync1
libsdl1.2debian libtiff-tools libumfpack5.7.1 libxapian-1.3-5
linux-headers-4.4.0-109 linux-headers-4.4.0-109-generic
linux-headers-4.4.0-112 linux-headers-4.4.0-112-generic
linux-headers-4.4.0-36 linux-headers-4.4.0-36-generic linux-headers- 
4.4.0-66
  linux-headers-4.4.0-66-generic linux-headers-4.4.0-70
  linux-headers-4.4.0-70-generic linux-headers-4.4.0-83
  linux-headers-4.4.0-83-generic linux-headers-4.4.0-98
  linux-headers-4.4.0-98-generic linux-image-4.4.0-109-generic
  linux-image-4.4.0-112-generic linux-image-4.4.0-36-generic
  linux-image-4.4.0-66-generic linux-image-4.4.0-70-generic
  linux-image-4.4.0-83-generic linux-image-4.4.0-98-generic
linux-image-extra-4.4.0-109-generic linux-image-extra-4.4.0-112- 
generic
linux-image-extra-4.4.0-36-generic linux-image-extra-4.4.0-66-generic
linux-image-extra-4.4.0-70-generic linux-image-extra-4.4.0-83-generic
linux-image-extra-4.4.0-98-generic linux-signed-image-4.4.0-109- 
generic
linux-signed-image-4.4.0-112-generic linux-signed-image-4.4.0-36- 
generic
linux-signed-image-4.4.0-66-generic linux-signed-image-4.4.0-70- 
generic
linux-signed-image-4.4.0-83-generic linux-signed-image-4.4.0-98- 
generic
oneconf-common python-cffi-backend python-cups python-httplib2 python- 
lxml
python-pam python-serial python-twisted-bin python-xapian python3- 
oneconf
python3-piston-mini-client python3-xapian1.3 snap-confine
ubuntu-core-launcher ubuntuone-client-data
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
10 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up initramfs-tools (0.122ubuntu8.11) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-4.4.0-119-generic (4.4.0-119.143) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-4.4.0-119- 
generic
vmlinuz(/boot/vmlinuz-4.4.0-119-generic
) points to /boot/vmlinuz-4.4.0-119-generic
(/boot/vmlinuz-4.4.0-119-generic) -- doing nothing at 
/var/lib/dpkg/info/linux-image-4.4.0-119-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0- 
119-generic /boot/vmlinuz-4.4.0-119-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-119- 
generic /boot/vmlinuz-4.4.0-119-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-119-generic
E: /usr/share/initramfs-tools/hooks/brltty failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.4.0-119-generic with 
1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return 
code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux- 
image-4.4.0-119-generic.postinst line 1052.
dpkg: error processing package linux-image-4.4.0-119-generic (-- 
configure):
 subprocess installed post-installation script returned error exit 
status 2
dpkg: dependency problems prevent configuration of linux-image-extra- 
4.4.0-119-generic:
linux-image-extra-4.4.0-119-generic depends on linux-image-4.4.0-119- 
generic; however:
 Package linux-image-4.4.0-119-generic is not configured yet.

dpkg: error processing package linux-image-extra-4.4.0-119-generic (-- 
configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image- 
generic:
linux-image-generic depends on linux-image-4.4.0-119-generic; however:
Package linux-image-4.4.0-119-generic is not configured yet.
linux-image-generic depends on linux-image-extra-4.4.0-119-generic; 
however:
Package linux-image-extra-4.4.0-119-generic is not configured yet.

dpkg: error processing package linux-image-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-image-generic (= 4.4.0.119.125); 
 however:
 Package linux-image-generic is not No apport report written because 
 the error message indicates its a followup error from a previous 
 failure.
                                                           No apport 
report written because the error message indicates its a followup 
error from a previous failure.
     No apport report written because MaxReports is reached already
                                                                   No 
apport report written because MaxReports is reached already
                                                   No apport report 
written because MaxReports is reached already
No apport report written because 
MaxReports is reached already
No apport report written because MaxReports is reached 
already

No apport report written because MaxReports is reached already
                                                         configured 
yet.

dpkg: error processing package linux-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic-lts- 
utopic:
linux-generic-lts-utopic depends on linux-generic; however:
Package linux-generic is not configured yet.

dpkg: error processing package linux-generic-lts-utopic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-signed-image- 
4.4.0-119-generic:
linux-signed-image-4.4.0-119-generic depends on linux-image-4.4.0-119- 
generic (= 4.4.0-119.143); however:
Package linux-image-4.4.0-119-generic is not configured yet.

dpkg: error processing package linux-signed-image-4.4.0-119-generic (- 
-configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-signed-image- 
generic:
linux-signed-image-generic depends on linux-signed-image-4.4.0-119- 
generic; however:
Package linux-signed-image-4.4.0-119-generic is not configured yet.
linux-signed-image-generic depends on linux-image-extra-4.4.0-119- 
generic; however:
Package linux-image-extra-4.4.0-119-generic is not configured yet.

dpkg: error processing package linux-signed-image-generic (-- 
configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-signed- 
generic:
linux-signed-generic depends on linux-signed-image-generic (= 
4.4.0.119.125); however:
Package linux-signed-image-generic is not configured yet.

dpkg: error processing package linux-signed-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-signed- 
generic-lts-utopic:
linux-signed-generic-lts-utopic depends on linux-signed-generic; 
however:
Package linux-signed-generic is not configured yet.

dpkg: error processing package linux-signed-generic-lts-utopic (-- 
configure):
dependency problems - leaving unconfigured
Processing triggers for initramfs-tools (0.122ubuntu8.11) ...
update-initramfs: Generating /boot/initrd.img-4.4.0-116-generic
E: /usr/share/initramfs-tools/hooks/brltty failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.4.0-116-generic with 
1.
dpkg: error processing package initramfs-tools (--configure):
subprocess installed post-installation script returned error exit 
status 1
No apport report written because MaxReports is reached already
                                                          Errors were 
encountered while processing:
 linux-image-4.4.0-119-generic
 linux-image-extra-4.4.0-119-generic
 linux-image-generic
 linux-generic
 linux-generic-lts-utopic
 linux-signed-image-4.4.0-119-generic
 linux-signed-image-generic
 linux-signed-generic
 linux-signed-generic-lts-utopic
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

I also want to know how to post long code section as I did because when I tried to copy paste it was not taking it as a code segments rather it took it as in text format. I tried many times but all in vain then I shifted whole code by the suggested margin to make it as code attachment. Even though I was eventually capable of doing it but it was really frustrating and tedious to shift every single line so I also want to know how to paste long code here as a code segment by copying through terminal window. Thank you and I apologize for such a long post. Thanks again!

6
  • For the code part of your question, when you paste it in, you can then highlight all the text that you want as code, then click the { } above and it shifts all the lines of code for you. And from a terminal I have learned that if you clear the contents first from scrollback by running reset in the terminal then it is easier to run cat on the file then you can scroll all the way from the top to the bottom highlighting with your mouse, then middle click in here to paste the code in.
    – Terrance
    Apr 9, 2018 at 13:46
  • is your /boot partition full? try removing all those old kernels
    – ravery
    Apr 9, 2018 at 13:57
  • @ravery I also guessed same but don't know how to remove old kernels ,can you please suggest me a way ? thank you !
    – user716691
    Apr 9, 2018 at 14:02
  • did you try apt-get autoremove as suggested by the output?
    – ravery
    Apr 9, 2018 at 14:07
  • @ravery I'm sorry but I couldn't notice where I got this apt-get autoremove suggestion but as you pointed out I tried to run this and it shown an error asking "are you root?" then I ran sudo apt-get autoremove and it started its function but again I end up having same error : Errors were encountered while processing: linux-image-extra-4.4.0-109-generic . linux-image-extra-4.4.0-98-generic E: Sub-process /usr/bin/dpkg returned an error code (1)
    – user716691
    Apr 10, 2018 at 9:54

0