I need a few basic bash commands, so I have WSL installed (Ubuntu 18.04).
With cygwin everything I need takes about 150MB. But WSL takes over 1GB !! Not good for my small SSD.
I'm sure there's loads of stuff/junk in there that isn't necessary (or even possible to use). Has anyone managed to reduce the size?
I did sudo apt autoremove
but that doesn't help at all (obviously).
UPDATE
The answers below are super, but the above question remains unanswered. Suppose that WSL is being used (for various bash commands) - that is the premise, not wine/cygwin/vm/dualboot/docker/etc.
How would you strip it of stuff that can't be used within Windows anyway? I've read that there is all sorts of dead weight in there that can't be used. For example, if all you need is a collection of bash commands, how do you remove all the GUI and X stuff. Just as an example.
UPDATE2
I accepted one of the good answers below, but it doesn't fully answer the question. I hope in time someone will add to this discussion. I was hoping someone had a list of stuff that can be removed. I know how to remove stuff, what I don't know is what to remove.
WSL is a full OS, so it takes up more CPU/MEM/DSK than CygWin but less than a VM
So it depends on your use case:
tail
on Windows, you just install the GNU Utilities for Windows.if you need all the whistles and bells of both Windows and Ubuntu you go:
or
Having said all that, you can always do the following to strip WSL of stuff that you don't need:
;-)
¹ Definition of "utility": a small application that does not exist under Ubuntu E.g. Notepad++, DNSBench, ... Office is not a utility: it's a hog: go dual-boot ;-)
You can use docker images
See https://github.com/RoliSoft/WSL-Distribution-Switcher
They are much smaller and you can install additional apps as needed.
In addition some docker images come with pre-configured tools.
See https://hub.docker.com/explore/
I have used several docker images successfully.
Have you looked at cleaning up your Windows' rootfs cache?
How do I reduce the size of WSL rootfs?
This reduced the space used by WSL Ubuntu 18.04 on my Windows 10
C:
drive by 62 GB.