2

I launch apt-get, with sudo apt-get install apache2, it provides this:

The following extra packages will be installed:
   apache2
Suggested packages:
   apache2-doc apache2-suexec-pristine apache2-suexec-custom apache2-utils
The following NEW packages will be installed:
   apache2
0 upgraded, 1 newly installed, 0 to remove and 435 not upgraded.
11 not fully installed or removed.
Need to get 192 kB of archives.
After this operation, 503 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ftp.us.debian.org/debian/ jessie/main apache2 amd64 2.4.7-1 [192 kB]
Fetched 192 kB in 0s (242 kB/s)  
(Reading database ... 266945 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.7-1_amd64.deb ...
/var/lib/dpkg/tmp.ci/preinst: line 118: a2query: command not found
dpkg: error processing archive /var/cache/apt/archives/apache2_2.4.7-1_amd64.deb (--unpack):
    subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
    /var/cache/apt/archives/apache2_2.4.7-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've looked into a2query but can't find anything about it.

2 Answers 2

4

A post on ctheroux shows how to resolve the problem. Basically, run the following as root:

dpkg --fsys-tarfile /var/cache/apt/archives/apache2_2.4.7-1ubuntu4_amd64.deb | tar xOf - ./usr/sbin/a2query > /usr/sbin/a2query
chmod 755 /usr/sbin/a2query
1
  • 1
    Changed the awnser because you provide a way to do it programmatically. Thanks! Feb 25, 2015 at 20:09
3

a2query is inside the apache2 package itself you're trying to install but it's required in the preinstall stage, this is indeed quite awkward.

looking at the preinstall stage the a2query is run if the package thinks that you're doing an upgrade actually from Squeeze. There are a few checks to realize this is happening and the first (and easiest) of them is to check for the existance of "/etc/apache2" directory. I'd suppose that maybe you have that directory for some reason on your system so I'd suggest as first thing to delete (or rename) /etc/apache2 if it's present on your system.

Otherwise you could manually extract for now the /usr/sbin/a2query from the .deb to your system and try going that way.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .