Installed javascript common package post installation script subprocess returned error exit status 1

I was trying to reinstall my apache 2 after un-installing it. But on installing it using command- sudo apt-get install apache2 i am getting error- rahul@rahulpc:~$ sudo apt-get install apache2 ...

I was trying to reinstall my apache 2 after un-installing it. But on installing it using command-

sudo apt-get install apache2

i am getting error-

rahul@rahulpc:~$ sudo apt-get install apache2
[sudo] password for rahul: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
apache2 is already the newest version.
The following packages were automatically installed and are no longer required:
  libblas3 liblinear-tools liblinear1
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 474 not upgraded.
1 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 javascript-common (11) ...
dpkg: error processing package javascript-common (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 javascript-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

i think i have removed some essential directories while un-installing apache 2 . Anybody please help me to recover the files and to install apache 2.

heemayl's user avatar

heemayl

88.9k19 gold badges195 silver badges262 bronze badges

asked Mar 23, 2015 at 21:03

Rahul Satal's user avatar

3

My problem was with javascript-common (I use Dedian) not being configured. My solution was to remove it and to install apache2 before installing javascript-common. It seems that javascript-common expects some configuration files to be exitent before being able to configure it.

sudo touch /etc/apache2/conf-available/javascript-common.conf

sudo apt-get install apache2

Download the javascript-common_11_all.deb package manually and instaled it with

dpkg -i  javascript-common_11_all.deb --force-all

good luck

answered Nov 26, 2015 at 14:00

user476275's user avatar

i uninstall it , and the dpkg reconfigure

apt-get —purge remove javascript-common

sudo dpkg —configure -a

if you need it , install it again

sudo apt-get update

sudo apt-get install javascript-common

answered Jun 24, 2019 at 23:47

taybinakh's user avatar

taybinakhtaybinakh

431 gold badge1 silver badge4 bronze badges

I was trying to reinstall my apache 2 after un-installing it. But on installing it using command-
sudo apt-get install apache2

i am getting error-

Error while installing apache2

rahul@rahulpc:~$ sudo apt-get clean && sudo apt-get autoclean
[sudo] password for rahul: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
rahul@rahulpc:~$ sudo apt-get --reinstall install apache2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libblas3 liblinear-tools liblinear1
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 474 not upgraded.
1 not fully installed or removed.
Need to get 87.4 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main apache2 amd64 2.4.7-1ubuntu4.4 [87.4 kB]
Fetched 87.4 kB in 3s (28.0 kB/s)  
(Reading database ... 172062 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.7-1ubuntu4.4_amd64.deb ...
Unpacking apache2 (2.4.7-1ubuntu4.4) over (2.4.7-1ubuntu4.4) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Processing triggers for ufw (0.34~rc-0ubuntu2) ...
Processing triggers for man-db (2.6.7.1-1) ...
Setting up javascript-common (11) ...
dpkg: error processing package javascript-common (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up apache2 (2.4.7-1ubuntu4.4) ...
/etc/init.d/apache2: 64: .: Can't open /etc/apache2/envvars
/etc/init.d/apache2: 76: .: Can't open /etc/apache2/envvars
ERROR: APACHE_PID_FILE needs to be defined in /etc/apache2/envvars
invoke-rc.d: initscript apache2, action "restart" failed.
Errors were encountered while processing:
 javascript-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

Also when i run command-

sudo apt-get upgrade

i am getting same error,I think i have removed some essential directories while un-installing apache 2 . Anybody please help me to recover the files and to install apache 2.


package javascript-common 11 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1

Bug #1282610 reported by
diego vargas
on 2014-02-20

This bug affects 13 people

Affects Status Importance Assigned to Milestone


javascript-common (Ubuntu)

Confirmed

Undecided


Unassigned

Bug Description

package javascript-common 11 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1

ProblemType: Package
DistroRelease: Ubuntu 13.10
Package: javascript-common 11
ProcVersionSignature: Ubuntu 3.11.0-17.31-generic 3.11.10.3
Uname: Linux 3.11.0-17-generic x86_64
ApportVersion: 2.12.5-0ubuntu2.2
Architecture: amd64
Date: Thu Feb 20 08:26:27 2014
Dependencies:

DuplicateSignature: package:javascript-common:11:subprocess installed post-installation script returned error exit status 1
ErrorMessage: subprocess installed post-installation script returned error exit status 1
InstallationDate: Installed on 2013-07-12 (223 days ago)
InstallationMedia: Ubuntu 13.04 «Raring Ringtail» — Release amd64 (20130424)
MarkForUpload: True
PackageArchitecture: all
SourcePackage: javascript-common
Title: package javascript-common 11 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
UpgradeStatus: Upgraded to saucy on 2013-10-25 (117 days ago)
modified.conffile..etc.apache2.conf.available.javascript.common.conf: [deleted]

Lot of output here, not sure if it’s all relevant. Still appear to be getting error message:

Code: Select all

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'plymouth-theme-sabily' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-ubuntu-mate-text' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-ubuntu-budgie-text' for glob 'plymouth-*'
Note, selecting 'plymouth-themes' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-kubuntu-text' for glob 'plymouth-*'
Note, selecting 'plymouth-theme' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-lubuntu-logo' for glob 'plymouth-*'
Note, selecting 'plymouth-label' for glob 'plymouth-*'
Note, selecting 'plymouth-themes-script' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-lubuntu-next-logo' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-xubuntu-text' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-ubuntu-text' for glob 'plymouth-*'
Note, selecting 'plymouth-themes-spinfinity' for glob 'plymouth-*'
Note, selecting 'plymouth-themes-solar' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-ubuntu-gnome-logo' for glob 'plymouth-*'
Note, selecting 'plymouth-dev' for glob 'plymouth-*'
Note, selecting 'plymouth-drm' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-ubuntu-mate-logo' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-ubuntu-budgie-logo' for glob 'plymouth-*'
Note, selecting 'plymouth-themes-all' for glob 'plymouth-*'
Note, selecting 'plymouth-themes-glow' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-edubuntu' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-spinner' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-hamara' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-kubuntu-logo' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-lubuntu-text' for glob 'plymouth-*'
Note, selecting 'plymouth-themes-fade-in' for glob 'plymouth-*'
Note, selecting 'plymouth-disabler' for glob 'plymouth-*'
Note, selecting 'plymouth-themes-spinner' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-ubuntustudio' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-lubuntu-next-text' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-breeze' for glob 'plymouth-*'
Note, selecting 'plymouth-x11' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-xubuntu-logo' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-ubuntu-logo' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-ubuntu-gnome-text' for glob 'plymouth-*'
Note, selecting 'plymouth-theme-sabily-text' for glob 'plymouth-*'
Note, selecting 'plymouth-themes' instead of 'plymouth-themes-all'
Note, selecting 'plymouth-themes' instead of 'plymouth-themes-fade-in'
Note, selecting 'plymouth-themes' instead of 'plymouth-themes-glow'
Note, selecting 'plymouth-themes' instead of 'plymouth-themes-script'
Note, selecting 'plymouth-themes' instead of 'plymouth-themes-solar'
Note, selecting 'plymouth-themes' instead of 'plymouth-themes-spinfinity'
Note, selecting 'plymouth-themes' instead of 'plymouth-themes-spinner'
The following additional packages will be installed:
  grub2-themes-ubuntustudio
Suggested packages:
  gdm
The following NEW packages will be installed:
  grub2-themes-ubuntustudio plymouth-disabler plymouth-theme-breeze plymouth-theme-edubuntu plymouth-theme-hamara plymouth-theme-kubuntu-logo plymouth-theme-kubuntu-text
  plymouth-theme-lubuntu-logo plymouth-theme-lubuntu-text plymouth-theme-sabily plymouth-theme-sabily-text plymouth-theme-spinner plymouth-theme-ubuntu-budgie-logo
  plymouth-theme-ubuntu-budgie-text plymouth-theme-ubuntu-gnome-logo plymouth-theme-ubuntu-gnome-text plymouth-theme-ubuntu-logo plymouth-theme-ubuntu-mate-logo
  plymouth-theme-ubuntu-mate-text plymouth-theme-ubuntustudio plymouth-theme-xubuntu-logo plymouth-theme-xubuntu-text plymouth-themes plymouth-x11
0 upgraded, 24 newly installed, 2 reinstalled, 0 to remove and 8 not upgraded.
2 not fully installed or removed.
Need to get 4,573 kB of archives.
After this operation, 8,160 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://packages.linuxmint.com uma/upstream amd64 plymouth-label amd64 0.9.4+mint2+ulyssa [42.9 kB]
Get:2 http://ubuntu.mirror.constant.com focal/universe amd64 grub2-themes-ubuntustudio all 0.3 [21.2 kB]
Get:3 http://ubuntu.mirror.constant.com focal/universe amd64 plymouth-disabler all 0.1 [3,098 B]
Get:4 http://ubuntu.mirror.constant.com focal/universe amd64 plymouth-theme-breeze amd64 5.18.4.1-0ubuntu1 [71.9 kB]
Get:5 http://packages.linuxmint.com uma/upstream amd64 plymouth-theme-spinner amd64 0.9.4+mint2+ulyssa [203 kB]
Get:6 http://ubuntu.mirror.constant.com focal/universe amd64 plymouth-theme-edubuntu all 15.12.1 [43.0 kB]
Get:7 http://packages.linuxmint.com uma/upstream amd64 plymouth-theme-ubuntu-logo amd64 0.9.4+mint2+ulyssa [135 kB]
Get:8 http://ubuntu.mirror.constant.com focal/universe amd64 plymouth-theme-hamara all 1.0 [299 kB] 
Get:9 http://packages.linuxmint.com uma/upstream amd64 plymouth-theme-ubuntu-text amd64 0.9.4+mint2+ulyssa [45.9 kB]
Get:10 http://packages.linuxmint.com uma/upstream amd64 plymouth-themes amd64 0.9.4+mint2+ulyssa [666 kB]
Get:11 http://packages.linuxmint.com uma/upstream amd64 plymouth-x11 amd64 0.9.4+mint2+ulyssa [44.7 kB]
Get:12 http://ubuntu.mirror.constant.com focal/universe amd64 plymouth-theme-kubuntu-logo all 1:20.04.9 [37.2 kB]
Get:13 http://ubuntu.mirror.constant.com focal/universe amd64 plymouth-theme-kubuntu-text all 1:20.04.9 [4,456 B]
Get:14 http://ubuntu.mirror.constant.com focal/universe amd64 plymouth-theme-lubuntu-logo all 20.04.3 [26.1 kB]
Get:15 http://ubuntu.mirror.constant.com focal/universe amd64 plymouth-theme-lubuntu-text all 20.04.3 [3,712 B]
Get:16 http://ubuntu.mirror.constant.com focal/universe amd64 plymouth-theme-sabily all 1.3 [1,760 kB]
Get:17 http://ubuntu.mirror.constant.com focal/universe amd64 plymouth-theme-sabily-text all 1.3 [9,776 B]
Get:18 http://ubuntu.mirror.constant.com focal/universe amd64 plymouth-theme-ubuntu-budgie-logo all 0.12.3 [33.3 kB]
Get:19 http://ubuntu.mirror.constant.com focal/universe amd64 plymouth-theme-ubuntu-budgie-text all 0.12.3 [10.1 kB]
Get:20 http://ubuntu.mirror.constant.com focal/universe amd64 plymouth-theme-ubuntu-gnome-logo all 20.04.1 [88.8 kB]
Get:21 http://ubuntu.mirror.constant.com focal/universe amd64 plymouth-theme-ubuntu-gnome-text all 20.04.1 [10.0 kB]
Get:22 http://ubuntu.mirror.constant.com focal/universe amd64 plymouth-theme-ubuntu-mate-logo all 20.04.2 [38.7 kB]
Get:23 http://ubuntu.mirror.constant.com focal/universe amd64 plymouth-theme-ubuntu-mate-text all 20.04.2 [15.3 kB]
Get:24 http://ubuntu.mirror.constant.com focal/universe amd64 plymouth-theme-ubuntustudio all 20.04.1 [926 kB]
Get:25 http://ubuntu.mirror.constant.com focal/universe amd64 plymouth-theme-xubuntu-logo all 20.04.2 [23.4 kB]
Get:26 http://ubuntu.mirror.constant.com focal/universe amd64 plymouth-theme-xubuntu-text all 20.04.2 [10.8 kB]
Fetched 4,573 kB in 1s (3,902 kB/s)                      
Selecting previously unselected package grub2-themes-ubuntustudio.
(Reading database ... 368884 files and directories currently installed.)
Preparing to unpack .../00-grub2-themes-ubuntustudio_0.3_all.deb ...
Unpacking grub2-themes-ubuntustudio (0.3) ...
Selecting previously unselected package plymouth-disabler.
Preparing to unpack .../01-plymouth-disabler_0.1_all.deb ...
Unpacking plymouth-disabler (0.1) ...
Preparing to unpack .../02-plymouth-label_0.9.4+mint2+ulyssa_amd64.deb ...
Unpacking plymouth-label (0.9.4+mint2+ulyssa) over (0.9.4+mint2+ulyssa) ...
Selecting previously unselected package plymouth-theme-breeze.
Preparing to unpack .../03-plymouth-theme-breeze_5.18.4.1-0ubuntu1_amd64.deb ...
Unpacking plymouth-theme-breeze (5.18.4.1-0ubuntu1) ...
Selecting previously unselected package plymouth-theme-edubuntu.
Preparing to unpack .../04-plymouth-theme-edubuntu_15.12.1_all.deb ...
Unpacking plymouth-theme-edubuntu (15.12.1) ...
Selecting previously unselected package plymouth-theme-hamara.
Preparing to unpack .../05-plymouth-theme-hamara_1.0_all.deb ...
Unpacking plymouth-theme-hamara (1.0) ...
Selecting previously unselected package plymouth-theme-kubuntu-logo.
Preparing to unpack .../06-plymouth-theme-kubuntu-logo_1%3a20.04.9_all.deb ...
Unpacking plymouth-theme-kubuntu-logo (1:20.04.9) ...
Selecting previously unselected package plymouth-theme-kubuntu-text.
Preparing to unpack .../07-plymouth-theme-kubuntu-text_1%3a20.04.9_all.deb ...
Unpacking plymouth-theme-kubuntu-text (1:20.04.9) ...
Selecting previously unselected package plymouth-theme-lubuntu-logo.
Preparing to unpack .../08-plymouth-theme-lubuntu-logo_20.04.3_all.deb ...
Unpacking plymouth-theme-lubuntu-logo (20.04.3) ...
Selecting previously unselected package plymouth-theme-lubuntu-text.
Preparing to unpack .../09-plymouth-theme-lubuntu-text_20.04.3_all.deb ...
Unpacking plymouth-theme-lubuntu-text (20.04.3) ...
Selecting previously unselected package plymouth-theme-sabily.
Preparing to unpack .../10-plymouth-theme-sabily_1.3_all.deb ...
Unpacking plymouth-theme-sabily (1.3) ...
Selecting previously unselected package plymouth-theme-sabily-text.
Preparing to unpack .../11-plymouth-theme-sabily-text_1.3_all.deb ...
Unpacking plymouth-theme-sabily-text (1.3) ...
Selecting previously unselected package plymouth-theme-spinner.
Preparing to unpack .../12-plymouth-theme-spinner_0.9.4+mint2+ulyssa_amd64.deb ...
Unpacking plymouth-theme-spinner (0.9.4+mint2+ulyssa) ...
Selecting previously unselected package plymouth-theme-ubuntu-budgie-logo.
Preparing to unpack .../13-plymouth-theme-ubuntu-budgie-logo_0.12.3_all.deb ...
Unpacking plymouth-theme-ubuntu-budgie-logo (0.12.3) ...
Selecting previously unselected package plymouth-theme-ubuntu-budgie-text.
Preparing to unpack .../14-plymouth-theme-ubuntu-budgie-text_0.12.3_all.deb ...
Unpacking plymouth-theme-ubuntu-budgie-text (0.12.3) ...
Selecting previously unselected package plymouth-theme-ubuntu-gnome-logo.
Preparing to unpack .../15-plymouth-theme-ubuntu-gnome-logo_20.04.1_all.deb ...
Unpacking plymouth-theme-ubuntu-gnome-logo (20.04.1) ...
Selecting previously unselected package plymouth-theme-ubuntu-gnome-text.
Preparing to unpack .../16-plymouth-theme-ubuntu-gnome-text_20.04.1_all.deb ...
Unpacking plymouth-theme-ubuntu-gnome-text (20.04.1) ...
Selecting previously unselected package plymouth-theme-ubuntu-logo.
Preparing to unpack .../17-plymouth-theme-ubuntu-logo_0.9.4+mint2+ulyssa_amd64.deb ...
Unpacking plymouth-theme-ubuntu-logo (0.9.4+mint2+ulyssa) ...
Selecting previously unselected package plymouth-theme-ubuntu-mate-logo.
Preparing to unpack .../18-plymouth-theme-ubuntu-mate-logo_20.04.2_all.deb ...
Unpacking plymouth-theme-ubuntu-mate-logo (20.04.2) ...
Selecting previously unselected package plymouth-theme-ubuntu-mate-text.
Preparing to unpack .../19-plymouth-theme-ubuntu-mate-text_20.04.2_all.deb ...
Unpacking plymouth-theme-ubuntu-mate-text (20.04.2) ...
Preparing to unpack .../20-plymouth-theme-ubuntu-text_0.9.4+mint2+ulyssa_amd64.deb ...
Unpacking plymouth-theme-ubuntu-text (0.9.4+mint2+ulyssa) over (0.9.4+mint2+ulyssa) ...
Selecting previously unselected package plymouth-theme-ubuntustudio.
Preparing to unpack .../21-plymouth-theme-ubuntustudio_20.04.1_all.deb ...
Unpacking plymouth-theme-ubuntustudio (20.04.1) ...
Selecting previously unselected package plymouth-theme-xubuntu-logo.
Preparing to unpack .../22-plymouth-theme-xubuntu-logo_20.04.2_all.deb ...
Unpacking plymouth-theme-xubuntu-logo (20.04.2) ...
Selecting previously unselected package plymouth-theme-xubuntu-text.
Preparing to unpack .../23-plymouth-theme-xubuntu-text_20.04.2_all.deb ...
Unpacking plymouth-theme-xubuntu-text (20.04.2) ...
Selecting previously unselected package plymouth-themes.
Preparing to unpack .../24-plymouth-themes_0.9.4+mint2+ulyssa_amd64.deb ...
Unpacking plymouth-themes (0.9.4+mint2+ulyssa) ...
Selecting previously unselected package plymouth-x11.
Preparing to unpack .../25-plymouth-x11_0.9.4+mint2+ulyssa_amd64.deb ...
Unpacking plymouth-x11 (0.9.4+mint2+ulyssa) ...
Setting up plymouth-theme-hamara (1.0) ...
Setting up plymouth-theme-breeze (5.18.4.1-0ubuntu1) ...
Setting up plymouth-disabler (0.1) ...
Setting up initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: deferring update (trigger activated)
Setting up plymouth-x11 (0.9.4+mint2+ulyssa) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-5.4.0-89-generic (5.4.0-89.100) ...
Setting up grub2-themes-ubuntustudio (0.3) ...
Setting up plymouth-theme-ubuntu-text (0.9.4+mint2+ulyssa) ...
update-initramfs: deferring update (trigger activated)
Setting up plymouth-theme-ubuntu-mate-text (20.04.2) ...
update-initramfs: deferring update (trigger activated)
Setting up plymouth-theme-xubuntu-text (20.04.2) ...
update-initramfs: deferring update (trigger activated)
Setting up plymouth-theme-kubuntu-text (1:20.04.9) ...
update-initramfs: deferring update (trigger activated)
Setting up plymouth-label (0.9.4+mint2+ulyssa) ...
Setting up plymouth-theme-lubuntu-text (20.04.3) ...
update-initramfs: deferring update (trigger activated)
Setting up plymouth-theme-kubuntu-logo (1:20.04.9) ...
update-initramfs: deferring update (trigger activated)
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50_linuxmint.cfg'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-89-generic
Found linux image: /boot/vmlinuz-5.4.0-88-generic
Found initrd image: /boot/initrd.img-5.4.0-88-generic
Found linux image: /boot/vmlinuz-5.4.0-74-generic
Found initrd image: /boot/initrd.img-5.4.0-74-generic
Adding boot menu entry for UEFI Firmware Settings
done
Setting up plymouth-theme-ubuntu-budgie-text (0.12.3) ...
update-initramfs: deferring update (trigger activated)
Setting up plymouth-theme-ubuntustudio (20.04.1) ...
update-alternatives: using /usr/share/plymouth/themes/ubuntustudio-logo/ubuntustudio-logo.plymouth to provide /usr/share/plymouth/themes/default.plymouth (default.plymouth) in manual mode
update-initramfs: deferring update (trigger activated)
Setting up plymouth-theme-ubuntu-mate-logo (20.04.2) ...
FRAMEBUFFER=y
update-initramfs: deferring update (trigger activated)
Setting up plymouth-theme-edubuntu (15.12.1) ...
update-initramfs: deferring update (trigger activated)
Setting up plymouth-theme-ubuntu-budgie-logo (0.12.3) ...
update-initramfs: deferring update (trigger activated)
Setting up plymouth-theme-ubuntu-gnome-text (20.04.1) ...
update-initramfs: deferring update (trigger activated)
Setting up plymouth-theme-sabily-text (1.3) ...
update-initramfs: deferring update (trigger activated)
Setting up plymouth-theme-lubuntu-logo (20.04.3) ...
update-initramfs: deferring update (trigger activated)
Setting up plymouth-theme-xubuntu-logo (20.04.2) ...
update-initramfs: deferring update (trigger activated)
Setting up plymouth-theme-sabily (1.3) ...
update-initramfs: deferring update (trigger activated)
Setting up plymouth-theme-ubuntu-logo (0.9.4+mint2+ulyssa) ...
update-initramfs: deferring update (trigger activated)
Setting up plymouth-theme-ubuntu-gnome-logo (20.04.1) ...
update-initramfs: deferring update (trigger activated)
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50_linuxmint.cfg'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-89-generic
Found linux image: /boot/vmlinuz-5.4.0-88-generic
Found initrd image: /boot/initrd.img-5.4.0-88-generic
Found linux image: /boot/vmlinuz-5.4.0-74-generic
Found initrd image: /boot/initrd.img-5.4.0-74-generic
Adding boot menu entry for UEFI Firmware Settings
done
Setting up plymouth-theme-spinner (0.9.4+mint2+ulyssa) ...
update-initramfs: deferring update (trigger activated)
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50_linuxmint.cfg'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-89-generic
Found linux image: /boot/vmlinuz-5.4.0-88-generic
Found initrd image: /boot/initrd.img-5.4.0-88-generic
Found linux image: /boot/vmlinuz-5.4.0-74-generic
Found initrd image: /boot/initrd.img-5.4.0-74-generic
Adding boot menu entry for UEFI Firmware Settings
done
Setting up plymouth-themes (0.9.4+mint2+ulyssa) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-88-generic
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-5.4.0-88-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
Processing triggers for linux-image-5.4.0-89-generic (5.4.0-89.100) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.4.0-89-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.4.0-89-generic
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-5.4.0-89-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-5.4.0-89-generic (--configure):
 installed linux-image-5.4.0-89-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 initramfs-tools
 linux-image-5.4.0-89-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

That message is generic. It just means that the dpkg instance called by apt/apt-get failed for some reason. It doesn’t explain why, how, or give hints how to solve it. As a diagnostic message, it is not useful.

You need to read the lines before the message (sometimes quite a number of them) to find the real error that prevents you from completing the installation.

Yeah, but how do I solve it?

There is no single way to solve it. There are so many reasons why this can happen that it’s futile to attempt to list them all in a single post. Each and every circumstance is almost unique to that package/environment.

But, there’s redemption. The fact that you see this message means that probably there is more relevant information in the lines before the message. For illustrative purposes I will use a example:

(Reading database ... 81657 files and directories currently installed.)
 Removing mongodb-10gen ...
 arg: remove
 invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.
 dpkg: error processing mongodb-10gen (--remove):
  subprocess installed pre-removal script returned error exit status 100
 invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.
 dpkg: error while cleaning up:
  subprocess installed post-installation script returned error exit status 100
 Errors were encountered while processing:
  mongodb-10gen
 E: Sub-process /usr/bin/dpkg returned an error code (1)

Now, to find the problem, you need to read backwards:

  • E: Sub-process /usr/bin/dpkg returned an error code (1) doesn’t tell me anything useful. So moving on.

  • Errors were encountered while processing: mongodb-10gen just tells me what package have problems. Is useful but not enough.

  • subprocess installed post-installation script returned error exit status 100: this tells me that the script that failed was the postinst, the one executed in post-installation. This will come handy in some situations, but not in this one.

  • dpkg: error while cleaning up: nothing useful here.

  • invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found. BINGO! This tells us that invoke-rc.d, a binary that controls the init script in most Debian-like system, failed. It failed because it couldn’t find the /etc/init.d/mongodb script. This is bad. We need to create it or copy from somewhere else so it starts working again. Reinstalling the package is also normally an option for file not found errors.

    In this case, reporting a bug is not necessary because is probable that we were the ones that removed the script, but if you are completely sure you didn’t touch the file (a debsums -sla should confirm it) then report a bug.

So, what exactly do you need to get help? Ideally, the complete output of the problem. It’s also helpful to include the output of sudo dpkg -C and sudo apt-get check, and the output of apt-cache policy package1 package2... where «package1 package2 …» includes all the packages with problems.

If you are encountering “sub process usr bin dpkg returned an error code 1”  while installing software on Ubuntu Linux, here is how you can fix it.

One of the common issue in Ubuntu and other Debian based distribution is the broken packages. You try to update the system or install a new package and you encounter an error like ‘Sub-process /usr/bin/dpkg returned an error code’.

That’s what happened to me the other day. I was trying to install a radio application in Ubuntu when it threw me this error:

Unpacking python-gst-1.0 (1.6.2-1build1) ...
Selecting previously unselected package radiotray.
Preparing to unpack .../radiotray_0.7.3-5ubuntu1_all.deb ...
Unpacking radiotray (0.7.3-5ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5.2) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20180209-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Setting up polar-bookshelf (1.0.0-beta56) ...
ln: failed to create symbolic link '/usr/local/bin/polar-bookshelf': No such file or directory
dpkg: error processing package polar-bookshelf (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-appindicator (12.10.1+16.04.20170215-0ubuntu1) ...
Setting up python-gst-1.0 (1.6.2-1build1) ...
Setting up radiotray (0.7.3-5ubuntu1) ...
Errors were encountered while processing:
polar-bookshelf
E: Sub-process /usr/bin/dpkg returned an error code (1)

The last three lines are of the utmost importance here.

Errors were encountered while processing:
polar-bookshelf
E: Sub-process /usr/bin/dpkg returned an error code (1)

It tells me that the package polar-bookshelf is causing and issue. This might be crucial to how you fix this error here.

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

Fix update errors in Ubuntu Linux

Let’s try to fix this broken error package. I’ll show several methods that you can try one by one. The initial ones are easy to use and simply no-brainers.

You should try to run sudo apt update and then try to install a new package or upgrade after trying each of the methods discussed here.

Method 1: Reconfigure Package Database

The first method you can try is to reconfigure the package database. Probably the database got corrupted while installing a package. Reconfiguring often fixes the problem.

sudo dpkg --configure -a

Method 2: Use force install

If a package installation was interrupted previously, you may try to do a force install.

sudo apt-get install -f

Method 3: Try removing the troublesome package

If it’s not an issue for you, you may try to remove the package manually. Please don’t do it for Linux Kernels (packages starting with linux-).

sudo apt remove package_name

Method 4: Remove post info files of the troublesome package

This should be your last resort. You can try removing the files associated to the package in question from /var/lib/dpkg/info.

You need to know a little about basic Linux commands to figure out what’s happening and how can you use the same with your problem.

In my case, I had an issue with polar-bookshelf. So I looked for the files associated with it:

ls -l /var/lib/dpkg/info | grep -i polar-bookshelf
-rw-r--r-- 1 root root 2324811 Aug 14 19:29 polar-bookshelf.list
-rw-r--r-- 1 root root 2822824 Aug 10 04:28 polar-bookshelf.md5sums
-rwxr-xr-x 1 root root     113 Aug 10 04:28 polar-bookshelf.postinst
-rwxr-xr-x 1 root root      84 Aug 10 04:28 polar-bookshelf.postrm

Now all I needed to do was to remove these files:

sudo mv /var/lib/dpkg/info/polar-bookshelf.* /tmp

Use the sudo apt update and then you should be able to install software as usual.

Which method worked for you (if it worked)?

Donate Itsfoss

I hope this quick article helps you in fixing the ‘E: Sub-process /usr/bin/dpkg returned an error code (1)’ error. 

If it did work for you, which method was it? Did you manage to fix this error with some other method? If yes, please share that to help others with this issue.

Если вы столкнулись с ошибкой  с «sub process usr bin dpkg returned an error code 1» при установке программного обеспечения на Ubuntu Linux, вот как вы можете это исправить.

Одной из распространенных проблем в Ubuntu и других дистрибутивах на основе Debian являются ломанные пакеты.

Вы пытаетесь обновить систему или установить новый пакет, и столкиваеиесь с такой ошибкой, как «Sub-process /usr/bin/dpkg returned an error code 1.

Вот что случилось на днях.

Я пытался установить радио приложение на Ubuntu, и система вернула мне эту ошибку:

Unpacking python-gst-1.0 (1.6.2-1build1) ...
Selecting previously unselected package radiotray.
Preparing to unpack .../radiotray_0.7.3-5ubuntu1_all.deb ...
Unpacking radiotray (0.7.3-5ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5.2) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20180209-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Setting up polar-bookshelf (1.0.0-beta56) ...
ln: failed to create symbolic link '/usr/local/bin/polar-bookshelf': No such file or directory
dpkg: error processing package polar-bookshelf (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-appindicator (12.10.1+16.04.20170215-0ubuntu1) ...
Setting up python-gst-1.0 (1.6.2-1build1) ...
Setting up radiotray (0.7.3-5ubuntu1) ...
Errors were encountered while processing:
polar-bookshelf
E: Sub-process /usr/bin/dpkg returned an error code (1)

Здесь важны последние три строки:

Errors were encountered while processing:
polar-bookshelf
E: Sub-process /usr/bin/dpkg returned an error code (1)

Это говорит мне, что пакет полярнаяpolar-bookshelf является причиной. Это может иметь решающее значение для устранения этой ошибки.

Решение проблемы Sub-process /usr/bin/dpkg returned an error code (1)

Попробуем исправить этот сломанный пакет.

Я покажу вам несколько методов, которые вы можете попробовать по одному.

Они простые в использовании и просто без проблем осуществимы.

Вы должны попытаться запустить sudo apt update, а затем попытаться установить новый пакет или обновиться после каждого из описанных здесь методов.

Способ 1: переконфигурировать базу данных пакетов

Первый метод, который вы можете попробовать, – перенастроить базу данных пакетов.

Вероятно, база данных повреждена при установке пакета.

Реконфигурация часто устраняет проблему.

sudo dpkg --configure -a

Способ 2: Использовать принудительную установку

Если установка ранее прервалась, вы можете попробовать установить пакет принудительно:

sudo apt-get install -f

Способ 3. Попробуйте удалить проблемный пакет.

sudo apt remove 

Способ 4. Удалите информационные файлы с информацией о проблемном пакете

Это должно быть вашим последним прибежищем.

Вы можете попробовать удалить файлы, связанные с пакетом, из /var/lib/dpkg/info.

Вам нужно немного узнать о базовых командах Linux, чтобы выяснить, что происходит, и как использовать их с вашей проблемой.

В моем случае у меня была проблема с polar-bookhelof.

Поэтому я искал файлы, связанные с ним:

ls -l /var/lib/dpkg/info | grep -i polar-bookshelf
-rw-r--r-- 1 root root 2324811 Aug 14 19:29 polar-bookshelf.list
-rw-r--r-- 1 root root 2822824 Aug 10 04:28 polar-bookshelf.md5sums
-rwxr-xr-x 1 root root     113 Aug 10 04:28 polar-bookshelf.postinst
-rwxr-xr-x 1 root root      84 Aug 10 04:28 polar-bookshelf.postrm

Теперь мне нужно удалить эти файлы:

sudo mv /var/lib/dpkg/info/polar-bookshelf.* /tmp

Environment: Docker Container

Linux Distro: Ubuntu 20.04 LTS

I also had this exact error but for when I was trying to install the Nagios Cross-Platform Agent (NCPA) within my Docker Container environment and whilst executing my custom initialize.sh bash script. Can anyone help me out on which of the daemon services within the /etc/init.d/, I need to configure? and what configuration I need to configure it to?

Thanks a lot in advance!

My bash script output is as follows:

root@a132ae571fae:/var/scripts# apt-get -o DPkg::Options::=--force-confdef install -y ncpa
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  ncpa
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 10.7 MB of archives.
After this operation, 30.6 MB of additional disk space will be used.
Get:1 https://repo.nagios.com/deb/focal  ncpa 2.4.0-1 [10.7 MB]
Fetched 10.7 MB in 2s (5990 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package ncpa.
(Reading database ... 29237 files and directories currently installed.)
Preparing to unpack .../ncpa_2.4.0-1_amd64.deb ...
Unpacking ncpa (2.4.0-1) ...
Setting up ncpa (2.4.0-1) ...

Configuration file '/usr/local/ncpa/etc/ncpa.cfg'
 ==> File on system created by you or by a script.
 ==> File also in package provided by package maintainer.
 ==> Keeping old config file as default.
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
dpkg: error processing package ncpa (--configure):
 installed ncpa package post-installation script subprocess returned error exit status 1
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
Processing triggers for systemd (245.4-4ubuntu3.19) ...
Errors were encountered while processing:
 ncpa
E: Sub-process /usr/bin/dpkg returned an error code (1)

root@a132ae571fae:/etc/init.d# ls -lah
total 84K
drwxrwxr-x 1 root root 4.0K Jan  6 12:22 .
drwxr-xr-x 1 root root 4.0K Jan  6 12:22 ..
-rwxr-xr-x 1 root root 2.5K Feb 23  2021 apache-htcacheclean
-rwxr-xr-x 1 root root 8.0K Feb 23  2021 apache2
-rwxr-xr-x 1 root root 3.0K Feb 11  2020 cron
-rwxr-xr-x 1 root root 3.1K Sep 30  2019 dbus
-rwxr-xr-x 1 root root 3.8K Jul 28  2019 hwclock.sh
-rwxrwxr-x 1 root root  608 Jan  2 15:22 initialize.sh
-rwxr-xr-x 1 root root 6.9K Jan  6 12:07 nagios
-rwxr-xr-x 1 root root 1.6K Jan  6 12:22 ncpa_listener
-rwxr-xr-x 1 root root 1.5K Jan  6 12:22 ncpa_passive
-rwxr-xr-x 1 root root 1.6K Nov 27  2020 ntp
-rwxr-xr-x 1 root root 3.3K Aug 31  2021 postfix
-rwxr-xr-x 1 root root  924 Feb 13  2020 procps
-rwxr-xr-x 1 root root 2.8K Mar  7  2019 rsyslog
-rwxr-xr-x 1 root root 3.9K Mar 30  2022 ssh
-rwxr-xr-x 1 root root 2.1K Jan 21  2020 ufw
-rwxr-xr-x 1 root root 2.7K Jan 20  2017 x11-common

root@a132ae571fae:/var/scripts# ls -lah
total 24K
drwxr-xr-x 1 root root 4.0K Jan  6 12:16 .
drwxr-xr-x 1 root root 4.0K Jan  6 12:09 ..
-rwxrwxr-x 1 root root  806 Jan  6 12:16 initialize.sh
-rwxrwxr-x 1 root root  165 Jan  2 14:53 remove-nologin.sh
root@a132ae571fae:/var/scripts# nano initialize.sh
root@a132ae571fae:/var/scripts#
root@a132ae571fae:/var/scripts# cat initialize.sh
#!/bin/bash
INIT_FLAG="initialized.flag"

if [ ! -f "$INIT_FLAG" ]; then
## Ncpa install (repository and key already added in dockerfile)
  apt-get update
  export DEBIAN_FRONTEND=noninteractive
cd /tmp
dpkg -i dpkg_1.19.7ubuntu3.2_amd64.deb
apt-get update
apt-get install --reinstall dpkg
apt-get -o DPkg::Options::=--force-confdef install -y ncpa
## Set TimeZone to Europe/Amsterdam and Enable & Run Remove No-Login Service
  timedatectl set-timezone Europe/Amsterdam
#  systemctl start remove-nologin.service
#  systemctl enable remove-nologin.service
#rm -rf /var/run/nologin
  service apache2 start
  service nagios start
  service ncpa_listener start
  service ncpa_passive start
  echo "services are up and running!"
exit 1
else
  touch $INIT_FLAG
  echo "services have failed to load!"
exit 0
fi

What I would like to do is to install NCPA using the custom script I had built.

And because I wanted to keep a specific configuration, so that it wouldn’t overwrite it during the default ncpa installation, I did not use the standard apt-get or apt install ncpa parameter.

Instead I used:

apt-get -o DPkg::Options::=--force-confdef install -y ncpa

Thanks for your help in advance guys!

Kind Regards,

Doga

Понравилась статья? Поделить с друзьями:
  • Installed initramfs tools package post installation script subprocess returned error exit status 1
  • Installed grub pc package post installation script subprocess returned error exit status 1
  • Installed error invalid archive
  • Installed docker ce package post installation script subprocess returned error exit status 1
  • Installed bbswitch dkms package post installation script subprocess returned error exit status 10