Is there any way to reduce the size of a kernel so it can run on 64MB RAM easily (Ubuntu 18.04 LTS)?

Thanks for the A2A.

A question like this clearly outs you as a newbie and inexperienced users.

First of all, Ubuntu is a poor choice for this. At least, if we are talking about the desktop operating system. Because Ubuntu is one bloated hell of a Linux distribution. This might be different for core or server though. Which I don’t use. I’m not sure, if Ubuntu has other stuff like IoT and that kind going on. I’m not much into Ubuntu these days. On the other hand, if it is, chances are, you are there already.

Because here is another misconception: the kernel has an average size of around 6MB for default options. One on one of my Raspberries has like 6.1MB? And the one on my notebook has… hmm… almost 6.3MB. Last time I checked, it had like 5.9MB.

What does that tell you? The smallest of your problems is actually the kernel. Although you can download the source from kernel.org, make the according settings to make it fit the hardware and shrink it down to the minimum and go with that. That would certainly make it smaller and higher performing.

Your biggest problem is most certainly your GUI. Remove that and you are going to lose a few hundred MB of your RAM load immediately. Just stop and disable your display manager and login in the console. And BANG… suddenly it’s a lot lighter.

Well, there is certainly a lot more additional crap you can get rid of. Like for example, using the basics instead of stuff like Network Manager. Just for example. Getting rid of everything that’s not needed. If you don’t need SSH, disable it…

The question is, if it wouldn’t be easier to just skip the pain and start out with something ligther entirely. I’ve provided screenshots on Quora, where an Arch Linux setup on a Raspberry Pi puts like 55.6MB load on RAM.

But as you can see, everything good has a natural limit at some point. I’m not saying, you can’t go further down. Stuff like OpenWRT are Linux distributions too… kind of… and are only a few MB in size. There are root file systems with less than 1MB out there, that are based on the Linux kernel.

What I’m aiming at is: you should understand, that with weight you will also lose comfort and functionality. Take a look at (the meanwhile outdated and discontinued) Damn Small Linux, which had a size around 50MB and was capable of running entirely from RAM. The catch? It was barely worth using, because it was a toy. It had no office, it was tedious to get an Internet connection and you would go above and beyond to just mount a partition.

Is that really what you want? Because 64MB of RAM is quite little. And running with 64MB auf RAM “EASILY”… means, you need to be WAY smaller than that. So, my opinion: GOOD LUCK! Because personally, I don’t see a point in this. Seriously, you can get like 500MB RAM from a vastly outdated tablet or even a smartphone. That’s almost 10 times what you are aiming at. I don’t mind a challenge. But sometimes it’s just time waste. Honestly, in the past 2 days I’ve set up a server, based on a minimal Raspbian setup. And right now it puts 140MB load on RAM. And that’s just a really minimal LEMP stack. So,…

On the other hand, for the fun of it, you might want to actually try stuff like LFS. This should give you some perspective. And one more thing: you might want to look into stuff like embedded systems and IoT for that. Going the other way and starting with the small stuff instead of the bloated, should give you plenty of space to play with 😉

============================================

If this answer was helpful, please don’t forget to upvote it on Quora: https://www.quora.com/Is-there-any-way-to-reduce-the-size-of-a-kernel-so-it-can-run-on-64MB-RAM-easily-Ubuntu-18-04-LTS/answer/Chris-Bailey-364

error: