error 1

Asked by Walter Frey

walter@walterslaptop:~$ ubuntu-support-status
Riepilogo supporto per «walterslaptop»:

Traceback (most recent call last):
  File "/usr/bin/ubuntu-support-status", line 149, in <module>
    'time' : time})
TypeError: not enough arguments for format string
walter@walterslaptop:~$ cat /etc/dpkg/dpkg.cfg.d/multiarch
cat: /etc/dpkg/dpkg.cfg.d/multiarch: File o directory non esistente
walter@walterslaptop:~$ dpkg --print-foreign-architectures
walter@walterslaptop:~$ sudo grep -R proxy /etc/apt/*
[sudo] password for walter:
walter@walterslaptop:~$ grep proxy /etc/environment
walter@walterslaptop:~$ echo $http_proxy

walter@walterslaptop:~$ echo $ftp_proxy

walter@walterslaptop:~$ grep proxy /etc/bash.bashrc
walter@walterslaptop:~$ grep proxy ~/.bashrc
walter@walterslaptop:~$ cat /etc/apt/apt.conf
cat: /etc/apt/apt.conf: File o directory non esistente
walter@walterslaptop:~$ sudo fuser -vvv /var/lib/dpkg/lock
walter@walterslaptop:~$ sudo fuser -vvv /var/cache/apt/archives/lock
walter@walterslaptop:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04 LTS"
walter@walterslaptop:~$ uname -a
Linux walterslaptop 3.13.0-30-generic #54-Ubuntu SMP Mon Jun 9 22:47:59 UTC 2014 i686 i686 i686 GNU/Linux
walter@walterslaptop:~$ sudo rm /var/lib/apt/lists/lock
walter@walterslaptop:~$ sudo rm /var/cache/apt/archives/lock
walter@walterslaptop:~$ sudo rm /var/lib/dpkg/lock
walter@walterslaptop:~$ sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
walter@walterslaptop:~$ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
walter@walterslaptop:~$ sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status || sudo cp /var/backups/apt.extended_states.0 /var/lib/dpkg/status
walter@walterslaptop:~$ sudo mv /var/lib/dpkg/available /var/lib/dpkg/available-bad
walter@walterslaptop:~$ sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
walter@walterslaptop:~$
walter@walterslaptop:~$ sudo rm -rf /var/lib/dpkg/updates/*
walter@walterslaptop:~$ sudo rm -rf /var/lib/apt/lists
walter@walterslaptop:~$ sudo rm /var/cache/apt/*.bin
walter@walterslaptop:~$ sudo mkdir /var/lib/apt/lists
walter@walterslaptop:~$ sudo mkdir /var/lib/apt/lists/partial
walter@walterslaptop:~$ LANG=C;sudo apt-get clean
walter@walterslaptop:~$ LANG=C;sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
walter@walterslaptop:~$ LANG=C;sudo apt-get --purge autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 libapache2-mod-php5 : Depends: apache2 (>= 2.4) but it is not installable
E: Unmet dependencies. Try using -f.
walter@walterslaptop:~$ LANG=C;sudo apt-get --fix-missing update -o APT::Cache-Limit=100000000
Ign http://security.ubuntu.com trusty-security InRelease
Get:1 http://security.ubuntu.com trusty-security Release.gpg [933 B]
Get:2 http://security.ubuntu.com trusty-security Release [58.5 kB]
Get:3 http://security.ubuntu.com trusty-security/main Sources [30.2 kB]
Get:4 http://security.ubuntu.com trusty-security/universe Sources [5763 B]
Get:5 http://security.ubuntu.com trusty-security/main i386 Packages [101 kB]
Get:6 http://security.ubuntu.com trusty-security/universe i386 Packages [34.8 kB]
Get:7 http://security.ubuntu.com trusty-security/main Translation-en [49.1 kB]
Get:8 http://security.ubuntu.com trusty-security/universe Translation-en [18.9 kB]
Ign http://ch.archive.ubuntu.com trusty InRelease
Ign http://ch.archive.ubuntu.com trusty-updates InRelease
Get:9 http://ch.archive.ubuntu.com trusty Release.gpg [933 B]
Get:10 http://ch.archive.ubuntu.com trusty-updates Release.gpg [933 B]
Get:11 http://ch.archive.ubuntu.com trusty Release [58.5 kB]
Get:12 http://ch.archive.ubuntu.com trusty-updates Release [58.5 kB]
Get:13 http://ch.archive.ubuntu.com trusty/main Sources [1064 kB]
Get:14 http://ch.archive.ubuntu.com trusty/universe Sources [6399 kB]
Get:15 http://ch.archive.ubuntu.com trusty/main i386 Packages [1348 kB]
Get:16 http://ch.archive.ubuntu.com trusty/universe i386 Packages [5866 kB]
Get:17 http://ch.archive.ubuntu.com trusty/main Translation-en [762 kB]
Get:18 http://ch.archive.ubuntu.com trusty/universe Translation-en [4089 kB]
Get:19 http://ch.archive.ubuntu.com trusty-updates/main Sources [77.7 kB]
Get:20 http://ch.archive.ubuntu.com trusty-updates/universe Sources [54.8 kB]
Get:21 http://ch.archive.ubuntu.com trusty-updates/main i386 Packages [202 kB]
Get:22 http://ch.archive.ubuntu.com trusty-updates/universe i386 Packages [142 kB]
Get:23 http://ch.archive.ubuntu.com trusty-updates/main Translation-en [92.4 kB]
Get:24 http://ch.archive.ubuntu.com trusty-updates/universe Translation-en [68.7 kB]
Fetched 20.6 MB in 22s (932 kB/s)
Reading package lists... Done
walter@walterslaptop:~$ sudo dpkg --configure -a
Setting up libwbclient0:i386 (2:4.1.6+dfsg-1ubuntu2.14.04.2) ...
Setting up libgphoto2-port10:i386 (2.5.3.1-1ubuntu2.2) ...
Setting up samba-libs:i386 (2:4.1.6+dfsg-1ubuntu2.14.04.2) ...
Setting up python-samba (2:4.1.6+dfsg-1ubuntu2.14.04.2) ...
Setting up samba-vfs-modules (2:4.1.6+dfsg-1ubuntu2.14.04.2) ...
Setting up samba-common (2:4.1.6+dfsg-1ubuntu2.14.04.2) ...
Setting up samba-common-bin (2:4.1.6+dfsg-1ubuntu2.14.04.2) ...
Setting up libgphoto2-6:i386 (2.5.3.1-1ubuntu2.2) ...
dpkg: dependency problems prevent configuration of libapache2-mod-php5:
 libapache2-mod-php5 depends on apache2 (>= 2.4); however:
  Package apache2 is not installed.

dpkg: error processing package libapache2-mod-php5 (--configure):
 dependency problems - leaving unconfigured
Setting up samba-dsdb-modules (2:4.1.6+dfsg-1ubuntu2.14.04.2) ...
Setting up libsmbclient:i386 (2:4.1.6+dfsg-1ubuntu2.14.04.2) ...
Setting up smbclient (2:4.1.6+dfsg-1ubuntu2.14.04.2) ...
Setting up samba (2:4.1.6+dfsg-1ubuntu2.14.04.2) ...
samba-ad-dc start/running, process 5668
Processing triggers for libc-bin (2.19-0ubuntu6) ...
Errors were encountered while processing:
 libapache2-mod-php5
walter@walterslaptop:~$ sudo dpkg --clear-avail
walter@walterslaptop:~$ LANG=C;sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
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 12 not upgraded.
1 not fully installed or removed.
Need to get 87.4 kB of archives.
After this operation, 473 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ch.archive.ubuntu.com/ubuntu/ trusty/main apache2 i386 2.4.7-1ubuntu4 [87.4 kB]
Fetched 87.4 kB in 0s (226 kB/s)
(Reading database ... 280532 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.7-1ubuntu4_i386.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-1ubuntu4_i386.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-1ubuntu4_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
walter@walterslaptop:~$ LANG=C;sudo apt-get --fix-missing install
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 libapache2-mod-php5 : Depends: apache2 (>= 2.4) but it is not installed
E: Unmet dependencies. Try using -f.
walter@walterslaptop:~$ LANG=C;sudo apt-get update -o APT::Cache-Limit=100000000 && sudo apt-get dist-upgrade
Ign http://ch.archive.ubuntu.com trusty InRelease
Ign http://ch.archive.ubuntu.com trusty-updates InRelease
Hit http://ch.archive.ubuntu.com trusty Release.gpg
Hit http://ch.archive.ubuntu.com trusty-updates Release.gpg
Hit http://ch.archive.ubuntu.com trusty Release
Hit http://ch.archive.ubuntu.com trusty-updates Release
Hit http://ch.archive.ubuntu.com trusty/main Sources
Hit http://ch.archive.ubuntu.com trusty/universe Sources
Hit http://ch.archive.ubuntu.com trusty/main i386 Packages
Ign http://security.ubuntu.com trusty-security InRelease
Hit http://ch.archive.ubuntu.com trusty/universe i386 Packages
Hit http://ch.archive.ubuntu.com trusty/main Translation-en
Hit http://ch.archive.ubuntu.com trusty/universe Translation-en
Hit http://ch.archive.ubuntu.com trusty-updates/main Sources
Hit http://ch.archive.ubuntu.com trusty-updates/universe Sources
Hit http://security.ubuntu.com trusty-security Release.gpg
Hit http://ch.archive.ubuntu.com trusty-updates/main i386 Packages
Hit http://ch.archive.ubuntu.com trusty-updates/universe i386 Packages
Hit http://ch.archive.ubuntu.com trusty-updates/main Translation-en
Hit http://ch.archive.ubuntu.com trusty-updates/universe Translation-en
Hit http://security.ubuntu.com trusty-security Release
Hit http://security.ubuntu.com trusty-security/main Sources
Hit http://security.ubuntu.com trusty-security/universe Sources
Hit http://security.ubuntu.com trusty-security/main i386 Packages
Hit http://security.ubuntu.com trusty-security/universe i386 Packages
Hit http://security.ubuntu.com trusty-security/main Translation-en
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 libapache2-mod-php5 : Depends: apache2 (>= 2.4) but it is not installed
E: Unmet dependencies. Try using -f.
walter@walterslaptop:~$ find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;

/etc/apt/sources.list

     1 # deb cdrom:[Ubuntu 12.10 _Quantal Quetzal_ - Release i386 (20121017.2)]/ quantal main restricted
     2
     3 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
     4 # newer versions of the distribution.
     5 deb http://ch.archive.ubuntu.com/ubuntu/ trusty main universe
     6 deb-src http://ch.archive.ubuntu.com/ubuntu/ trusty main universe
     7
     8 ## Major bug fix updates produced after the final release of the
     9 ## distribution.
    10 deb http://ch.archive.ubuntu.com/ubuntu/ trusty-updates main universe
    11 deb-src http://ch.archive.ubuntu.com/ubuntu/ trusty-updates main universe
    12
    13 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    14 ## team. Also, please note that software in universe WILL NOT receive any
    15 ## review or updates from the Ubuntu security team.
    16
    17 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    18 ## team, and may not be under a free licence. Please satisfy yourself as to
    19 ## your rights to use the software. Also, please note that software in
    20 ## multiverse WILL NOT receive any review or updates from the Ubuntu
    21 ## security team.
    22
    23 ## N.B. software from this repository may not have been tested as
    24 ## extensively as that contained in the main release, although it includes
    25 ## newer versions of some applications which may provide useful features.
    26 ## Also, please note that software in backports WILL NOT receive any review
    27 ## or updates from the Ubuntu security team.
    28
    29 deb http://security.ubuntu.com/ubuntu trusty-security main universe
    30 deb-src http://security.ubuntu.com/ubuntu trusty-security main universe
    31
    32 ## Uncomment the following two lines to add software from Canonical's
    33 ## 'partner' repository.
    34 ## This software is not part of Ubuntu, but is offered by Canonical and the
    35 ## respective vendors as a service to Ubuntu users.
    36 # deb http://archive.canonical.com/ubuntu quantal partner
    37 # deb-src http://archive.canonical.com/ubuntu quantal partner
    38
    39 ## This software is not part of Ubuntu, but is offered by third-party
    40 ## developers who want to ship their latest software.
    41 # deb http://extras.ubuntu.com/ubuntu trusty main
    42 # deb-src http://extras.ubuntu.com/ubuntu trusty main
walter@walterslaptop:~$ ^C
walter@walterslaptop:~$

Question information

Revision history for this message
Manfred Hampl (m-hampl) said :
#1

The important part of your output is this:

Get:1 http://ch.archive.ubuntu.com/ubuntu/ trusty/main apache2 i386 2.4.7-1ubuntu4 [87.4 kB]
Fetched 87.4 kB in 0s (226 kB/s)
(Reading database ... 280532 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.7-1ubuntu4_i386.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-1ubuntu4_i386.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-1ubuntu4_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

This is strange, because the a2query script should be included in the apache2 package.

Please provide the result of the terminal command
echo $PATH

Revision history for this message
Walter Frey (wfm) said :
#2

walter@walterslaptop:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
walter@walterslaptop:~$

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

Seems to be bug #1310811

Just a guess: At the moment that the preinst script is executed, the executable /usr/sbin/a2query does not yet exist, making the script fail. I guess the text snippet "CUR_MPM=$(a2query -M) || exit 1" would have to be put inside an "if [ -x '/usr/sbin/a2query' ]" branch

Revision history for this message
Walter Frey (wfm) said :
#4

I could solve problem with the following instructions:
http://askubuntu.com/questions/187958/apt-get-f... (attachment)

I removed the block concerning <apache2> in /var/lib/dpkg/status

This mean that have uninstalled <apache2>.
Since I'm working with <xampp>, I think it's fine for me.

Best regards
Walter Frey

Il 01. 07. 14 12:56, Manfred Hampl ha scritto:
> Your question #251022 on apt in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/apt/+question/251022
>
> Status: Open => Needs information
>
> Manfred Hampl requested more information:
> The important part of your output is this:
>
> Get:1 http://ch.archive.ubuntu.com/ubuntu/ trusty/main apache2 i386 2.4.7-1ubuntu4 [87.4 kB]
> Fetched 87.4 kB in 0s (226 kB/s)
> (Reading database ... 280532 files and directories currently installed.)
> Preparing to unpack .../apache2_2.4.7-1ubuntu4_i386.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-1ubuntu4_i386.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-1ubuntu4_i386.deb
> E: Sub-process /usr/bin/dpkg returned an error code (1)
>
> This is strange, because the a2query script should be included in the
> apache2 package.
>
> Please provide the result of the terminal command
> echo $PATH
>

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

Manually editing /var/lib/dpkg/status is not recommended (there is the potential to completely break the package management system with such action) and should be done only as the very last resort. A better way to remove the half-installed apache2 package would have been with the command "sudo dpkg --purge apache2".

Revision history for this message
Danny Korpan (citydweller) said :
#6

Ist dein Problem noch vorhanden?

Can you help with this problem?

Provide an answer of your own, or ask Walter Frey for more information if necessary.

To post a message you must log in.