From: spam.spam.spam.spam on
Hello,

If I create a package with the same file than an other package which is already
installed on my computer, I can't install it. But when I download a package with
the same file than an other package which is already installed on my computer, I
can install it.

Now I prove it :

I have 2 packages with the same file :
-nvidia-glx
-xserver-xorg-core

The file is : /usr/lib/xorg/modules/extensions/libglx.so

We can see it doing :
$ apt-file list nvidia-glx
$ apt-file list xserver-xorg-core
or :
$ dpkg -c nvidia-glx_173.14.09-5_i386.deb
$ dpkg -c xserver-xorg-core_1.4.2-10.lenny2_i386.deb

When I try to install these two packages, it works :
$ sudo dpkg -i nvidia-glx_173.14.09-5_i386.deb
(Lecture de la base de donn�es... 83916 fichiers et r�pertoires d�j� install�s.)
Pr�paration du remplacement de nvidia-glx 173.14.09-5 (en utilisant
..../nvidia-glx_173.14.09-5_i386.deb) ...
D�paquetage de la mise � jour de nvidia-glx ...
Param�trage de nvidia-glx (173.14.09-5) ...
$ sudo dpkg -i xserver-xorg-core_1.4.2-10.lenny2_i386.deb
(Lecture de la base de donn�es... 83916 fichiers et r�pertoires d�j� install�s.)
Pr�paration du remplacement de xserver-xorg-core 2:1.4.2-10.lenny2 (en utilisant
..../xserver-xorg-core_1.4.2-10.lenny2_i386.deb) ...
D�paquetage de la mise � jour de xserver-xorg-core ...
Param�trage de xserver-xorg-core (2:1.4.2-10.lenny2) ...
Traitement des actions diff�r�es (��triggers��) pour � man-db �...

So, I create my own package with this file :
$ mkdir -p mypkg/DEBIAN
$ touch mypkg/DEBIAN/control
$ gvim mypkg/DEBIAN/control
$ mkdir -p mypkg/usr/lib/xorg/modules/extensions
$ ln -s foo.so mypkg/usr/lib/xorg/modules/extensions/libglx.so
$ sudo chown -R root:root mypkg/
$ dpkg-deb --build mypkg

The content of the DEBIAN/control file is :
Package: mypkg
Version: 20100810
Description: This is my package.
Architecture: i386
Maintainer: Mr. X

When I try to install this package, it doesn't works :
$ sudo dpkg -i mypkg.deb
S�lection du paquet mypkg pr�c�demment d�s�lectionn�.
(Lecture de la base de donn�es... 83916 fichiers et r�pertoires d�j� install�s.)
D�paquetage de mypkg (� partir de mypkg.deb) ...
dpkg�: erreur de traitement de mypkg.deb (--install)�:
tentative de remplacement de ��/usr/lib/xorg/modules/extensions/libglx.so��,
qui appartient aussi au paquet xserver-xorg-core
Des erreurs ont �t� rencontr�es pendant l'ex�cution�:
mypkg.deb

Why can I install nvidia-glx package and I can't install mypkg package?

Thank you.

(sorry for the french messages, I don't want to change my locale but if you
consider it is very important to see the messages in english I can do it)


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/1281444325.4c6149e57c24d(a)imp.free.fr
From: Chris Jackson on
spam.spam.spam.spam(a)free.fr wrote:

> (sorry for the french messages, I don't want to change my locale but if you
> consider it is very important to see the messages in english I can do it)

It'd probably help. You don't have to (well, shouldn't have to)
permanantly change your locale to do it, just:

export LC_ALL=en_US.UTF-8

do your stuff, and

unset LC_ALL

to go back to French.

--
Chris Jackson
Shadowcat Systems Ltd.


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/4C6151C6.7070809(a)shadowcat.co.uk
From: Boyd Stephen Smith Jr. on
In <1281444325.4c6149e57c24d(a)imp.free.fr>, spam.spam.spam.spam(a)free.fr wrote:
>If I create a package with the same file than an other package which is
>already installed on my computer, I can't install it. But when I download a
>package with the same file than an other package which is already installed
>on my computer, I can install it.

Not true, normally.

dpkg can't tell where a .deb came from; that information is not stored inside
the package. It checks all packages for file-level conflicts as part of
installing them.

>Now I prove it :
>
>I have 2 packages with the same file :
>-nvidia-glx
>-xserver-xorg-core
>
>The file is : /usr/lib/xorg/modules/extensions/libglx.so

nvidia-glx uses a "diversion" to force the libglx.so file from any other
package to be moved / installed to an alternate location. Your packages can
also use diversion(s), if need be. IIRC diversions are a bit out-of-favor as
far as packaging style, but there are some cases where they are the best
solution.

http://www.debian.org/doc/debian-policy/ap-pkg-diversions.html and the dpkg-
divert(8) man page are probably the best references on this dpkg feature.

Consider using the alternatives system instead. It scales better and is (IMO)
easier for a administrator to adjust to local policy. The "disadvantage" is
that all the packages providing a file must be modified to do so though the
alternatives system. (As opposed to the diversion system, where only one
package is the pair actually uses it; nvidia-glx in your case.)

NB: I spelled it "divertion" each and every time I typed it in this message
and had to correct it. :(
--
Boyd Stephen Smith Jr. ,= ,-_-. =.
bss(a)iguanasuicide.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/ \_/
From: spam.spam.spam.spam on
Hello,

If I create a package with the same file than an other package which is already
installed on my computer, I can't install it. But when I download a package with
the same file than an other package which is already installed on my computer, I
can install it.

Now I prove it :

I have 2 packages with the same file :
-nvidia-glx
-xserver-xorg-core

The file is : /usr/lib/xorg/modules/extensions/libglx.so

We can see it doing :
$ apt-file list nvidia-glx
$ apt-file list xserver-xorg-core
or :
$ dpkg -c nvidia-glx_173.14.09-5_i386.deb
$ dpkg -c xserver-xorg-core_1.4.2-10.lenny2_i386.deb

When I try to install these two packages, it works :
$ sudo dpkg -i nvidia-glx_173.14.09-5_i386.deb
(Reading database ... 87860 files and directories currently installed.)
Preparing to replace nvidia-glx 173.14.09-5 (using
nvidia-glx_173.14.09-5_i386.deb) ...
Unpacking replacement nvidia-glx ...
Setting up nvidia-glx (173.14.09-5) ...
$ sudo dpkg -i xserver-xorg-core_1.4.2-10.lenny2_i386.deb
(Reading database ... 87860 files and directories currently installed.)
Preparing to replace xserver-xorg-core 2:1.4.2-10.lenny2 (using
xserver-xorg-core_1.4.2-10.lenny2_i386.deb) ...
Unpacking replacement xserver-xorg-core ...
Setting up xserver-xorg-core (2:1.4.2-10.lenny2) ...
Processing triggers for man-db ...

So, I create my own package with this file :
$ mkdir -p mypkg/DEBIAN
$ touch mypkg/DEBIAN/control
$ gvim mypkg/DEBIAN/control
$ mkdir -p mypkg/usr/lib/xorg/modules/extensions
$ ln -s foo.so mypkg/usr/lib/xorg/modules/extensions/libglx.so
$ sudo chown -R root:root mypkg/
$ dpkg-deb --build mypkg

The content of the DEBIAN/control file is :
Package: mypkg
Version: 20100810
Description: This is my package.
Architecture: i386
Maintainer: Mr. X

When I try to install this package, it doesn't works :
$ sudo dpkg -i mypkg.deb$ sudo dpkg -i mypkg.deb
(Reading database ... 87860 files and directories currently installed.)
Unpacking mypkg (from mypkg.deb) ...
dpkg: error processing mypkg.deb (--install):
trying to overwrite `/usr/lib/xorg/modules/extensions/libglx.so', which is also
in package xserver-xorg-core
Errors were encountered while processing:
mypkg.deb

Why can I install nvidia-glx package and I can't install mypkg package?

Thank you.

(the french messages are now translated into english)

Quoting Chris Jackson <c.jackson(a)shadowcat.co.uk>:

> spam.spam.spam.spam(a)free.fr wrote:
>
> > (sorry for the french messages, I don't want to change my locale but if you
> > consider it is very important to see the messages in english I can do it)
>
> It'd probably help. You don't have to (well, shouldn't have to)
> permanantly change your locale to do it, just:
>
> export LC_ALL=en_US.UTF-8
>
> do your stuff, and
>
> unset LC_ALL
>
> to go back to French.
>
> --
> Chris Jackson
> Shadowcat Systems Ltd.
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
> Archive: http://lists.debian.org/4C6151C6.7070809(a)shadowcat.co.uk
>
>



--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/1281634592.4c643120aba03(a)imp.free.fr
From: Florian Kulzer on
On Thu, Aug 12, 2010 at 19:36:32 +0200, spam.spam.spam.spam(a)free.fr wrote:
> Hello,
>
> If I create a package with the same file than an other package which is already
> installed on my computer, I can't install it. But when I download a package with
> the same file than an other package which is already installed on my computer, I
> can install it.
>
> Now I prove it :
>
> I have 2 packages with the same file :
> -nvidia-glx
> -xserver-xorg-core
>
> The file is : /usr/lib/xorg/modules/extensions/libglx.so

[...]

> So, I create my own package with this file :

[...]

> Why can I install nvidia-glx package and I can't install mypkg package?

The nvidia-glx package uses a diversion to avoid the file conflict; the
manpage of the dpkg-divert command has more information about this
approach.

--
Regards, |
Florian |


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/20100812224421.GA4666(a)isar.localhost