Skip to content

Instantly share code, notes, and snippets.

@treuherz
Last active December 16, 2019 21:20
Show Gist options
  • Select an option

  • Save treuherz/bc943aecbbb5ae16f1c4bf6ca01dcdfc to your computer and use it in GitHub Desktop.

Select an option

Save treuherz/bc943aecbbb5ae16f1c4bf6ca01dcdfc to your computer and use it in GitHub Desktop.
Installing build-essential on WSL in Windows 10 1703

Due to a quirk in the case-sensitivity of WSL's filesytem, installations of the build-essential package (which contains C/C++ compilers and other things you'll need for installing Python, Bazel, etc) fail due to files "already existing". What's actually happening is that files with the same name but different casing already exist. I think this issue is fixed in newer versions of Windows, but for now you can circumvent the issue by leaving out the different-cased files. Obviously things will start going wrong if you try to compile something that relies on the different casing, but this solution should at least be workable for a while.

These commands will need to be run as a superuser

apt update
apt install build-essential  # will fail
dpkg \
  --path-exclude=/usr/include/linux/netfilter/xt_{TCPMSS,DSCP,CONNMARK,RATEEST,MARK}.h \
  --path-exclude=/usr/include/linux/netfilter_ipv6/ip6t_HL.h \
  --path-exclude=/usr/include/linux/netfilter_ipv4/ipt_{ECN,TTL}.h \
  -i /var/cache/apt/archives/linux-libc-dev_*.deb
apt install

NB: For the same reason, you should apt-mark hold libpam-runtime before doing an apt upgrade if you don't want things to break in a way that's really hard to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment