Author Topic: Whats a minimal Linux install for electronics/tech programs  (Read 3537 times)

0 Members and 1 Guest are viewing this topic.

Offline MathWizardTopic starter

  • Super Contributor
  • ***
  • Posts: 1795
  • Country: ca
Whats a minimal Linux install for electronics/tech programs
« on: December 27, 2024, 06:26:02 am »
I've installed Linux Mint a couple of times since 2020, but never stuck with it, mainly since my PC games worked better/easier on win10.

But I want make a small partition, and setup some Linux again, for various hobby electronics and programming tasks. It would be nice if it could still play a 3D game too, but nothing modern, I'll keep windows for that.

So what's a small disk size, lite weight Linux that's suited for EE/programming ?
 

Offline Messtechniker

  • Frequent Contributor
  • **
  • Posts: 840
  • Country: de
  • Old analog audio hand - No voodoo.
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #1 on: December 27, 2024, 06:43:51 am »
I recommed using a ssd hot swap bay instead of a potentioally troublesome combination of Windows and Linux on a single drive. Then you can do this, keeping everything separate:
Agilent 34465A, Siglent SDG 2042X, Hameg HMO1022, R&S HMC 8043, Peaktech 2025A, Voltcraft VC 940, M-Audio Audiophile 192, R&S Psophometer UPGR, 3 Transistor Testers, DL4JAL Transistor Curve Tracer, UT622E LCR meter, UT216C AC/DC Clamp Meter
 
The following users thanked this post: johnmik

Online langwadt

  • Super Contributor
  • ***
  • Posts: 4884
  • Country: dk
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #2 on: December 27, 2024, 06:57:13 am »
WSL goes a long way
 
The following users thanked this post: mwb1100

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4840
  • Country: nz
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #3 on: December 27, 2024, 07:24:30 am »
Buildroot / yocto.

You can install gcc and an editor on it if you want, but it's usually used for deployment rather than development.

There a on online JavaScript-emulated RISC-V Busybox setup here, including gcc and nano and vi editors.  Things run quite well once each program you run has been loaded over the internet and cached locally.

https://bellard.org/jslinux/vm.html?cpu=riscv64&url=buildroot-riscv64.cfg&mem=256

Try ls -l on /bin and /usr/bin

Good OS for tiny modern boards such as Pi Zero (or original Pi), or ancient x86 PCs -- of course if you want a current kernel then you need at least a 486 as the last 386 support was 2012's kernel 3.8.
« Last Edit: December 27, 2024, 07:29:06 am by brucehoult »
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1739
  • Country: ua
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #4 on: December 27, 2024, 01:55:47 pm »
So what's a small disk size, lite weight Linux that's suited for EE/programming ?
How small is small?
 

Offline adeuring

  • Contributor
  • Posts: 27
  • Country: de
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #5 on: December 27, 2024, 02:17:19 pm »
I'm running Ubuntu 24.04 on a 240GB SSD. A larger number of "non-standard" packages like Kicad are installed. "df" shows how much disk space is used:

Code: [Select]
Filesystem                 1K-blocks      Used  Available Use% Mounted on
tmpfs                        3275576      2176    3273400   1% /run
/dev/dm-0                  225492652 161557536   52407892  76% /
tmpfs                       16377876    609016   15768860   4% /dev/shm
tmpfs                           5120         8       5112   1% /run/lock
tmpfs                       16377876       220   16377656   1% /run/qemu
tmpfs                       16377876    422648   15955228   3% /tmp
/dev/sda1                    4046560    198920    3621544   6% /boot
tmpfs                        3275572       196    3275376   1% /run/user/1000

The relevant mount points are / and /boot. (I'm using disk encryption, so the unencrypted /boot directory needs its own partition.)

In total ca. 165GB are used. Most of that is for "personal files":

Code: [Select]
sudo du -ks /home/
136354528       /home/

So, the "plain" installation (files in /boot, /etc, /lib, /opt, /snap, /usr, /var, ...) needs a bit less than 30GB. You can store your "personal files" on a Windows partition instead of /home/your-user-name, so this gives you an idea of the disk space an Ubuntu installation needs nowadays.

Having a root partition that is nearly full is not a good idea, hence I'd say that my installation would fit well into a partition of 40 or 50GB.

If you intend to use for example database servers like Postgres or Mysql, keep in mind that they store their data by default somewhere under /var, so you'd need to increase the disk space for the Linux partition somewhat.

That said, I agree with Messtechniker that it might be better to install Linux on a separate SSD/disk. Swapping these disks saves you from potential hassles when one OS "kills" the option to boot the other OS.
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1739
  • Country: ua
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #6 on: December 27, 2024, 02:54:24 pm »
I'm running Ubuntu 24.04 on a 240GB SSD. A larger number of "non-standard" packages like Kicad are installed. "df" shows how much disk space is used:
...try the -h switch for both df and du ;)
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1739
  • Country: ua
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #7 on: December 27, 2024, 03:02:04 pm »
And for example, here's the size of a regular Debian-based desktop that's about 20 years old, it's the very computer that I'm using right now. Never reinstalled from scratch after its initial setup. I've been rolling-updating it all these years. There's a lot of stuff installed, much of which I have probably never used.

Code: [Select]
$ sudo du -hs /usr /var /bin /lib /sbin /boot
59G     /usr
55G     /var
0       /bin
0       /lib
0       /sbin
569M    /boot

I can call this fairly small by today's standards, meaning, there's probably no need to look for some special distro, unless the definition of "small" is much smaller than this.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 28503
  • Country: nl
    • NCT Developments
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #8 on: December 27, 2024, 03:39:18 pm »
150GB of space is a safe bet.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline tatel

  • Frequent Contributor
  • **
  • Posts: 613
  • Country: es
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #9 on: December 27, 2024, 04:25:03 pm »
du -sh says i'm using 186 GB on my Debian Trixie (testing) system which has KiCAD in it, but there is a bunch of software in the "electronics" section of the repositories that I didn't installed. You'd need to install Trixie in order to have KiCAD 8 with just "apt install kicad"

Also, I use XFCE desktop environment, not GNOME nor KDE which are heavier.

So I would say about 250 GB? A guy could like having some space for KiCAD projects, etc.

You could have a much lighter system but one has to know what to do; not for a newbie.
 

Offline garrettm

  • Frequent Contributor
  • **
  • Posts: 342
  • Country: us
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #10 on: December 27, 2024, 09:47:37 pm »
I'd be careful to not make the Linux partition too small to prevent ENOSPC during use ("out of space" warning--despite there still being "free space" due to how the FS allocates data). This is pretty important for BTRFS. I'd also recommend XFS over EXT4. As someone else pointed out, around 30GiB is probably large enough for most situations. But it really depends on what apps/packages you need. Anything that uses Flatpak will consume more space due to duplication of packages and versioning. The same is probably true of Ubuntu Snap packages (but I've never used them, so I could be wrong here).

I'd also not recommend a Debian based distro, except for maybe a modern Ubuntu. They usually use old packages and kernels, that make sense for a server (primarily for stability reasons), but not so much for a desktop. RedHat/OpenSuse or Arch based distros are usually better at having up-to-date packages / compiler tool chains. NixOS is an interesting option too.

Gaming performance is greatly affected by kernel version (see phoronix about 6.6 vs 6.12 context switching time), optimized kernel boot-time parameters (specific to your hardware), mesa version, and Wine/Proton version as well as DDraw/D3D wrappers (Gallium Nine, WineD3D, DXVK, VKD3D-Proton, etc.). If fully optimized, gaming performance can be better on Linux, but otherwise will likely be slower (using distro provided Wine with default WineD3D wrapper, etc.). For many graphics cards (especially Intel's Xe), OpenGL outperforms Vulkan. But you will have to profile your HW to see what works best.

If working with legacy compiler tool chains, containers are pretty handy to use. In particular, Distrobox makes installing a legacy distro effortless and simpler/faster than using a virtual machine.
« Last Edit: December 28, 2024, 01:32:33 am by garrettm »
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1739
  • Country: ua
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #11 on: December 27, 2024, 10:16:54 pm »
I'd also recommend XFS over EXT4.
My most recent experience with XFS is now about 17 years old. I don't know the current state of things, but back then it was notorious for data corruption on power loss: open files would become filled with zeroes (or have zero size, I don't remember exactly now) when power was cut. This is the reason why I never cared to use XFS since then. Ext4, OTOH, has always served me very well in every situation, and I can say that about its predecessors, ext2 and ext3, too.

I'd also not recommend a Debian based distro, except for maybe a modern Ubuntu. They usually use old packages and kernels, that make sense for a server (primarily for stability reasons), but not so much for a desktop.
This is true if we speak about the stable branch. In this case, yes, stable versions are released once in every several years, and the software often becomes way outdated by the next release.

However, the current testing branch (eventually to become the next stable release) is almost always good to go with for a desktop. It receives reasonably fresh updates, though not always the very latest ones, it rarely has any issues with package dependencies, and I see no problem recommending it for a general Linux user except maybe a very beginner one.

With a little more experience, adding sid (unstable) to your sources.list works well to have more recent packages when you need them, and then, one step further, you can add a deb-src entry for the experimental branch to download the very latest versions of source packages for what you need and build them on your local system to have the respective dependencies.

RedHat/OpenSuse or Arch based distros are usually better at having up-to-date packages / compiler tool chains. NixOS is an interesting option too.
RedHat (as well as RHEL and CentOS) has always been the most painful thing in the world for me when it came to updating packages. The infamous "RPM hell". But that was a long time ago.
I started with RedHat, but then got fed up and converted it to Debian (live, by replacing RPM binary packages with debs one by one, imagine that!) for that very reason.
Did you mean Fedora? That one's supposed to be more flexible, I think, but I've never used it.
« Last Edit: December 27, 2024, 10:20:24 pm by shapirus »
 

Online wilfred

  • Super Contributor
  • ***
  • Posts: 1415
  • Country: au
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #12 on: December 27, 2024, 10:37:19 pm »
I'd stick with Linux Mint. I've installed various software with no dramas, Kicad, Arduino, Mplab, TI's Code Composer Studio and a few others. But if you're concerning yourself with disk space in this day-and-age then I think you're taking the wrong approach. Disk is too cheap to be something to be limited by. I find dual boot to be more of a pain than it is worth. I prefer not to live with the possibility of damaging my main Windows install and having it obliterate another OS boot. Yes you can recover almost anything but why bother risking it. If you can live with a virtual machine then do that. If you really must dual boot then migrate yourself to a larger SSD and keep the current one as a fallback option.

When installing Linux I typically have a partition for the Linux OS and boot, and a separate one for my home directory.
 
The following users thanked this post: Smokey, thm_w

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 4177
  • Country: 00
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #13 on: December 28, 2024, 12:26:32 am »
you can run on 16GB disk, but it is too small, I'm running on 64GB and it looks like enough. But if you're planning to store a lot of large files it will require more, I think 128GB will be enough for most cases.
 

Offline thm_w

  • Super Contributor
  • ***
  • Posts: 7654
  • Country: ca
  • Non-expert
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #14 on: December 28, 2024, 12:44:53 am »
I find dual boot to be more of a pain than it is worth. I prefer not to live with the possibility of damaging my main Windows install and having it obliterate another OS boot. Yes you can recover almost anything but why bother risking it. If you can live with a virtual machine then do that.

Agreed, buy a bit of RAM and use virtual machine instead, eg virtualbox. If you are using DDR4 its dirt cheap.
Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 

Offline MathWizardTopic starter

  • Super Contributor
  • ***
  • Posts: 1795
  • Country: ca
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #15 on: December 28, 2024, 01:20:24 am »
you can run on 16GB disk, but it is too small, I'm running on 64GB and it looks like enough. But if you're planning to store a lot of large files it will require more, I think 128GB will be enough for most cases.
Yeah I'm forgetting Linux can get really really small, sub 1GB. I'd just want the basics, like full webrowsing, VLC player, and maybe some old games from pre-2010. And then just some common things like LTSpice, C programming IDE's, any software for my equipment like scopes/logic analyzers/etc (some of that might still need windows).

IDK what all they leave out of all the different versions, maybe Mint is still fine. Can a 5-10GB Linux do all that ?

So on a dual-boot system like before, I figured I'd put a partition it on 1 of my non C: SSD drives. My win 10 install with most of the programs I need is on a 120GB partition, but that was running low. I'd be happy if the whole Linux partition was under 50GB. Anything that didn't fit on there, I can just run from windows for now.


What Linux do software/hardware "hackers" use ? I guess any and all of them ? So far getting a bit deeper into AVR programming, a lot of the times people are talking about Linux, or recommending something made for Linux. So that's another reason I want to get Linux running again.


And another reason, windows 10 had decided I must have stock reports and sports news delay my boot up times. And so far I can't find a way to disable this crap.
« Last Edit: December 28, 2024, 01:38:50 am by MathWizard »
 

Offline garrettm

  • Frequent Contributor
  • **
  • Posts: 342
  • Country: us
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #16 on: December 28, 2024, 01:24:01 am »
My most recent experience with XFS is now about 17 years old. I don't know the current state of things, but back then it was notorious for data corruption on power loss: open files would become filled with zeroes (or have zero size, I don't remember exactly now) when power was cut. This is the reason why I never cared to use XFS since then. Ext4, OTOH, has always served me very well in every situation, and I can say that about its predecessors, ext2 and ext3, too.

XFS is currently recommended over EXT4 by Gentoo and SerpentOS. EXT4 has a lot of limitations, particularly for hardlinks, but is still receiving regular updates. As for powerloss data corruption, F2FS is particularly suceptible to this. XFS may still be. But an SSD is likely much less likely to have this happen since writes are made much faster than on a HDD. I think any FS is susceptible to this--but the kernel developers are now pushing "atomic" writes that should help mitigate this issue somewhat.

https://serpentos.com/blog/2024/12/23/serpent-os-enters-alpha/

Quote
ext4 is limited to 65k hardlinks per inode, and we were hitting this limit on some systems due to empty files. We now handle this case gracefully by creating new inodes for empty files.

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks#Filesystems

Quote
XFS
    Filesystem with metadata journaling which comes with a robust feature-set and is optimized for scalability. It has been continuously upgraded to include modern features. The only downside is that XFS partitions cannot yet be shrunk, although this is being worked on. XFS notably supports reflinks and Copy on Write (CoW) which is particularly helpful on Gentoo systems because of the amount of compiles users complete. XFS is the recommended modern all-purpose all-platform filesystem. Requires a partition to be at least 300MB.
ext4
    Ext4 is a reliable, all-purpose all-platform filesystem, although it lacks modern features like reflinks.

This is true if we speak about the stable branch. In this case, yes, stable versions are released once in every several years, and the software often becomes way outdated by the next release.

However, the current testing branch (eventually to become the next stable release) is almost always good to go with for a desktop. It receives reasonably fresh updates, though not always the very latest ones, it rarely has any issues with package dependencies, and I see no problem recommending it for a general Linux user except maybe a very beginner one.

With a little more experience, adding sid (unstable) to your sources.list works well to have more recent packages when you need them, and then, one step further, you can add a deb-src entry for the experimental branch to download the very latest versions of source packages for what you need and build them on your local system to have the respective dependencies.

I agree, but this isn't something that a newbie would know. I've never run into a packaging dependency issue with Fedora, but I've only used it since version 39 (and I have used many RPMs that are old as hell--mainly for my 20 year-old Brother printer). Maybe at one time this was an issue, but RedHat has apparently resolved this. Fedora, OpenSuse, Arch--or even a recent Ubuntu--will be simpler WRT updated packaging and compiler tool chain. When on a desktop machine, performance and security (from updated packages) is generally more important than super stable old packages. Especially when gaming--which the OP pointed out was the reason he/she switched back to Windows.

RedHat (as well as RHEL and CentOS) has always been the most painful thing in the world for me when it came to updating packages. The infamous "RPM hell". But that was a long time ago.
I started with RedHat, but then got fed up and converted it to Debian (live, by replacing RPM binary packages with debs one by one, imagine that!) for that very reason.
Did you mean Fedora? That one's supposed to be more flexible, I think, but I've never used it.

Fedora is made by RedHat; but, yes, that is what I was implying. "sudo DNF upgrade" works fine for me. And then there is the RPM command that has a few capabilities that DNF doesn't have (force install a package without deps or remove a weak dep that I don't want). I haven't had any issues with Fedora and RPMs in general. Downloaded OnlyOffice RPM for CentOS and it works fine on Fedora. And many other cases with GitHub projects that offer RPMs. Hell, even many pre-compiled binaries made specifically for Ubuntu (which is what GitHub Actions use for Linux builds) work fine on Fedora. Though I did have to make a sym link for an older shared object requested by DOSBox-X using the current SO provided by Fedora.

Ultimately the OP needs to experiment more with Linux. Asking questions is good, but there is no substitute for manual tinkering. No distro will suit everyone's needs--which is why there are so many. But each has its pros and cons. Arch (or any rolling distro) can easily break if not updated regularly. Point-release distros like Fedora and Ubuntu can become stale, but are very stable. "Atomic" distros offer the greatest stability but are more complicated to use for certain things. And, then, for ultimate performance, one can compile everything specifically for their HW as is done with Gentoo. I think the primary thing that sells a user on a particular distro is the packaging tool chain and 3rd party support for pre-compiled binaries / installable packages (.deb / .rpm). Most people--especially those coming from Windows--don't want to compile things manually from a github repo and want something that "just works": i.e., can be run with minimal work which .deb/.rpm, Flatpack/Snap or an AppImage do nicely.

I recently compiled OpenGlide from a repo that supported SDL2 (the official stale version only supports SDL1) and had to figure out a working compiler tool chain and its dependencies because they weren't listed... It wasn't hard, but many newbies would likely have given up at the first error shown in the terminal.
« Last Edit: December 28, 2024, 01:28:08 am by garrettm »
 
The following users thanked this post: MathWizard

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4840
  • Country: nz
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #17 on: December 28, 2024, 01:47:51 am »
you can run on 16GB disk, but it is too small, I'm running on 64GB and it looks like enough. But if you're planning to store a lot of large files it will require more, I think 128GB will be enough for most cases.
Yeah I'm forgetting Linux can get really really small, sub 1GB. I'd just want the basics, like full webrowsing, VLC player

AHAHAHAHAHAHAHAHA

Those are not BASICS. Those are highly advanced things which nothing pre about 1995-2000 could do in any decent way.

FFS, you don't want to run a modern web browser on something with less than about 1 GB RAM, and 4 GB is much much better.

I've had Linux (and real Unix) machines with 32-64 MB of RAM -- 0.064 GB. My SGI Indy for example was a pretty advanced and sought-after machine in its day, and it had 64 MB RAM.

No way could you run a modern web browser on that. But it was perfectly fine for developing C/C++ programs on, including programs using OpenGL.

Even today I have a $5 1 GHz Linux board on the desk in front of me with 64 MB RAM, and I use it almost every day. Not as my main computer, of course. But I can edit (in emacs), compile, and run pretty big C/C++ programs on it.

And yeah, it would be fine for writing and building AVR programs on, and directly flashing the AVR too using some of the GPIO pins.

But web browsing, or VLC? AHAHAHAHAHAHAHAHA.
 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 4177
  • Country: 00
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #18 on: December 28, 2024, 03:20:40 am »
I'd be happy if the whole Linux partition was under 50GB. Anything that didn't fit on there, I can just run from windows for now.

Some time ago, I used Linux on a 16GB disk. It included firefox, chromium, VLC, different dev tools and tool chains for C/C++, C#, python, Octave with some some packages installed like signal, Mono-Develop, VSCodium (telemetry free version of VSCode), KDevelop and some set of useful apps, like calculator, hex editor, image editors and other stuff. But at some point I realized that the free space was too low, and I needed a larger disk to install new bloated software.

I think 32GB will be enough, but I bought 64GB disk and now using it, I installed all dev things, KiCad and many other things, include some games, like 0AD :). Also I actively use compillers and they produce a lot of files. At the moment I have 45 GB used and 17 GB free. Here is current state:


The more critical is RAM size. I have just 4GB RAM and it appears too small for modern browser and dev tools, so I use zram. But still often have out of memory issue when running some Octave scripts for signal processing.
« Last Edit: December 28, 2024, 03:31:32 am by radiolistener »
 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 4177
  • Country: 00
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #19 on: December 28, 2024, 03:38:11 am »
Even today I have a $5 1 GHz Linux board on the desk in front of me with 64 MB RAM, and I use it almost every day. Not as my main computer, of course. But I can edit (in emacs), compile, and run pretty big C/C++ programs on it.

When I trying to compile btop (pretty small tool, alternative for htop) on my RPI 02w with 512MB RAM, it freezes with out of memory... zram helps, but only for 1 core, when I use all 4 cores for make it still going to freeze with out of memory. :)

The C++ compiler is very memory-hungry.
« Last Edit: December 28, 2024, 03:47:30 am by radiolistener »
 

Offline mwb1100

  • Frequent Contributor
  • **
  • Posts: 619
  • Country: us
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #20 on: December 28, 2024, 04:58:10 am »
As Langwadt said:

WSL goes a long way

Other options that are (or might be) no cost include:

  - VirtualBox (free/GPL, except for the "Extension Pack" which you likely don't need anyway)
  - VMware Workstation (which is now free for personal/non-commercial use)

If your Windows machine has a decent amount of RAM installed, many Linux distros should run fine in a VM.  If nothing else it's a free way to find out what you like or need.

Last time I looked (a while ago) USB devices didn't work in the WSL environment - at least not without some experimental software packages.  But they can be attached to a VirtualBox or VMware VM and treated exactly as a native Linux environment would treat them. The other nice thing with using a VM is that your Windows machine is completely usable at the same time and you can copy/paste to and from the VM, which I find immensely useful.

As far as Linux Mint requirements:

  • 2GB RAM (4GB recommended for a comfortable usage).
  • 20GB of disk space (100GB recommended).
  • 1024×768 resolution (on lower resolutions, press ALT to drag windows with the mouse if they don’t fit in the screen).

« Last Edit: December 28, 2024, 04:59:44 am by mwb1100 »
 

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1503
  • Country: pl
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #21 on: December 28, 2024, 05:25:26 am »
I’d strongly suggest to not use Arch Linux. With the goals you mentioned it’s only going to be pain with no gain.

Arch is a great distro, my primary system since 2010, and the most stable OS I ever had. But it puts you in administrator’s seat. This is both a privilege and an obligation. If you don’t take the role seriously, if you don’t give the system attention and care it deserves, it bites back. ;)

People imagine AI as T1000. What we got so far is glorified T9.
 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 4177
  • Country: 00
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #22 on: December 28, 2024, 05:52:45 am »
I’d strongly suggest to not use Arch Linux. With the goals you mentioned it’s only going to be pain with no gain.

I strongly disagree!

Previously I used Ubuntu and Linux Mint, they both often going into unrecoverable state after apt upgrade. I catch it at least 4-5 times. After that I decided to never use it again.

On Linux Arch I don't have such issue, it works flawlessly and in addition it has OpenCL support for my video card. Ubuntu and Mint don't have it.

Linux Arch may require some more time to install it, but it is definitely much more stable and works better. I didn't had pain with it, it just works good. On the contrary with Ubuntu and Mint I had a lot of pain to fix issues.
« Last Edit: December 28, 2024, 05:56:05 am by radiolistener »
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4840
  • Country: nz
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #23 on: December 28, 2024, 06:49:18 am »
Even today I have a $5 1 GHz Linux board on the desk in front of me with 64 MB RAM, and I use it almost every day. Not as my main computer, of course. But I can edit (in emacs), compile, and run pretty big C/C++ programs on it.

When I trying to compile btop (pretty small tool, alternative for htop) on my RPI 02w with 512MB RAM, it freezes with out of memory... zram helps, but only for 1 core, when I use all 4 cores for make it still going to freeze with out of memory. :)

The C++ compiler is very memory-hungry.

Dude. That is not a small program! I just downloaded the source code and the total of .h, .hpp, .c, .cpp files is 45000 lines of code.

When I say "pretty big programs" I mean things that you just wrote yourself, as a student or hobbyist.

And yes, the C++ compiler uses a lot of RAM on that code base. I built it on my VisionFive 2 (quad core RISC-V, quite a bit better than Pi 3 / Pi Zero 2, but a little worse than Pi 4) wth make -j4.  Each C++ compile took generally between 300 MB and 400 MB of RAM. That board has 4 GB and didn't break a sweat, with never less than 2200 MB of available Mem in top.

It would have been touch and go on a 2 GB board.

Selling a quad core 64 bit machine with 0.5 GB or even 1 GB RAM for building serious packages use is in my opinion bordering on criminal!

Build stats, btw:

Code: [Select]
Linking and optimizing binary...
100% -> bin/btop                      (1.3MiB) (01m:16s)

Build complete in (03m:02s)

real 3m1.820s
user 9m20.763s
sys 0m12.403s
user@starfive:~/btop$

You certainly can do beginning student level programming on a modern Linux with 64 MB RAM, even in C++:



That's Fedora 33, kernel 4.15, GCC 10.2.1.  Not the most recent, but not all that old, and newer would not affect the result much. With 64 MB RAM it starts up with 46.7 MB free, 49.6 MB available.

You can try it yourself (including downloading source from elsewhere using wget or git). On my M1 Mac in Chrome it runs about like a 250 MHz CPU. This C++ compile takes 15 seconds. Compiling the supplied C hello.c takes 2 seconds (the 2nd time, once the compiler has been loaded from the internet).

https://bellard.org/jslinux/vm.html?cpu=riscv64&url=fedora33-riscv.cfg&mem=64

You can experiment with the RAM setting in the URL. You'll find 32 MB boots but is too tight to be usable, especially for C++ -- g++ can compile the printf hello.c but not a std::cout one.
 

Offline tatel

  • Frequent Contributor
  • **
  • Posts: 613
  • Country: es
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #24 on: December 28, 2024, 10:46:44 am »
Working with TP-Link routers I had to put an OpenWRT image, which includes linux, in just 8 MB flash, and it needed to work with 32 MB RAM, but that's not going to do anything useful, routing aside, even 15 years ago.

OP said he had installed Mint a couple times, to me, that means he's still absolutely a newbie, but anyway... I think he could try a basic no-graphics no-servers system install, then install something like WindowMaker window manager to have a graphic desktop, then install the electronics apps he wants. Without recommended packages, of course. Just the needed ones. That would give him a minimal Linux install able to do what he wants.

But I don't really think that's something doable by someone that just installed Mint a couple times, not without quite a bit of hassle and learning. Even then, he would find that system doesn't work for printing, or gaming, or whatever, and he would need to also install packages for that. Yeah, probably that could fit in 50 GB or even less. But I don't think it would leave so much space for KiCAD projects or to build AVR things...

So, if OP values his time, my advice would be to buy a new hard disk and to do there what he wants. Easier, faster, and, at the end of the day, probably cheaper.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf