mesosphere / mesos-deb-packaging

Mesos package for Debian, Ubuntu, CentOS, RHEL, and Fedora
Other
58 stars 67 forks source link

Python files installed in wrong location #51

Open neilconway opened 9 years ago

neilconway commented 9 years ago

The Debian Python packaging policy says:

Third party Python software installed from Debian packages goes into dist-packages, not site-packages. This is to reduce conflict between the system Python, and any from-source Python build you might install manually.

The package doesn't seem to do this:

$ wget http://repos.mesosphere.io/debian/pool/main/m/mesos/mesos_0.23.0-1.0.debian81_amd64.deb
$ dpkg -c mesos_0.23.0-1.0.debian81_amd64.deb | grep site-packages | wc -l
101

This does cause problems in practice; for example, installing python2.7-minimal gripes about it:

    The following extra packages will be installed:
    python2.7-minimal
    Suggested packages:
    binfmt-support
    The following NEW packages will be installed:
    python2.7-minimal
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    8 not fully installed or removed.
    Need to get 0 B/1,401 kB of archives.
    After this operation, 3,881 kB of additional disk space will be used.
    Do you want to continue? [Y/n]
    debconf: delaying package configuration, since apt-utils is not installed
    (Reading database ... 17099 files and directories currently installed.)
    Preparing to unpack .../python2.7-minimal_2.7.9-2_amd64.deb ...
    new installation of python2.7-minimal; /usr/lib/python2.7/site-packages is a directory
    which is expected a symlink to /usr/local/lib/python2.7/dist-packages.
    please find the package shipping files in /usr/lib/python2.7/site-packages and
    file a bug report to ship these in /usr/lib/python2.7/dist-packages instead
    aborting installation of python2.7-minimal
    dpkg: error processing archive /var/cache/apt/archives/python2.7-minimal_2.7.9-2_amd64.deb (--unpack):
    subprocess new pre-installation script returned error exit status 1
    Errors were encountered while processing:
    /var/cache/apt/archives/python2.7-minimal_2.7.9-2_amd64.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)
mgummelt commented 8 years ago

+1

A partner is running into this issue.

billcloud-me commented 7 years ago

I encountered this same issue:

sudo apt install python2.7 wget
[sudo] password for stackadmin: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
wget is already the newest version (1.17.1-1ubuntu1.1).
The following additional packages will be installed:
  libpython2.7-minimal libpython2.7-stdlib python2.7-minimal
Suggested packages:
  python2.7-doc binutils binfmt-support
The following NEW packages will be installed:
  libpython2.7-minimal libpython2.7-stdlib python2.7 python2.7-minimal
0 upgraded, 4 newly installed, 0 to remove and 12 not upgraded.
Need to get 3,743 kB of archives.
After this operation, 15.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpython2.7-minimal amd64 2.7.12-1ubuntu0~16.04.1 [339 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 python2.7-minimal amd64 2.7.12-1ubuntu0~16.04.1 [1,295 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpython2.7-stdlib amd64 2.7.12-1ubuntu0~16.04.1 [1,884 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 python2.7 amd64 2.7.12-1ubuntu0~16.04.1 [224 kB]
Fetched 3,743 kB in 0s (4,519 kB/s)
Selecting previously unselected package libpython2.7-minimal:amd64.
(Reading database ... 103567 files and directories currently installed.)
Preparing to unpack .../libpython2.7-minimal_2.7.12-1ubuntu0~16.04.1_amd64.deb ...
Unpacking libpython2.7-minimal:amd64 (2.7.12-1ubuntu0~16.04.1) ...
Selecting previously unselected package python2.7-minimal.
Preparing to unpack .../python2.7-minimal_2.7.12-1ubuntu0~16.04.1_amd64.deb ...
new installation of python2.7-minimal; /usr/lib/python2.7/site-packages is a directory
which is expected a symlink to /usr/local/lib/python2.7/dist-packages.
please find the package shipping files in /usr/lib/python2.7/site-packages and
file a bug report to ship these in /usr/lib/python2.7/dist-packages instead
aborting installation of python2.7-minimal
dpkg: error processing archive /var/cache/apt/archives/python2.7-minimal_2.7.12-1ubuntu0~16.04.1_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Selecting previously unselected package libpython2.7-stdlib:amd64.
Preparing to unpack .../libpython2.7-stdlib_2.7.12-1ubuntu0~16.04.1_amd64.deb ...
Unpacking libpython2.7-stdlib:amd64 (2.7.12-1ubuntu0~16.04.1) ...
Selecting previously unselected package python2.7.
Preparing to unpack .../python2.7_2.7.12-1ubuntu0~16.04.1_amd64.deb ...
Unpacking python2.7 (2.7.12-1ubuntu0~16.04.1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/python2.7-minimal_2.7.12-1ubuntu0~16.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

This error is caused by mesos being installed into this location:

$ dpkg -S /usr/lib/python2.7/site-packages
mesos: /usr/lib/python2.7/site-packages

This was installed using the mesosphere deb packages

netpedro-com commented 7 years ago

How can I undo the Python installation? I tried purge, autoremove and apt-get -f install without success.

toecto commented 6 years ago

Using this to fix apt-get system after fail:

apt -r python-minimal
apt -r python2.7
apt autoclean

Notice apt, NOT apt-get.