Category Archives: apt

Trying to install Apache2 on a debian server, getting errors about dpkg

So, when I try to install apache it tells me to run apt-get install -f first. Okay, I do, but when I do that I get..

[email protected]:/# sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  linux-image-4.4.0-62-generic
Suggested packages:
  fdutils linux-doc-4.4.0 | linux-source-4.4.0 linux-tools
The following NEW packages will be installed:
  linux-image-4.4.0-62-generic
0 upgraded, 1 newly installed, 0 to remove and 110 not upgraded.
3 not fully installed or removed.
Need to get 21.3 MB of archives.
After this operation, 64.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://mirrors.service.networklayer.com/ubuntu xenial-updates/main amd64 linux-image-4.4.0-62-generic amd64 4.4.0-62.83 [21.3 MB]
Fetched 21.3 MB in 2s (8,347 kB/s)
(Reading database ... 329994 files and directories currently installed.)
Preparing to unpack .../linux-image-4.4.0-62-generic_4.4.0-62.83_amd64.deb ...
Done.
Unpacking linux-image-4.4.0-62-generic (4.4.0-62.83) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-4.4.0-62-generic_4.4.0-62.83_amd64.deb (--unpack):
 cannot copy extracted data for './boot/System.map-4.4.0-62-generic' to '/boot/System.map-4.4.0-62-generic.dpkg-new': failed to write (No space left on device)
No apport report written because the error message indicates a disk full error
                                                                              dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-62-generic /boot/vmlinuz-4.4.0-62-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-62-generic /boot/vmlinuz-4.4.0-62-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-4.4.0-62-generic_4.4.0-62.83_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
[email protected]:/#

The server is new, and when I look at the space on the server, theres space. Is this a permissions error? Im not sure where to start on this

Ubuntu php extension missing, but I have installed

I am getting a "the requested PHP extension intl is missing from your system" when I am running composer on Ubuntu. I have however installed this extension with

sudo apt-get install php5-intl

It is installed because when I try and install it says it already has the latest version.

I installed a later version of PHP. Could that have something to do with it? When I run "php -m" I do not see INTL as one of the enabled extensions. It is loading the latest PHP version though.

Thanks in advance

Ubuntu php extension missing, but I have installed

I am getting a "the requested PHP extension intl is missing from your system" when I am running composer on Ubuntu. I have however installed this extension with

sudo apt-get install php5-intl

It is installed because when I try and install it says it already has the latest version.

I installed a later version of PHP. Could that have something to do with it? When I run "php -m" I do not see INTL as one of the enabled extensions. It is loading the latest PHP version though.

Thanks in advance

Ubuntu php extension missing, but I have installed

I am getting a "the requested PHP extension intl is missing from your system" when I am running composer on Ubuntu. I have however installed this extension with

sudo apt-get install php5-intl

It is installed because when I try and install it says it already has the latest version.

I installed a later version of PHP. Could that have something to do with it? When I run "php -m" I do not see INTL as one of the enabled extensions. It is loading the latest PHP version though.

Thanks in advance

Ubuntu php extension missing, but I have installed

I am getting a "the requested PHP extension intl is missing from your system" when I am running composer on Ubuntu. I have however installed this extension with

sudo apt-get install php5-intl

It is installed because when I try and install it says it already has the latest version.

I installed a later version of PHP. Could that have something to do with it? When I run "php -m" I do not see INTL as one of the enabled extensions. It is loading the latest PHP version though.

Thanks in advance

Error installing apache 2 in ubantu 14.04: dpkg:- error processing package javascript-common (–configure):

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-

[email protected]:~$ 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.

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

Only God knows why I stupidly deleted php and apache2 from my ubuntu 14.04. First manually and then from terminal as well using several online tutorials and then when I tried to reinstall php, many php modules were installed while leaving some and this is what error I got when I tried to install php5-mysql

**sudo apt-get install php5-mysql**

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  php5-cli php5-readline
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  php5-mysql
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/59.4 kB of archives.
After this operation, 264 kB of additional disk space will be used.
Selecting previously unselected package php5-mysql.
(Reading database ... 585716 files and directories currently installed.)
Preparing to unpack .../php5-mysql_5.5.9+dfsg-1ubuntu4.5_i386.deb ...
Unpacking php5-mysql (5.5.9+dfsg-1ubuntu4.5) ...
Processing triggers for libapache2-mod-php5filter (5.5.9+dfsg-1ubuntu4.5) ...
Setting up libapache2-mod-jk (1:1.2.37-3) ...
dpkg: error processing package libapache2-mod-jk (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up php5-mysql (5.5.9+dfsg-1ubuntu4.5) ...
php5_invoke: Enable module mysql for apache2filter SAPI
php5_invoke: Enable module mysql for cli SAPI
php5_invoke: Enable module mysql for cgi SAPI
php5_invoke: Enable module mysqli for apache2filter SAPI
php5_invoke: Enable module mysqli for cli SAPI
php5_invoke: Enable module mysqli for cgi SAPI
php5_invoke: Enable module pdo_mysql for apache2filter SAPI
php5_invoke: Enable module pdo_mysql for cli SAPI
php5_invoke: Enable module pdo_mysql for cgi SAPI
Processing triggers for libapache2-mod-php5filter (5.5.9+dfsg-1ubuntu4.5) ...
E: Sub-process /usr/bin/dpkg returned an error code (1)

Also my sources.list was broken but I repaired it thanks to stackoverflow.

So from ubuntu software center I tried to uninstall php5-cli this is what I got

installArchives() failed: (Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 585726 files and directories currently installed.)
Removing php5-readline (5.5.9+dfsg-1ubuntu4.5) ...
php5_invoke prerm: Disable module readline for apache2filter SAPI
php5_invoke prerm: Disable module readline for cli SAPI
php5_invoke prerm: Disable module readline for cgi SAPI
Removing php5-cli (5.5.9+dfsg-1ubuntu4.5) ...
php5_invoke prerm: Disable module mysqli for cli SAPI
php5_invoke prerm: Disable module pdo for cli SAPI
php5_invoke prerm: Disable module opcache for cli SAPI
php5_invoke prerm: Disable module pdo_mysql for cli SAPI
php5_invoke prerm: Disable module mysql for cli SAPI
php5_invoke prerm: Disable module json for cli SAPI
Processing triggers for libapache2-mod-php5filter (5.5.9+dfsg-1ubuntu4.5) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up libapache2-mod-jk (1:1.2.37-3) ...
dpkg: error processing package libapache2-mod-jk (--configure):
 subprocess installed post-installation script returned error exit status 1
Error in function: 
Setting up libapache2-mod-jk (1:1.2.37-3) ...
dpkg: error processing package libapache2-mod-jk (--configure):
 subprocess installed post-installation script returned error exit status 1

Update 1:

Output of sudo dpkg --configure --pending

Setting up libapache2-mod-jk (1:1.2.37-3) ...
dpkg: error processing package libapache2-mod-jk (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 libapache2-mod-jk

Update 2:

Output of sudo bash -x /var/lib/dpkg/info/libapache2-mod-jk.postinst .

+ set -e
+ true
+ '[' -e /usr/share/apache2/apache2-maintscript-helper ']'
+ . /usr/share/apache2/apache2-maintscript-helper
++ '[' -n '' ']'
++ EXPORT_APACHE2_MAINTSCRIPT_HELPER=1
++ '[' -n '' ']'
++ '[' -e /etc/apache2/envvars ']'
+++ . /etc/apache2/envvars
++++ unset HOME
++++ '[' '' '!=' '' ']'
++++ SUFFIX=
++++ export APACHE_RUN_USER=www-data
++++ APACHE_RUN_USER=www-data
++++ export APACHE_RUN_GROUP=www-data
++++ APACHE_RUN_GROUP=www-data
++++ export APACHE_PID_FILE=/var/run/apache2/apache2.pid
++++ APACHE_PID_FILE=/var/run/apache2/apache2.pid
++++ export APACHE_RUN_DIR=/var/run/apache2
++++ APACHE_RUN_DIR=/var/run/apache2
++++ export APACHE_LOCK_DIR=/var/lock/apache2
++++ APACHE_LOCK_DIR=/var/lock/apache2
++++ export APACHE_LOG_DIR=/var/log/apache2
++++ APACHE_LOG_DIR=/var/log/apache2
++++ export LANG=C
++++ LANG=C
++++ export LANG
+++ echo
++ APACHE2_MAINTSCRIPT_DEBUG=
++ '[' -n '' ']'
++ '[' -z . ']'
++ APACHE2_MAINTSCRIPT_NAME=
++ '[' '' ']'
++ APACHE2_MAINTSCRIPT_NAME=postinst
++ case "$APACHE2_MAINTSCRIPT_NAME" in
++ APACHE2_MAINTSCRIPT_PACKAGE=
++ '[' -z '' ']'
++ APACHE2_MAINTSCRIPT_PACKAGE=libapache2-mod-jk.postinst
++ APACHE2_MAINTSCRIPT_PACKAGE=libapache2-mod-jk
++ '[' -z '' ']'
++ APACHE2_MAINTSCRIPT_METHOD=.
++ case "$APACHE2_MAINTSCRIPT_METHOD" in
++ echo 'apache2-maintscript-helper invoked from a modified environment. Please hint required arguments manually'
apache2-maintscript-helper invoked from a modified environment. Please hint required arguments manually
++ return 1

Update 3: Now no what matter what I try to install I get this crap error e.g. sudo apt-get install libapache2-mod-jk

Reading package lists... Done
Building dependency tree       
Reading state information... Done
libapache2-mod-jk is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 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 libapache2-mod-jk (1:1.2.37-3) ...
dpkg: error processing package libapache2-mod-jk (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up libapache2-mod-php5 (5.5.9+dfsg-1ubuntu4.5) ...
php5_invoke mysqli: already enabled for apache2 SAPI
php5_invoke pdo: already enabled for apache2 SAPI
php5_invoke opcache: already enabled for apache2 SAPI
php5_invoke pdo_mysql: already enabled for apache2 SAPI
php5_invoke snmp: already enabled for apache2 SAPI
php5_invoke mysql: already enabled for apache2 SAPI
php5_invoke readline: already enabled for apache2 SAPI
php5_invoke json: already enabled for apache2 SAPI
php5_invoke curl: already enabled for apache2 SAPI
dpkg: error processing package libapache2-mod-php5 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 libapache2-mod-jk
 libapache2-mod-php5
E: Sub-process /usr/bin/dpkg returned an error code (1)

In short, I tried many tutorials/forum/helps but nothing is solving the error. Please guide.

Python error: could not find a distribution template. when add-apt-repository

I am trying to upgrade php version on a pcduino3. I follow these instructions -> Upgrading PHP. But when trying to do add-apt-repository ppa:ondrej/php5 I get this python error.

Traceback (most recent call last):
File "/usr/bin/add-apt-repository", line 185, in <module>
   sp = SoftwareProperties(options=options)
File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 97, in __init__
   self.reload_sourceslist()
File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 585, in reload_sourceslist
   self.distro.get_sources(self.sourceslist)
File "/usr/lib/python2.7/dist-packages/aptsources/distro.py", line 87, in get_sources
   raise NoDistroTemplateException("Error: could not find a "
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template

Is there a way to fix this error?

@muradin suggested that it might be a duplicate of this question. So I looked in my /etc/lsb-release file and it looks like this:

DISTRIB_ID=Linaro
DISTRIB_RELEASE=12.11
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Linaro 12.11"