Comment réinstaller apache2 sur Debian 7

Bonjour,

Tout d’abord, veuillez m’excuser pour d’éventuelles questions de noob, je débute.

Je suis sur Debian 7 ARM, et alors que je souhaitais installer php 5.6 sur ma Debian, j’ai souhaité passer par les depots testing (en suivant ce http://www.binarytides.com/enable-testing-repo-debian/). J’ai manifestement fait des bêtises et le service apache ne parvenais plus à se lancer.
J’ai donc décidé de supprimer apache2, les packets php5 installés pour réinstaller les packets stable. Or je n’y parviens pas.

J’ai l’erreur : command symlink_to_dir is unknown

[code]# apt-get --reinstall install apache2
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
apache2-mpm-prefork apache2-utils apache2.2-common
Suggested packages:
www-browser apache2-doc apache2-suexec apache2-suexec-custom
Recommended packages:
ssl-cert
The following NEW packages will be installed:
apache2-mpm-prefork apache2-utils apache2.2-common
0 upgraded, 3 newly installed, 1 reinstalled, 0 to remove and 5 not upgraded.
2 not fully installed or removed.
Need to get 465 kB of archives.
After this operation, 944 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://apt.readynas.com/packages/readynasos/ 6.2.2/main apache2-utils armel 2.2.29-0.netgear2 [170 kB]
Get:2 http://apt.readynas.com/packages/readynasos/ 6.2.2/main apache2.2-common armel 2.2.29-0.netgear2 [291 kB]
Get:3 http://apt.readynas.com/packages/readynasos/ 6.2.2/main apache2-mpm-prefork armel 2.2.29-0.netgear2 [2,342 B]
Get:4 http://apt.readynas.com/packages/readynasos/ 6.2.2/main apache2 armel 2.2.29-0.netgear2 [1,434 B]
Fetched 465 kB in 2s (172 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package apache2-utils.
(Reading database … 16315 files and directories currently installed.)
Unpacking apache2-utils (from …/apache2-utils_2.2.29-0.netgear2_armel.deb) …
Selecting previously unselected package apache2.2-common.
Unpacking apache2.2-common (from …/apache2.2-common_2.2.29-0.netgear2_armel.deb) …
Selecting previously unselected package apache2-mpm-prefork.
Unpacking apache2-mpm-prefork (from …/apache2-mpm-prefork_2.2.29-0.netgear2_armel.deb) …
Selecting previously unselected package apache2.
Preparing to replace apache2 2.2.29-0.netgear2 (using …/apache2_2.2.29-0.netgear2_armel.deb) …
Unpacking replacement apache2 …
dpkg-maintscript-helper: error: command symlink_to_dir is unknown
Hint: upgrading dpkg to a newer version might help.

Usage: dpkg-maintscript-helper … – …

Commands:
supports
Returns 0 (success) if the given command is supported, 1 otherwise.
rm_conffile [ []]
Remove obsolete conffile. Must be called in preinst, postinst and
postrm.
mv_conffile [ []]
Rename a conffile. Must be called in preinst, postinst and postrm.
help
Display this usage information.
dpkg: warning: subprocess old post-removal script returned error exit status 1
dpkg: trying script from the new package instead …
dpkg: error processing /var/cache/apt/archives/apache2_2.2.29-0.netgear2_armel.deb (–unpack):
there is no script in the new version of the package - giving up
Errors were encountered while processing:
/var/cache/apt/archives/apache2_2.2.29-0.netgear2_armel.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
[/code]

# apt-get -t testing install dpkg
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apache2-mpm-prefork apache2-utils apache2.2-common
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  fontconfig fontconfig-config libfontconfig1 libselinux1
The following packages will be REMOVED:
  apache2
The following packages will be upgraded:
  dpkg fontconfig fontconfig-config libfontconfig1 libselinux1
5 upgraded, 0 newly installed, 1 to remove and 246 not upgraded.
5 not fully installed or removed.
Need to get 0 B/3,926 kB of archives.
After this operation, 684 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 16776 files and directories currently installed.)
Removing apache2 ...
dpkg-maintscript-helper: error: command symlink_to_dir is unknown
Hint: upgrading dpkg to a newer version might help.

Usage: dpkg-maintscript-helper <command> <parameter>... -- <maintainer-script-parameter>...

Commands:
  supports <command>
        Returns 0 (success) if the given command is supported, 1 otherwise.
  rm_conffile <conffile> [<last-version> [<package>]]
        Remove obsolete conffile. Must be called in preinst, postinst and
        postrm.
  mv_conffile <old-conf> <new-conf> [<last-version> [<package>]]
        Rename a conffile. Must be called in preinst, postinst and postrm.
  help
        Display this usage information.
dpkg: error processing apache2 (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 apache2
E: Sub-process /usr/bin/dpkg returned an error code (1)

A noter que le service apache2 n’est pas reconnu :

# service apache2 stop apache2: unrecognized service

Je suis totalement incompétent pour réparer ces erreurs. Avez-vous une idée ?
L’erreur semble connue, mais je ne comprends pas comment la résoudre https://lists.debian.org/debian-devel/2014/11/msg00108.html
Merci

Personne n’aurait une petite idée ? Me dire là où je pourrais chercher, des trucs à tenter :question:

Salut,

Le contenu du fichier [mono]/etc/apt/sources.list[/mono] est ?

Le répertoire [mono]/etc/apt/[/mono] sur la foi de [mono]$ ls -laR …[/mono], nous révèle ?

En prime, [mono]$ dpkg -l | grep apache2[/mono] && [mono]$ dpkg -l | grep php[/mono] ?

Merci pour ta réponse. Voici les résultats :

[code]# cat /etc/apt/sources.list
deb http://apt.readynas.com/packages/readynasos 6.2.2 updates apps main

deb http://mirrors.kernel.org/debian wheezy main
deb http://security.debian.org/ wheezy/updates main

deb http://http.us.debian.org/debian jessie main
deb http://security.debian.org/ jessie/updates main
[/code]

[code]# ls -laR /etc/apt/
/etc/apt/:
total 44
drwxr-xr-x 6 root root 4096 Jan 11 18:53 .
drwxr-xr-x 86 root root 4096 Jan 11 22:24 …
drwxr-xr-x 2 root root 4096 Jan 11 18:53 apt.conf.d
-rw-r–r-- 1 root root 158 Jan 11 17:45 preferences
drwxr-xr-x 2 115 guest 4096 Jan 11 18:53 preferences.d
-rw-r–r-- 1 115 guest 276 Jan 11 19:27 sources.list
drwxr-xr-x 2 root root 4096 Oct 16 2012 sources.list.d
-rw------- 1 root root 1200 Nov 17 2012 trustdb.gpg
-rw------- 1 root root 1201 Nov 27 2012 trusted.gpg
-rw------- 1 root root 1201 Nov 27 2012 trusted.gpg~
drwxr-xr-x 2 root root 4096 Jan 11 18:53 trusted.gpg.d

/etc/apt/apt.conf.d:
total 20
drwxr-xr-x 2 root root 4096 Jan 11 18:53 .
drwxr-xr-x 6 root root 4096 Jan 11 18:53 …
-rw-r–r-- 1 root root 643 Sep 17 21:25 01autoremove
-rw-r–r-- 1 root root 182 Aug 13 2012 70debconf
-rw-r–r-- 1 115 guest 116 Aug 1 2013 99readynas

/etc/apt/preferences.d:
total 12
drwxr-xr-x 2 115 guest 4096 Jan 11 18:53 .
drwxr-xr-x 6 root root 4096 Jan 11 18:53 …
-rw-r–r-- 1 115 guest 58 Aug 1 2013 readynasos

/etc/apt/sources.list.d:
total 8
drwxr-xr-x 2 root root 4096 Oct 16 2012 .
drwxr-xr-x 6 root root 4096 Jan 11 18:53 …

/etc/apt/trusted.gpg.d:
total 28
drwxr-xr-x 2 root root 4096 Jan 11 18:53 .
drwxr-xr-x 6 root root 4096 Jan 11 18:53 …
-rw-r–r-- 1 root root 2775 Oct 5 23:08 debian-archive-jessie-stable.gpg
-rw-r–r-- 1 root root 4084 Jun 2 2012 debian-archive-squeeze-automatic.gpg
-rw-r–r-- 1 root root 2853 Jun 2 2012 debian-archive-squeeze-stable.gpg
-rw-r–r-- 1 root root 3780 Jun 2 2012 debian-archive-wheezy-automatic.gpg
-rw-r–r-- 1 root root 2851 Jun 2 2012 debian-archive-wheezy-stable.gpg
[/code]

#dpkg -l | grep apache2 rH apache2 2.2.29-0.netgear2 armel Apache HTTP Server metapackage rc apache2-bin 2.4.10-9 armel Apache HTTP Server (modules and other binary files) pF apache2.2-bin 2.2.29-0.netgear2 armel Apache HTTP Server common binary files rc libapache2-mod-auth-token 1.0.6 armel mod_auth_token is a famous apache module that allows you to rc libapache2-mod-authnz-external 3.2.6-1.netgear1 armel authenticate Apache against external authentication services rc libapache2-mod-authz-unixgroup 1.0.3-1.netgear2 armel access control based on on unix group membership for Apache rc libapache2-mod-php5 5.6.4+dfsg-1 armel server-side, HTML-embedded scripting language (Apache 2 module) rc libapache2-mod-php5filter 5.6.4+dfsg-1 armel server-side, HTML-embedded scripting language (apache 2 filter module)

# dpkg -l | grep php rc libapache2-mod-php5 5.6.4+dfsg-1 armel server-side, HTML-embedded scripting language (Apache 2 module) rc libapache2-mod-php5filter 5.6.4+dfsg-1 armel server-side, HTML-embedded scripting language (apache 2 filter module) rc php5-cgi 5.6.4+dfsg-1 armel server-side, HTML-embedded scripting language (CGI binary) rc php5-cli 5.6.4+dfsg-1 armel command-line interpreter for the php5 scripting language ii php5-common 5.6.4+dfsg-1 armel Common files for packages built from the php5 source rc php5-gd 5.6.4+dfsg-1 armel GD module for php5 ii php5-json 1.3.6-1 armel JSON module for php5 ii php5-mcrypt 5.6.4+dfsg-1 armel MCrypt module for php5 rc php5-mysql 5.6.4+dfsg-1 armel MySQL module for php5 rc phpmyadmin 4:4.2.12-2 all MySQL web administration tool

Les dépôts Debian Officiels.

sources-list-au-carre-ou-minimaliste-t5659.html
isalo.org/wiki.debian-fr/Sou … _les_bases
wiki.debian-facile.org/manuel:ap … ble_wheezy
isalo.org/wiki.debian-fr/in … urces.list
isalo.org/wiki.debian-fr/L%2 … references


PS: tu corrigeras les droits Unix en ce répertoire. ([mono]/etc/apt/[/mono])

Merci pour tes lumières, comme j’ai suffisamment fait de bêtises je préfère demander.
En mettant à jour mon source.list avec les dépots officiels cela règlerait mon souci ? (je garde quand meme le depot du vendeur de mon NAS)
Dois-je ajouter les depots testing ou bien les supprimer ?
Dois-je reinstall / autoremove apache2 ?

Merci

ps: je vais voir quels droits je dois mettre sur /etc/apt

Un complément ?

debian.org/doc/
debian.org/doc/manuals/debi … ex.fr.html

J’ai modifié mon source.list

[code]# cat /etc/apt/sources.list
deb http://apt.readynas.com/packages/readynasos 6.2.2 updates apps main

################################################

wheezy

deb http://ftp.fr.debian.org/debian/ wheezy main contrib non-free
deb-src http://ftp.fr.debian.org/debian/ wheezy main contrib non-free

wheezy security

deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free
[/code]

supprimé [mono]/etc/apt/preference[/mono]s et fais un [mono]chmod 755 /etc/apt[/mono]

Lire toute une doc est une solution effectivement, pourrais-tu répondre à mes questions ? Ou bien propose-je des commandes inadaptées ?

pour info après un [mono]# apt-get update[/mono] j’ai toujours la même erreur

[code]# apt-get --reinstall install apache2
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
apache2-mpm-prefork apache2-utils apache2.2-common
Suggested packages:
www-browser apache2-doc apache2-suexec apache2-suexec-custom
Recommended packages:
ssl-cert
The following NEW packages will be installed:
apache2-mpm-prefork apache2-utils apache2.2-common
0 upgraded, 3 newly installed, 1 reinstalled, 0 to remove and 5 not upgraded.
2 not fully installed or removed.
Need to get 0 B/465 kB of archives.
After this operation, 944 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package apache2-utils.
(Reading database … 16315 files and directories currently installed.)
Unpacking apache2-utils (from …/apache2-utils_2.2.29-0.netgear2_armel.deb) …
Selecting previously unselected package apache2.2-common.
Unpacking apache2.2-common (from …/apache2.2-common_2.2.29-0.netgear2_armel.deb) …
Selecting previously unselected package apache2-mpm-prefork.
Unpacking apache2-mpm-prefork (from …/apache2-mpm-prefork_2.2.29-0.netgear2_armel.deb) …
Selecting previously unselected package apache2.
Preparing to replace apache2 2.2.29-0.netgear2 (using …/apache2_2.2.29-0.netgear2_armel.deb) …
Unpacking replacement apache2 …
dpkg-maintscript-helper: error: command symlink_to_dir is unknown
Hint: upgrading dpkg to a newer version might help.

Usage: dpkg-maintscript-helper … – …

Commands:
supports
Returns 0 (success) if the given command is supported, 1 otherwise.
rm_conffile [ []]
Remove obsolete conffile. Must be called in preinst, postinst and
postrm.
mv_conffile [ []]
Rename a conffile. Must be called in preinst, postinst and postrm.
help
Display this usage information.
dpkg: warning: subprocess old post-removal script returned error exit status 1
dpkg: trying script from the new package instead …
dpkg: error processing /var/cache/apt/archives/apache2_2.2.29-0.netgear2_armel.deb (–unpack):
there is no script in the new version of the package - giving up
Errors were encountered while processing:
/var/cache/apt/archives/apache2_2.2.29-0.netgear2_armel.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
[/code]

Merci

En fouillant ailleurs (car au final j’ai pas vraiment avancé), j’ai fini par réussir à réinstaller dpkg.
Mes /etc/apt/list est sain de tout jessie, j’ai de nouveau apache2 et php5 n’est plus (dans un premier temps) mais apache2 ne veut pas démarer…

apt-cache policy apache2
apache2:
  Installed: 2.2.29-0.netgear2
  Candidate: 2.2.29-0.netgear2
~# apt-cache policy php5
php5:
  Installed: (none)
  Candidate: 5.4.36-0+deb7u3

# apt-cache policy dpkg dpkg: Installed: 1.17.23 Candidate: 1.17.23

[code]# cat /etc/apt/sources.list
deb http://apt.readynas.com/packages/readynasos 6.2.2 updates apps main

################################################

wheezy

deb http://ftp.fr.debian.org/debian/ wheezy main contrib non-free
deb-src http://ftp.fr.debian.org/debian/ wheezy main contrib non-free

wheezy security

deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free

wheezy update

deb http://ftp.fr.debian.org/debian/ wheezy-updates main contrib non-free
deb-src http://ftp.fr.debian.org/debian/ wheezy-updates main contrib non-free
[/code]

Hi descendant_command and Habitual,

Absolutely, I wasn’t used to this kind of stable distribution since I use to run Fedora as my principal OS!
Sorry not to answer before, I was on leave.

En essayant de lancer apache2 j’ai des erreurs

/etc/init.d/apache2 start [....] Starting apache2 (via systemctl): apache2.serviceJob failed. See system journal and 'systemctl status' for details. failed!

En lancant ce qui est conseillé, j’ai des erreurs que je ne comprends pas

~# systemctl status apache2 apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled) Active: inactive (dead) (Result: exit-code) since Thu, 15 Jan 2015 21:49:12 +0100; 33s ago Process: 31299 ExecStart=/usr/sbin/apache2 $OPTIONS -k start (code=exited, status=1/FAILURE) Process: 31292 ExecStartPre=/frontview/bin/fvapps (code=exited, status=0/SUCCESS) CGroup: name=systemd:/system/apache2.service

# journalctl -a | grep apache2 | tail -n 20 Jan 15 21:49:11 ReadyNAS-Thib systemd[1]: apache2.service: control process exited, code=exited status=1 Jan 15 21:49:11 ReadyNAS-Thib systemd[1]: Unit apache2.service entered failed state. Jan 15 21:49:11 ReadyNAS-Thib systemd[1]: apache2.service holdoff time over, scheduling restart. Jan 15 21:49:11 ReadyNAS-Thib apache2[31269]: apache2: bad user name ${APACHE_RUN_USER} Jan 15 21:49:11 ReadyNAS-Thib systemd[1]: apache2.service: control process exited, code=exited status=1 Jan 15 21:49:11 ReadyNAS-Thib systemd[1]: Unit apache2.service entered failed state. Jan 15 21:49:11 ReadyNAS-Thib systemd[1]: apache2.service holdoff time over, scheduling restart. Jan 15 21:49:11 ReadyNAS-Thib apache2[31279]: apache2: bad user name ${APACHE_RUN_USER} Jan 15 21:49:11 ReadyNAS-Thib systemd[1]: apache2.service: control process exited, code=exited status=1 Jan 15 21:49:11 ReadyNAS-Thib systemd[1]: Unit apache2.service entered failed state. Jan 15 21:49:11 ReadyNAS-Thib systemd[1]: apache2.service holdoff time over, scheduling restart. Jan 15 21:49:12 ReadyNAS-Thib apache2[31289]: apache2: bad user name ${APACHE_RUN_USER} Jan 15 21:49:12 ReadyNAS-Thib systemd[1]: apache2.service: control process exited, code=exited status=1 Jan 15 21:49:12 ReadyNAS-Thib systemd[1]: Unit apache2.service entered failed state. Jan 15 21:49:12 ReadyNAS-Thib systemd[1]: apache2.service holdoff time over, scheduling restart. Jan 15 21:49:12 ReadyNAS-Thib apache2[31299]: apache2: bad user name ${APACHE_RUN_USER} Jan 15 21:49:12 ReadyNAS-Thib systemd[1]: apache2.service: control process exited, code=exited status=1 Jan 15 21:49:12 ReadyNAS-Thib systemd[1]: Unit apache2.service entered failed state. Jan 15 21:49:12 ReadyNAS-Thib systemd[1]: apache2.service holdoff time over, scheduling restart. Jan 15 21:49:12 ReadyNAS-Thib systemd[1]: apache2.service start request repeated too quickly, refusing to start.

J’ai lu ca et qu’en rajoutant un User and Group avec www-data dans mon /etc/apache2/apache2.conf
Mais les erreurs restent les mêmes. Une autre erreur en le lancant différemment :

~# apache2ctl start /var/lock/apache2 already exists but is not a directory owned by www-data. Please fix manually. Aborting.

Voilà mon /etc/apache2/apache2.conf

# tail -3 /etc/apache2/apache2.conf #Added by titimoi User www-data Group www-data

J’avoue ne plus trop savoir où chercher…

Salut,

Ce qui est faux.
[mono]systemd[/mono] et ses acolytes sont installés sur ton système supposé être en version [mono]stable[/mono], à savoir [mono]Wheezy[/mono].

Remarque: un noob, se passera très aisément de ce dépôt exotique et de ce fait, ne s’en portera que mieux, tout au moins, son système.

[mono][strike]deb apt.readynas.com/packages/readynasos 6.2.2 updates apps main[/strike][/mono]

Les bibles officielles. (Cf. ci-plus haut)

Sache Belzébuth que malgré le fait que j’ai apprécié que tu répondes, la forme de tes réponses est particulièrement critiquable. :078
Il est tout à fait ridicule de me prendre de haut comme tu l’as fait tout au long de ces postes. Personne ne t’a forcé à répondre, n’hésite pas à t’abstenir la prochaine fois plutôt que de le faire de la sorte, la vérité est que tu ne m’as que très très peu aidé, en pointant des directions de recherche générale sans sens particulier.

Commences donc par lire (et relire) les bibles que je t’indique, après quoi, nous serons peut-être sur le même piédestal, pour la suite … :033

Je tombe sur ce sujet en cherchant une réponse à peu près similaire à titimoi. Et je tombe sur les supers géniales réponses de BelZeButh qui ne servent totalement à rien.
La prochaine fois, gros neuneu, ne répond pas. Ca évitera que des gens comme moi tombent sur ce genre de sujet totalement inutile, sans réponse avec ce ton méprisant.