python2.7-minimal failing to install

Asked by mcandre on 2018-06-09

Hi, I want to install clang in order to be able to compile Swift projects. However, the clang package depends on python2.7-minimal, which appears to be broken on Ubuntu 18.04 and 16.04. When I try to install clang with sudo apt-get install -y clang, I see:

The following additional packages will be installed:
  binfmt-support binutils clang-3.8 libclang-common-3.8-dev libclang1-3.8 libffi-dev libjsoncpp1 libllvm3.8 libobjc-5-dev libobjc4 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libtinfo-dev
  llvm-3.8 llvm-3.8-dev llvm-3.8-runtime python python-minimal python2.7 python2.7-minimal
Suggested packages:
  binutils-doc gnustep gnustep-devel clang-3.8-doc llvm-3.8-doc python-doc python-tk python2.7-doc
The following NEW packages will be installed:
  binfmt-support binutils clang clang-3.8 libclang-common-3.8-dev libclang1-3.8 libffi-dev libjsoncpp1 libllvm3.8 libobjc-5-dev libobjc4 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib
  libtinfo-dev llvm-3.8 llvm-3.8-dev llvm-3.8-runtime python python-minimal python2.7 python2.7-minimal
0 upgraded, 22 newly installed, 0 to remove and 0 not upgraded.
Need to get 62.5 MB of archives.
After this operation, 316 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpython2.7-minimal amd64 2.7.12-1ubuntu0~16.04.3 [340 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 python2.7-minimal amd64 2.7.12-1ubuntu0~16.04.3 [1,261 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 python-minimal amd64 2.7.12-1~16.04 [28.1 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpython2.7-stdlib amd64 2.7.12-1ubuntu0~16.04.3 [1,880 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 python2.7 amd64 2.7.12-1ubuntu0~16.04.3 [224 kB]
Get:6 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpython-stdlib amd64 2.7.12-1~16.04 [7,768 B]
Get:7 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 python amd64 2.7.12-1~16.04 [137 kB]
Get:8 http://archive.ubuntu.com/ubuntu xenial/main amd64 binfmt-support amd64 2.1.6-1 [50.7 kB]
Get:9 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 binutils amd64 2.26.1-1ubuntu1~16.04.6 [2,311 kB]
Get:10 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libllvm3.8 amd64 1:3.8-2ubuntu4 [10.3 MB]
Get:11 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libobjc4 amd64 5.4.0-6ubuntu1~16.04.9 [111 kB]
Get:12 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libobjc-5-dev amd64 5.4.0-6ubuntu1~16.04.9 [381 kB]
Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 libclang1-3.8 amd64 1:3.8-2ubuntu4 [4,139 kB]
Get:14 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 libclang-common-3.8-dev amd64 1:3.8-2ubuntu4 [1,167 kB]
Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 clang-3.8 amd64 1:3.8-2ubuntu4 [21.5 MB]
Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 clang amd64 1:3.8-33ubuntu3.1 [3,248 B]
Get:17 http://archive.ubuntu.com/ubuntu xenial/main amd64 libtinfo-dev amd64 6.0+20160213-1ubuntu1 [77.4 kB]
Get:18 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 llvm-3.8-runtime amd64 1:3.8-2ubuntu4 [72.3 kB]
Get:19 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 llvm-3.8 amd64 1:3.8-2ubuntu4 [1,524 kB]
Get:20 http://archive.ubuntu.com/ubuntu xenial/main amd64 libjsoncpp1 amd64 1.7.2-1 [73.0 kB]
Get:21 http://archive.ubuntu.com/ubuntu xenial/main amd64 libffi-dev amd64 3.2.1-4 [161 kB]
Get:22 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 llvm-3.8-dev amd64 1:3.8-2ubuntu4 [16.7 MB]
Fetched 62.5 MB in 16s (3,828 kB/s)
Selecting previously unselected package libpython2.7-minimal:amd64.
(Reading database ... 58401 files and directories currently installed.)
Preparing to unpack .../libpython2.7-minimal_2.7.12-1ubuntu0~16.04.3_amd64.deb ...
Unpacking libpython2.7-minimal:amd64 (2.7.12-1ubuntu0~16.04.3) ...
Selecting previously unselected package python2.7-minimal.
Preparing to unpack .../python2.7-minimal_2.7.12-1ubuntu0~16.04.3_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.3_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Selecting previously unselected package python-minimal.
Preparing to unpack .../python-minimal_2.7.12-1~16.04_amd64.deb ...
Unpacking python-minimal (2.7.12-1~16.04) ...
Selecting previously unselected package libpython2.7-stdlib:amd64.
Preparing to unpack .../libpython2.7-stdlib_2.7.12-1ubuntu0~16.04.3_amd64.deb ...
Unpacking libpython2.7-stdlib:amd64 (2.7.12-1ubuntu0~16.04.3) ...
Selecting previously unselected package python2.7.
Preparing to unpack .../python2.7_2.7.12-1ubuntu0~16.04.3_amd64.deb ...
Unpacking python2.7 (2.7.12-1ubuntu0~16.04.3) ...
Selecting previously unselected package libpython-stdlib:amd64.
Preparing to unpack .../libpython-stdlib_2.7.12-1~16.04_amd64.deb ...
Unpacking libpython-stdlib:amd64 (2.7.12-1~16.04) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/python2.7-minimal_2.7.12-1ubuntu0~16.04.3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Question information

Language:
English Edit question
Status:
Needs information
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
2018-06-09
Last reply:
2018-06-09
Manfred Hampl (m-hampl) said : #1

I assume the important information is

/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

What is the output of the following commands:

uname -a
lsb_release -crid
ls -lad /usr/lib/python2.7/*-packages
ls -la /usr/lib/python2.7/site-packages

Can you help with this problem?

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

To post a message you must log in.