Hello, I followed the instructions to install swift 5.6.1. on Ubuntu 20.04.4. However, when I launch swift, I get these error messages below.
Any idea how to fix this problem?
Thanks in advance
—Max
Welcome to Swift!
Subcommands:
swift build ...
warning: (x86_64) /usr/lib/x86_64-linux-gnu/ld-2.31.so Unable to initialize decompressor for section '.debug_abbrev': zlib is not available
warning: (x86_64) /usr/lib/x86_64-linux-gnu/ld-2.31.so Unable to initialize decompressor for section '.debug_info': zlib is not available
warning: (x86_64) /usr/lib/x86_64-linux-gnu/ld-2.31.so Unable to initialize decompressor for section '.debug_aranges': zlib is not available
warning: (x86_64) /lib64/ld-linux-x86-64.so.2 Unable to initialize decompressor for section '.debug_abbrev': zlib is not available
warning: (x86_64) /lib64/ld-linux-x86-64.so.2 Unable to initialize decompressor for section '.debug_info': zlib is not available
warning: (x86_64) /lib/x86_64-linux-gnu/libdl.so.2 Unable to initialize decompressor for section '.debug_abbrev': zlib is not available
warning: (x86_64) /lib/x86_64-linux-gnu/libdl.so.2 Unable to initialize decompressor for section '.debug_info': zlib is not available
warning: (x86_64) /lib/x86_64-linux-gnu/libc.so.6 Unable to initialize decompressor for section '.debug_abbrev': zlib is not available
warning: (x86_64) /lib/x86_64-linux-gnu/libc.so.6 Unable to initialize decompressor for section '.debug_info': zlib is not available
warning: (x86_64) /lib/x86_64-linux-gnu/libc.so.6 Unable to initialize decompressor for section '.debug_aranges': zlib is not available
warning: (x86_64) /lib/x86_64-linux-gnu/libm.so.6 Unable to initialize decompressor for section '.debug_abbrev': zlib is not available
warning: (x86_64) /lib/x86_64-linux-gnu/libm.so.6 Unable to initialize decompressor for section '.debug_info': zlib is not available
Welcome to Swift version 5.6.1 (swift-5.6.1-RELEASE).
Type :help for assistance.
Thanks Tim, yes I thought I had, but I had obviously screwed up somewhere...
I have restarted again from the beginning (reinstall VMWare - then Ubuntu 20 - then apt-get - then swift) (4th time!) and now I don't get these errors. Sorry for the inconvenience.
Glad it's working! Simplifying the installation steps is something that's actively being worked on, so it should become a single command that does everything for you
Sorry I wrote too fast. I tried again to reinstall Ubuntu 20.04 / swift on my macbook and I keep getting the same error messages (... zlib is not available)
Note that when installing Ubuntu 20.04, it upgrades to 20.04.4
I did install all the dependencies copied/pasted from the "Getting Started', including zlib1g-dev
Maybe there is a problem with Ubuntu 20.04.4 (vs. 20.04) ?
Maybe an incompatibility with the keyboard-configuration utility I had to install first thing to be able to use my French Apple keyboard?
Maybe there is a directory somewhere that has not all the rights for simple users (I used "sudo su" before installing everything) ?
Everything went smoothly (no error message), I chose option 1 (install latest swift stable version), but then, when I ran swift, I got the same exact warning messages, see screenshot attached. I rebooted a couple times, and I tried to run swift as a regular user, and also as root (see screenshot), but this does not change anything. It looks like zlib is not available, however I can see that zlib1g-dev and zlib1g are indeed installed, see:
apt list --installed | fgrep zlib
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
zlib1g-dev/focal-updates,focal-security,now 1:1.2.11.dfsg-2ubuntu1.3 amd64 [installed,automatic]
zlib1g/focal-updates,focal-security,now 1:1.2.11.dfsg-2ubuntu1.3 amd64 [installed,automatic]
Swift version 5.6.1 (swift-5.6.1-RELEASE)
Target: x86_64-unknown-linux-gnu
Welcome to Swift!
Subcommands:
swift build Build Swift packages
swift package Create and work on packages
swift run Run a program from a package
swift test Run package tests
swift repl Experiment with Swift code interactively (default)
Use swift --help for descriptions of available options and flags.
Use swift help <subcommand> for more information about a subcommand.
warning: (x86_64) /usr/lib/x86_64-linux-gnu/ld-2.31.so Unable to initialize decompressor for section '.debug_abbrev': zlib is not available
warning: (x86_64) /usr/lib/x86_64-linux-gnu/ld-2.31.so Unable to initialize decompressor for section '.debug_info': zlib is not available
warning: (x86_64) /usr/lib/x86_64-linux-gnu/ld-2.31.so Unable to initialize decompressor for section '.debug_aranges': zlib is not available
warning: (x86_64) /lib64/ld-linux-x86-64.so.2 Unable to initialize decompressor for section '.debug_abbrev': zlib is not available
warning: (x86_64) /lib64/ld-linux-x86-64.so.2 Unable to initialize decompressor for section '.debug_info': zlib is not available
warning: (x86_64) /lib/x86_64-linux-gnu/libdl.so.2 Unable to initialize decompressor for section '.debug_abbrev': zlib is not available
warning: (x86_64) /lib/x86_64-linux-gnu/libdl.so.2 Unable to initialize decompressor for section '.debug_info': zlib is not available
warning: (x86_64) /lib/x86_64-linux-gnu/libc.so.6 Unable to initialize decompressor for section '.debug_abbrev': zlib is not available
warning: (x86_64) /lib/x86_64-linux-gnu/libc.so.6 Unable to initialize decompressor for section '.debug_info': zlib is not available
warning: (x86_64) /lib/x86_64-linux-gnu/libc.so.6 Unable to initialize decompressor for section '.debug_aranges': zlib is not available
warning: (x86_64) /lib/x86_64-linux-gnu/libm.so.6 Unable to initialize decompressor for section '.debug_abbrev': zlib is not available
warning: (x86_64) /lib/x86_64-linux-gnu/libm.so.6 Unable to initialize decompressor for section '.debug_info': zlib is not available
Welcome to Swift version 5.6.1 (swift-5.6.1-RELEASE).
Type :help for assistance.
1>
@silberz I have duplicated your setup with VMware and after installing Swift I get the same zlib is not available warnings. I haven't seen this error before and it only seems to occur in the desktop version when using VMware.
I installed the server image ubuntu-20.04.4-live-server-amd64.iso in VMware and there where no problems. I will do some more testing tomorrow.