Author Topic: Whats a minimal Linux install for electronics/tech programs  (Read 3541 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.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 28504
  • 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 »
 

Offline 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: 4178
  • 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: 4178
  • 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: 4178
  • 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: 1504
  • 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: 4178
  • 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.

 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1739
  • Country: ua
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #25 on: December 28, 2024, 11:10:27 am »
XFS is currently recommended over EXT4 by Gentoo and SerpentOS.
Haha. That's a good enough reason for me not to use it. Just kidding (or maybe I'm not).

EXT4 has a lot of limitations, particularly for hardlinks, but is still receiving regular updates.
65k hardlinks per inode limit is a valid concern for those whose applications may require to have more, of course. I would call this a rare edge case scenario, but it's still a valid one.

Otherwise, ext4 is a mature production-ready file system, which is widely used as such, has been around for decades and is the default fs in countless setups.

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.
That's not the kind of data corruption I was talking about. What you mentioned is corruption of data that was pending write when a power loss happens, correct? Of course this can be an issue with any fs, to a varying degree (from writing partial data to writing all or nothing, if proper atomic writes are implemented).
What I mentioned was loss of entire files that simply had to be open()'ed (I'm not sure if open for writing was necessary or open for reading was sufficient too) to be affected by this.

https://superuser.com/questions/84257/xfs-and-loss-of-data-when-power-goes-down

...and more links can be found, but they're mostly old. I can't quickly find a good article describing in detail exactly what I experienced back then. Maybe it has been fixed since. But I don't trust it anyway. Besides, with modern drives I see no reason to use anything but the battle-proven ext4, except for the situations when specific features may be required, like those supposedly provided by btrfs and maybe others.

To be honest, I did try to use XFS a couple of times since then -- of course only for partitions holding cache/temporary files, but which would benefit from faster access. But I did not notice any performance improvement over ext4 in my tests, so I ditched the idea.

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.
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).
Well, I would say that a newbie can more or less equally easily run into issues with any distro. And with any distro, a newbie can quickly become a non-newbie if learning the OS more deeply presents any interest -- and I think that with Linux it's more a necessity than an aimless curiosity.

Another point is that these days the amount of documentation and community support on the internet in general is huge. Which makes me think that for a newbie the best distro to choose would be the one that has a good compromise between the size of the community and the skill level of a typical member of the community. I've not used pretty much anything beyond Debian (and Ubuntu, which is the same thing, though lately it started to somewhat diverge with this "snap" bullshit of theirs) and, in the distant past, RHEL/CentOS, so I'm in no position to compare, but, from the information seeker's perspective, I want to point out that Arch seems to have a great community and they surely have an excellent knowledge base at wiki.archlinux.org, which kinda suggests that those folks know what they're doing.
 

Online DiTBho

  • Super Contributor
  • ***
  • Posts: 4461
  • Country: gb
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #26 on: December 28, 2024, 12:03:54 pm »
The C++ compiler is very memory-hungry.

Code: [Select]
2023-12-23--19-29---2024-12-28--11-32 - [ dev-util/cmake ] - success - DiTBho@2.18/4.1.2

cmake(1) is written in C++, and is one of the worst things I've ever tried to compile on a small GNU/Linux board computer.

1 core, MIPS32r2/le @ 400Mhz
64Mbyte dram @ 66Mhz
3 NIC, 10/100Mbps each
1 pATA microdrive, 4Gbyte(3), 5Mbyte/sec
no USB

The compiler(2) ate itself up to 600 Mbytes of swap (32bit kernel/mips limit here), and since I have no space on the microdrive for the swap partition and no more than 64 Mbytes of soldered RAM, I had to use the network heavily, which is also limited to 8 Mbytes/sec

Not ideal, you can see for yourself how long it took to complete on that machine.

Proof of concept, it's technically possible, if you can dare and have the patience to wait several days ...

Modern gcc-toolchains are much worse, they consume much more ram, I'm still working on it

(1) dev-util/cmake v2.6.4
(2) gcc v4.1.2, binutils v2.18
(3) does not accept more than 4GB

edit:
p.s.
you have a PM  :D
« Last Edit: December 31, 2024, 12:18:54 pm by DiTBho »
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 4178
  • Country: 00
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #27 on: December 28, 2024, 01:47:39 pm »
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...

16GB disk is more than enough for KiCad and C/C++ programming for ARM/STM32/etc. The problem may happens if you want to compile and install very bloated software, like VSCodium/VSCode. But for MCU programming Geany editor is more than enough.

As I said, I used a 16GB disk for some time and had all these things working without any issues. The low disk space problem started when I began installing too many bloated software packages.

For example, Octave 9.2 consumes about 800 MB, which is a significant portion of space on a 16GB disk, so you need to take that into account. With a 64GB disk, you can install all these things without worrying about it.

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.

Yes, my example is definitely not lightweight in terms of memory consumption for C++ compiling, but it is smaller compared to compiling a large project.

Another issue with RAM is trying to run student code in Octave. I'm not even sure that Octave can run on 64MB of RAM.
« Last Edit: December 28, 2024, 02:04:27 pm by radiolistener »
 

Offline eugenenine

  • Frequent Contributor
  • **
  • Posts: 871
  • Country: us
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #28 on: December 31, 2024, 02:04:31 am »
I'm using 22GiB right now, not counting home. I have Libreoffice, KiCAD, VLC, KDEnlive, Viking GPS/Mapping, gmm arm, paspberry pi pico sdk (without visualCrappio), some emulators, couple games, etc. I don't care for any of the "modern" distros where they install a bunch of bloat. I tried a couple and went back to Slackware.
 

Offline wilfred

  • Super Contributor
  • ***
  • Posts: 1415
  • Country: au
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #29 on: December 31, 2024, 02:16:35 am »
I'm using 22GiB right now, not counting home. I have Libreoffice, KiCAD, VLC, KDEnlive, Viking GPS/Mapping, gmm arm, paspberry pi pico sdk (without visualCrappio), some emulators, couple games, etc. I don't care for any of the "modern" distros where they install a bunch of bloat. I tried a couple and went back to Slackware.

I'm all for the retro-grouch, I might even be one, or I'm just cheap. But at some point the cheap vast expanse of current SSD's makes the line between bloat, and I just don't care it's there, moot.  More important to me is how easily I can get any software installed and use it. That's the best distribution for me or at least it's good enough. I spend very little time fiddling with and looking at the desktop.

I use and recommend Linux Mint, just for this reason. Is there a better distro? Maybe. But I just can't be bothered to find out or change to it. Mint is good enough.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 21462
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #30 on: December 31, 2024, 09:51:55 am »
I'm using 22GiB right now, not counting home. I have Libreoffice, KiCAD, VLC, KDEnlive, Viking GPS/Mapping, gmm arm, paspberry pi pico sdk (without visualCrappio), some emulators, couple games, etc. I don't care for any of the "modern" distros where they install a bunch of bloat. I tried a couple and went back to Slackware.

Double that, if you use FPGA tools.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Online langwadt

  • Super Contributor
  • ***
  • Posts: 4884
  • Country: dk
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #31 on: December 31, 2024, 01:00:54 pm »
I'm using 22GiB right now, not counting home. I have Libreoffice, KiCAD, VLC, KDEnlive, Viking GPS/Mapping, gmm arm, paspberry pi pico sdk (without visualCrappio), some emulators, couple games, etc. I don't care for any of the "modern" distros where they install a bunch of bloat. I tried a couple and went back to Slackware.

Double that, if you use FPGA tools.


yeh, Vivado is +40GB, ISE is ~20GB

but, a 256GB SSD is like 20€

 

Offline eugenenine

  • Frequent Contributor
  • **
  • Posts: 871
  • Country: us
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #32 on: December 31, 2024, 11:45:36 pm »
More important to me is how easily I can get any software installed and use it.

My most recent use of a "modern" distro. I had picked up a Raspberry Pi 400 on clearance at Micro Center which came with a Rasbian install (debian based). I ran their apt get install whatever for openSCAD and it wouldn't run. troubleshooting I found that it had installed a wrong version of the Opencascade dependency so I had to download it from source and build it myself.
Slackware I go to slackbuilds.org and search for openscad and it tells me it needs opencascade and the version and has the slackbuild for it. I download both and run the builds and it works fine the first try and took less time to install than to troubleshoot why debian/rasbian's version didn't work.
So Slackware IMHO is easier to get software installed and use.
 

Offline Smokey

  • Super Contributor
  • ***
  • Posts: 3091
  • Country: us
  • Not An Expert
 

Offline wilfred

  • Super Contributor
  • ***
  • Posts: 1415
  • Country: au
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #34 on: January 01, 2025, 01:35:45 am »
More important to me is how easily I can get any software installed and use it.

My most recent use of a "modern" distro. I had picked up a Raspberry Pi 400 on clearance at Micro Center which came with a Rasbian install (debian based). I ran their apt get install whatever for openSCAD and it wouldn't run. troubleshooting I found that it had installed a wrong version of the Opencascade dependency so I had to download it from source and build it myself.
Slackware I go to slackbuilds.org and search for openscad and it tells me it needs opencascade and the version and has the slackbuild for it. I download both and run the builds and it works fine the first try and took less time to install than to troubleshoot why debian/rasbian's version didn't work.
So Slackware IMHO is easier to get software installed and use.

Slackware might be easier to install OpenSCAD on is all you can conclude from your example. And I am not here to convert you away from it. I recall trying Slackware out a long time ago, I tried Ygdrassil too and SUSE, Fedora, Redhat, Ubuntu and I've settled on Mint because until it gives me a reason to change I just won't bother anymore. I've spent more than enough time changing Linux Distros when I was younger.

You didn't give much info on just where the incorrect dependency error was in the install you did, but on the brief search I did I did not find a rash of reports of it. That is my usual first test to see if it is a common or widespread issue and if there is a likelihood of a fix being already available. I also found out that there is a thing called Pi-Apps which has an install for OpenSCAD.

Unlike Windows or whatever the Apple OS is called, Linux with the plethora of different distros available  does introduce a bit of uncertainty as a result. It is both good and bad depending on what your motives are in using Linux. If you want the freedom to choose without being tied to a giant corporate overlord then you accept it as a consequence of different developers doing different things. If on the other hand you want to use Linux because it is "free" from cost then you may be less idealistic in accepting the lack of homogeneity  that comes with a single monolith OS like Windows. I think choosing Linux is partly a lifestyle choice and it will remain so until it too becomes a single monolith. Which would defeat the purpose for it to even exist. So it is what it is. Linux Mint is near the most popular distro  and so it can to some extent straddle the gap between freedom of choice and freedom from choice. But debating which Linux distro is the best is so utterly pointless I don't bother. The list of top distros by popularity is the answer to that question. I just looked at what others were doing and went with that.
 

Offline eugenenine

  • Frequent Contributor
  • **
  • Posts: 871
  • Country: us
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #35 on: January 01, 2025, 03:43:00 am »
Just one example. Another was just trying to update and seeing a Microsoft repo get added, unplugged it and wiped the SD card at that point. But other distros had similar from the dependancy hell in redhat or some program not being in a distro's repos so I had to build from source which apparently their package manager didn't like. When you use those distros that automatically install every dependency for you then you end up not knowing whats going on your system. Another issue is having to learn distro specific tools. Everything is so much easier without all the extra stuff that was supposed to make things easier. So many kids growing up on Windows/Mac think their Linux distros should be similar just makes things worse. Keep it simple and pure.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4840
  • Country: nz
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #36 on: January 01, 2025, 06:02:48 am »
Slackware might be easier to install OpenSCAD on is all you can conclude from your example.

Or more precisely THAT (unspecified) version of Slackware was easier than THAT (unspecified) version of Raspbian.

I just did sudo apt install openscad on my Ubuntu 24.04 x86 machine and it worked perfectly on things from Thingiverse.
 

Offline wilfred

  • Super Contributor
  • ***
  • Posts: 1415
  • Country: au
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #37 on: January 01, 2025, 07:03:20 am »
Slackware might be easier to install OpenSCAD on is all you can conclude from your example.

Or more precisely THAT (unspecified) version of Slackware was easier than THAT (unspecified) version of Raspbian.

I just did sudo apt install openscad on my Ubuntu 24.04 x86 machine and it worked perfectly on things from Thingiverse.

Exactly right.

I never find a new problem no-one has reported before me. I'm not living close enough to the leading edge for that. If I can't find a hit on the problem then I start looking at my system because I probably missed something I should have done or did something I shouldn't have done.

Using one of the popular distros that thousands of others use to just get stuff done is a pretty safe bet.
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1739
  • Country: ua
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #38 on: January 01, 2025, 09:53:27 am »
I never find a new problem no-one has reported before me. I'm not living close enough to the leading edge for that.
I am. I have sid in my sources.list. Even with that, I exceptionally rarely run into any dependency issues when installing packages. It happens more often that apt wants to install something that I don't (yet) want as depencencies, in that case I will either install the desired parent package from testing or download the source package from sid and rebuild it on the local system to make it have dependencies on my locally installed libs.

Even the huge near-cataclysm event that Debian has undergone recently -- the t64 libraries transition -- did not cause much trouble for me with my mixed stable+testing+sid system (plus a handful of 3rd-party repos).

So I'm inclined to think that in the case mentioned above it was either an edge case maybe involving some 3rd-party repos or a user error such as forgettting to run apt update before installing the package. Might have also been some glitch in raspbian itself, or with a particular package repo mirror.
 

Offline Infraviolet

  • Super Contributor
  • ***
  • Posts: 1190
  • Country: gb
Re: Whats a minimal Linux install for electronics/tech programs
« Reply #39 on: January 03, 2025, 08:39:07 pm »
I'm not sure if the idea of a "minimal install" makes sense here. The space saved by trying to make an install minimal is probably pretty minor compared to the space needed for packages like FreeCAD and KiCAD anyway. A better strategy is surely to start with a stable and easy to use distro (Linux Mint is a good choice, Ubuntu can be a good choice, if you want .rpm rather than .deb files then there are other distros from a non-debian background which are aimed at a similar ease-of-use point), then just install each tool you need and let the distro handle the dependencies for you. One thing I will say about space saving and program installs on Linux, is that certain packages for the Latex document production suite (very common in academia for research papers) are remarkably space hungry (multiple gigabytes taken up by just one part of them), so if you use Latex to write up documentation then better to do that on another system if you want to save space on the install you're discussing here. The idea of minimal installs only really applies when you're setting up Linux to run on an embedded device, in which case you're probably not installing CAD tools and other user-interactive GUI focused complex programs at all.

Note: I made such a Linux Mint based install, not optimised for being minimal, just for having all my commonly used programs in it, as a Timeshift image. It comes to under 60GB as an image, and that is including the big latex packages I mentioned, and all the other programs I could think of commonly using (not just for electronics but for general PC usage and basic video and audio processing too) and it also includes a few tens of GB of useful files I included as things I might want as reference materials. In use the install takes about 44GB of space in the root partition, and a few tens of GB in home.
« Last Edit: January 03, 2025, 08:44:41 pm by Infraviolet »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf