Creating 'minDeb', a minimal-size but featureful Debian Linux installation with a lot of development tools (Installed system fitting into 2GB.) With official Debian 10.10.0 installation DVD-1: starting with install-DVD, root password mindeb, username&-password is mindeb, noatime,nodiratime on system-partition, after restart add 'init=/bin/bash' to kernel line, then 'mount -rw -o remount /' then 'passwd root' (and only install base system, leave out software menu entirely, even leaving out standard system utilities?, remove 'quiet' and add 'nosplash loglevel=3' (and 'debug'?) to grub entry in /boot/grub/grub.cfg 680MB system (150MB compressed) backup 1 -Base installation with commandline, MC, and settings, remove some unneeded stuff: 'apt install --no-install-recommends --no-install-suggests mc' +11MB --> 693MB system 'journalctl --vacuum-size=0 --vacuum-time=0 --vacuum-files=0' , set 'Storage=none' in /etc/systemd/journald.conf (journal won't be bigger than 2.5MB) rm var/lib/apt/lists/*Translation-en then create file called '99translations' in /etc/apt/apt.conf.d/ with content ' Acquire::Languages "none"; ' so apt update won't update languages create file /etc/apt/apt.conf.d/01keep-debs with content Binary::apt::APT::Keep-Downloaded-Packages "true"; - this ensures apt won't delete cached deb-packages immediately after installation (apt-get doesn't delete them btw.) instruct dpkg with /etc/dpkg/dpkg.cfg.d/01_nodoc not do install docs with lines of 'path-exclude /usr/share/locale/*' etc --> 691MB system /usr/share/locale (48MB), /usr/share/man - remove all except en/GB/US, /usr/share/doc - remove all (/etc/locale.gen has it) --> 617MB system (later maybe install 'localepurge' and set dpkg --path-exclude 'dpkg-reconfigure localepurge' to do it by software) 617MB system (xz:133MB), boot-time:15s, backup 2 -Install GUI: 'apt install --no-install-recommends --no-install-suggests xorg-xserver xinit' +242MB --> 723MB system 'apt install --no-install-recommends --no-install-suggests openbox' +63.6MB --> 780MB system 'apt install --no-install-recommends --no-install-suggests lxterminal' +81.6MB --> 843MB system, set lxterminal (geometry, font, unbind F10 & Alt-n) set X: -default typematic delay in Xorg: /etc/X11/xinit/xserverrc should be appended with ' -ardelay 225 -arinterval 30 ' parameters before "$0" -edit /etc/defaults/keyboard with XKBLAYOUT="dvorak,hu,us" and XKBVARION=",," and add XKBOPTIONS="grp:alt_shift_toggle", and test by restarting -create root and mindeb symlinks pointing to /media, unmount /media/DATA, delete /media/DATA folder 'apt install --no-install-recommends --no-install-suggests pcmanfm' +33.2MB --> 852MB system, start pcmanfm, no automount yet 'apt install --no-install-recommends --no-install-suggests gvfs' +14.4MB --> 860MB system, test pcmanfm, automount works, set PCmanFM 'apt install --no-install-recommends --no-install-suggests lxpanel lxtask' +10MB +449KB --> 867MB system 'apt install --no-install-recommends --no-install-suggests lxsession-logout lxde-common openbox-lxde-session lxinput obconf' +3.8MB +935KB +727KB +407KB +911KB --> 871MB system, exit X, startx will reopen lxde with panel, set lxinput keyrepeat-delay, set openbox margins/etc. 'apt install --no-install-recommends --no-install-suggests lxsession-default-apps lxappearance' +482KB +561KB --> 872MB system, remove Screen Locker from autostart (/etc/lightdm/lightdm.conf - add(uncomment) 'autologin-user=mindeb') disabled lightdm by "systemctl disable lightdm" to have precedence for /etc/profile startx and ~/.xinitrc files at startup add /usr/games and /usr/local/games to PATH and add startx-script to /etc/profile autologin as root on tty1: create /etc/systemd/system/getty@tty1.service.d/override.conf with content [Service] , ExecStart= , ExecStart=-/sbin/agetty --autologin root --noclear %I 38400 linux, then 'systemctl daemon-reload' , 'systemctl restart getty@tty1.service' (if want to disable other ttys, edit /etc/systemd/logind.conf line 'NoAutoVTS=1') 873MB system (xz:198MB), initrd=25MB, boot-time(to GUI):18s, backup 3 -Install apps: 'apt install --no-install-recommends --no-install-suggests xarchiver scrot zip unzip' +1.6MB +125KB +623KB +580KB --> 876MB system xarchiver integration to pcmanfm: extra rightclick-contextmenu-point-desktop-files can be added to '~/.local/share/file-manager/actions' with 'Exec=xarchiver --compress %f' (for mindeb do this for mindeb-account!) 'apt install --no-install-recommends --no-install-suggests gparted wodim genisoimage sudo' +16.4MB +925KB +1.65MB +3.8MB --> 892MB system put mindeb into sudoers file: 'usermod -a -G sudo mindeb' , then using 'groups' command should show 'sudo' as mindeb's secondary group (/etc/group) (othery way: 'gpasswd -a mindeb sudo') and use visudo to edit /etc/sudoers, add 'mindeb ALL=(ALL:ALL) NOPASSWD:ALL' to the end of the file and write it to sudoers.tmp, it replaces sudoers upon exiting visudo add repos from every available offline CDs/DVDs mounted to /media/cdrom with 'apt-cdrom --no-mount add', then 'apt update' to refresh lists 'apt install --no-install-recommends --no-install-suggests galculator zstd' +1.8MB +1.45MB --> 899MB system unpack from tar.zst ubuntu-package and copy 'epdfview' manually +200KB --> 899MB system 'apt install --no-install-recommends --no-install-suggests libpoppler-glib8 p7zip geany modemmanager network-manager-gnome net-tools usb-modeswitch ppp' +8.7MB +1MB +11MB +9.3MB +25MB +1MB +560KB +1.4MB --> 940MB system solve hostname-change and networkmanager-problem by adding 'hostname-mode=none' in [main] section of /etc/NetworkManager/NetworkManager.conf and optionally removing 'host-name' from 'request'-section of /etc/dhcp/dhclient.conf 'timedatectl set-local-rtc true' and 'timedatectl set-ntp false', reboot and set local time in BIOS add 'deb http://deb.debian.org/debian/ buster main contrib non-free' to '/etc/apt/sources.list' and uncomment backports-line and add non-free to it 'apt-get update' -> 1.03GB system 'apt install --no-install-recommends --no-install-suggests sylpheed viewnior mtpaint rar catfish links2' +519KB +24MB +3.3MB +2.5MB +800KB +5.2MB +11MB --> 1.08GB system removing unnecessary stuff: /boot/grub/locale/*.mo except english -4MB --> 1.073GB system 1.074GB system (), initrd=25MB, 19s boot, backup 4 Install more and bigger apps: 'apt install --no-install-recommends --no-install-suggests xfce4-power-manager' +8.3MB --> 1.08GB system, set power-button & screen/suspend-behaviour & trayicon 'apt install --no-install-recommends --no-install-suggests lxrandr' +30.4MB --> 1.1GB system 'apt install --no-install-recommends --no-install-suggests zlib1gdev hardinfo' +25.6MB +850KB --> 1.13GB system set geany font-size to 11 (for hungarian letters) 'apt install --no-install-recommends --no-install-suggests firefox-esr' +204MB --> 1.33GB system, don't launch it yet because it will make 10s of megabytes in ~ install intel-wifi&audio firmware: 'apt install --no-install-recommends --no-install-suggests firmware-intel-sound firmware-iwlwifi' +4.4MB +45MB -->1.38GB system - reboot -> boot 19s, initrd=25MB, disable wifi install audio (alsa, if needed, apulse/pulse): 'apt install --no-install-recommends --no-install-suggests alsa-utils tree alsa-firmware-loaders' +6MB +117KB +247KB --> ~1.44GB system, chtnau8824 doesn't work 'apt install --no-install-recommends --no-install-suggests pulseaudio pavucontrol apulse pnmixer' ~+56MB? ~+5MB? +163KB +459KB --> 1.45GB?!, both audio cards work fine in pulse and alsa, alsamixer doesn't start (pulseaudio takes over), reboot to retest 'apt install --no-install-recommends --no-install-suggests espeak liballegro4.4 make' +3MB +1.2MB +1.3MB +HermIRES+bin2array:400KB --> 1.46GB system 'apt install --no-install-recommends --no-install-suggests audacious libsdl1.2debian' +18.6MB +1.6MB +csidl:40KB +MIDItrk:300KB --> 1.48GB system 'apt install --no-install-recommends --no-install-suggests goattracker milkytracker timidity timgm6mb-soundfont' +1MB +3.5MB +1.8MB +6.2MB +Songlengths.txt:4.5MB --> 1.49GB system 'apt install --no-install-recommends --no-install-suggests libmikmod3 dosbox petris xinv3d' +1.5MB +3MB +61KB +71KB +libdvdcss2:31KB +fbxkb:50KB +netstatgui+jwmenu+confirmgui:130KB --> 1.5GB system 'apt install --no-install-recommends --no-install-suggests libglew2.1 vice' +840KB +33.7MB +VICE-ROMs(chmod 755 *) --> 1.53GB system 'apt install --no-install-recommends --no-install-suggests vlc ca-certificates' +65.6MB +1.9MB? --> 1.6GB system, reboot system, test (links2 doesn't notify about certifications now) set timeout to 2 in /boot/grub/grub.cfg, edit /usr/share/grub/default for 'nosplash loglevel=3' copy us with dvorak-hu over us with classic dvorak then 'dpkg-reconfigure xkb-data' and restart X create /root/.xinitrc for jwm, copy /etc/jwm/system.jwmrc make /etc/X11/xorg.conf.d/10-libinput.conf with Option "Tapping" "on", create relative symlink 'xterm' to lxterminal in /usr/bin copy Herminux-JWM icons and BASE white mouse-theme (+150KB) and fonts: +9MB, copy xeyes,xclock,xload from x11-apps package to /usr/bin --> 1.6GB system copy mc-sudo.desktop, us(dvorak).png to /usr/share/lxpanel/images/xkb-flags, copy xinv3d.desktop to /usr/share/applications, set mindeb's lxde settings, disable screen-locker in autostart setting SDL as audacious output instead of pulse in mindeb-account solved the SID-playback glitches!, AMIDI-plugin:timgm6m.sf2, setting VICE sounds for root in mindeb sudo (or by enabling pulse in root) 1.61GB system (xz:391MB), initrd=25MB, 20s boot, backup 5 Install development-tools: 'apt install --no-install-recommends --no-install-suggests fairymax gnuchess xboard' +230KB +738KB +3.8MB --> 1.614GB system disable kernel/etc logging in /var/log: disable every logs in /etc/rsyslog.conf 'MODULES' and 'RULES' section, 'systemctl disable rsyslog' (or remove rsyslog), replace wtmp,utmp,btmp,fontconfig.log,faillog,lastlog by /dev/null symlinks, disable X11-log: replace Xorg.0.log and Xorg.0.log.old by symlink to /dev/null --> 1.6GB system 'apt install --no-install-recommends --no-install-suggests gcc' +74.8MB --> 1.66GB system patch VLC for root account: this worked: sed -i 's/geteuid/getppid/' /usr/bin/vlc how to change default ALSA soundcard easily in root account? - created desktop-file asoundrc.desktop which opens ~/.asoundrc with mcedit containing: pcm.!default { type hw card 1 device 2 } (and maybe ctl.!default...) 'apt install --no-install-recommends --no-install-suggests g++ patch libasound2-dev libx11-dev liballegro4-dev' +44.8MB +249KB +546KB +5.48MB +2,45MB --> 1.71GB system cheat with libsdl1.2-dev:500KB, putting only this package's content on the disk and not any of the dependencies, seems to work fine. --> 2.01GB system 'apt install --no-install-recommends --no-install-suggests dhex hexedit iverilog gtkwave ngspice xplot' +126KB +73KB +chiprog:30KB +6.4MB +11.7MB +8MB +1MB 'apt install --no-install-recommends --no-install-suggests youtube-dl timidity++ avra gpsim gpasm sdcc' +6.1MB +790KB +1.5MB +6.1MB +42.3MB-(/usr/share/gputils big .inc files except PC18F2550,4550) +20M +64tass:700KB, +exomizer:300KB , add 'utility' category to geany.dekstop 'apt install --no-install-recommends --no-install-suggests xutils-dev redshift libusb0.1 avrdude libusb-dev libusb-1.0-0-dev d52 ghex qemu wget' +1.5MB +600KB +59KB +1.2MB +237KB +296KB +213KB +3.8MB +99KB +3.3MB --> 1.81GB 1.81GB (xz:431MB), initrd=25.3MB, boottime=20s system at this point, backup 6 Install firmware and more audio backends/frontends: 'apt install --no-install-recommends --no-install-suggests alsa-oss alsa-tools ld10k1 cdparanoia jackd libqt5xml5 qjackctl lame jackd1-firewire' +111KB +255KB +459KB +224KB +18.4MB +433KB +1.76MB +353KB +1.9M 'apt install --no-install-recommends --no-install-suggests fastboot adb' +8.1MB +261KB --> 1.85GB , reboot to test if all soundcards still work fine everywhere (ALSA,Pulse,Jack): set 'SDL output' in Audacious, disable pulseaudio in root autostart copy passwd.desktop and autologin.desktop jwmrc.desktop to /usr/share/applications for additional settings all firmware with installed size under 10MB: 'apt install --no-install-recommends --no-install-suggests firmware-linux' +43MB (initrd=26.6MB) 'apt install --no-install-recommends --no-install-suggests firmware-...' adi:23.6KB, ath9k-htc:164KB, bnx2:447KB(initrd=26.7MB), bnx2x:3.3MB(initrd=27.3MB) ipw2x00:1.2MB, ivtv:865KB, netxen:1.8MB(initrd=28.7MB), qcom-media:2MB, ralink:23.6KB, realtek:1.6MB(initrd=28.7MB), samsung:1.8MB, siano:1MB, zd1211:66.6KB 'apt install --no-install-recommends --no-install-suggests atmel-firmware bluez-firmware firmware-microbit-micropython hdmi2usb-fx2-firmware' +881KB +143KB +750KB +45KB 'apt install --no-install-recommends --no-install-suggests midisport-firmware nxt-firmware sigrok-firmware-fx2lafw' +164KB +304KB +158KB 'apt install --no-install-recommends --no-install-suggests firmware-myricom grub-firmware-qemu dahdi-firmware-nonfree' +3.7MB (initrd=29.2MB) +1.87MB +2.3MB 'apt install --no-install-recommends --no-install-suggests firmware-...' intelwimax:4.1MB, ti-connectivity:4.6MB, cavium:5.1MB(initrd=31.1MB), b43legacy-installer:129KB+4MB, qlogic:7.5MB(initrd=33.2MB) bigger firmware above 10MB installed size: 'apt install --no-install-recommends --no-install-suggests firmware-...' libertas:10MB, atheros:11.1MB, brcm80211:15.6MB, b43-installer:12KB+15M-download (too big to include: dns323-firmware-tools 31MB, -qcom-soc 47MB!(removes qcom-media)firmware-netronome 51.9MB, expeyes-firmware-dev:90MB!, ubertooth-firmware:468MB ) 1.988GB system (xz:481MB), initrd=33.2MB, boottime=21s, reboot, test audio-video, backup 7 (final?) 'apt install ntfs-3g dosfstools squashfs-tools xorriso mtools' +2MB(initrd=33MB) +241KB +493KB +2.3MB 'apt install --no-install-recommends --no-install-suggests isolinux archivemount intel-microcode' +212KB +70KB +3.6MB(initrd=36.4MB) --> 1.999GB system put this to /etc/fstab to avoid many writing to flash-systemdisk: tmpfs /tmp tmpfs defaults,noatime,nosuid,nodev,noexec,mode=1777,size=512M 0 0 (do the same for /var/tmp and /media (and create root & mindeb symlinks in /media to itself) instead of ~/.bash_history and ~/.local/share/mc/history create symlink to $XDG_RUNTIME_DIR/bash_history (/run/user/0 or /run/user/1000) and --||--/mc_history created in .bashrc instead of ~/.Xauthority modify $HOME/.Xauthority to $XDG_RUNTIME_DIR/.Xauthority in startx, and maybe /etc/resolv.conf) run only single instance of lxtask in jwm hotkeys (or icon) - created /usr/local/bin/lxtask-singleinstance.sh and used that in system.jwmrc hotkey-section grub selection for root/mindeb autologin - works for by using agetty in systemd with -autologin ${AUTOLOGINUSER} (modified by own C program if needed in /etc/autologinuser file) mc xdg-utils (for xdg-open to open mimetypes/associations, set them in ~/.config/lxsession/LXDE/desktop.conf and ~/.local/share/applications/mimeapps.list: png->viewnior, mp3->audacious, mp4-vlc, html->xlinks2, etc.) install or copy i386-pc to usr/lib/grub to be able to install to installer scripts EFI and PC/BIOS (file-copying and grub-installation) - grub.cfg still need to be generated (by grub-mkconfig? doesn't work) 2.012GB system (xz:500MB,squashfs:530MB) created a Makefile, removed unnecessary things from the LiveCD-template (e.g. gtk-installer, pool, firmware) and it became 100MB in size *Created LiveCD (for 64bit, 32bit and ARM too), but first set US-keyboard-layout as default if given to others? ( - install 'live-build' package ? downloads many stuffs) trying with editing Debian-livecd .iso, extracting it to a 'livecd' folder, changing livecd/live/filesystem.squashfs and livecd/live/initrd? mksquashfs minDeb-filesystem minDeb-liveCD/filesystem.squashfs -comp xz -no-recovery -always-use-fragments -b 1048576 , copy to 523MB livecd/live folder, and use mkisofs to repack iso: xorriso -outdev minDeb.iso -volid minDeb-liveCD -padding 0 -compliance no_emul_toc -map minDeb-liveCD / -chmod 0755 / -- -boot_image isolinux dir=/isolinux -boot_image isolinux system_area=/usr/lib/ISOLINUX/isohdpfx.bin -boot_image any next -boot_image any efi_path=boot/grub/efi.img -boot_image isolinux partition_entry=gpt_basdat (other syslinux-only way: mkisofs -o minDeb.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -J -R -V 'minDeb-10.10.0') WORKS!!! (with big initrd of original debian-lxde-livecd) except dvorak in console and autologin, and installer complains about wrong CD (should make own installer or correct it?) solve: JWM Alt+TAB (on LiveCD in PEAQ?) doesn't always cycle through all tasks when ALT is held down, just switches the two latest as if ALT was released inbetween TAB presses no battery indication on Peaq, nothing in /sys/class/power_supply (I2C problem? 'dmesg | grep i2c' tells AXP288 found and some errors on i2c-KIOX010A, replaced intel_cht_int33fe.ko from lubuntu-20.04 but no dice) remove unneeded?: (gnome-screensaver:25MB,dep:iso-codes,etc.), checking what can be deleted: /usr/lib is big, biggest but can't delete: libllvm7,libicudata,dri /usr/share: locale:-98MB, icons/Adwaita/cursors (mouse, replace with BASE?), (xkb-symbols:1.9MB), 'help' folder:-3.3MB, gnome/help/gparted:2.5MB delete most languages... ---> 1.366GB system check what can be removed: locales:-17MB --> 1.98GB system more stuff? (gnome-screensaver:25MB), (qjackctl:31MB) (xfburn:36MB), (build-essential(dpkg-dev):51.5MB), (openscad:65MB), (audacity:75.6MB), (handbrake:83.2MB), (abiword:90MB), (synaptic:135MB), (pitivi:168MB), (wine:264MB) installed libi2c0:+34.8KB -> 2.062GB system installed live-build (to create LiveCD): +1.5MB -> 2.056GB system installed locales:+16.5MB and localepurge:+45KB, deleted unneeded charmaps:-3M and unneeded locales:-8M, added Herminux-fonts:+9MB deleted ~/.cache/mozilla and ~/mozilla folders ad re-set firefox, then deleted ~/.cache/mozilla again:-14MB(root), -10MB(mindeb), delete /usr/share/X11/locale unneeded and /usr/share/X11/xkb/symbols unneeded only default non-bold fonts seen on GUI, mkfontdir/update-fonts-dir/update-fonts-alias/update-fonts-scale needed? where are they? -remove unnecessary packages from base-system (how to check installed packages? - 'dpkg -l' or 'dpkg --get-selections | grep -v deinstall | less') -'apt purge locales' (and deps like ispell and ibritish, dictionaries) -16.5MB 'apt autoremove' -1.7MB, debconf-i18n -800KB, debian-faq -1.3MB, -(doc-debian 170KB?), gdbm-l10n -282KB, geoip-database -8.1MB, iso-codes -20MB, (libgeoip1 and deps -8.3MB?), libx11-6 (and deps, -1.8MB), libx11-data -1.7MB + autoremove -400KB, -man-db -2.7MB ?, manpages -1.5MB?, autoremove libpipeline1 -87KB, reportbug -253KB, rsyslog -1.85MB, logrotate -154KB, (shared-mime info -5MB?), tzdata -3MB, -vim-tiny -1.4MB, vim-common -342KB, wamerican -1MB ---> 1.07GB system, reboot to test if net and others still OK -boot/efi/EFI - old installation entries remianed, delete them -/usr/share/locale (~70MB) - remove the biggest or all (or set /etc/locale.gen or /var/lib/locales/supported.d/ and install 'localepurge' (reinstalls 'locales') or 'locale-gen --purge ' and set dpkg --path-exclude 'dpkg-reconfigure localepurge' to do it by software) -/usr/share/i18n, delete all in /usr/share/doc, instruct dpkg with /etc/dpkg/dpkg.cfg.d/01_nodoc not do install docs with lines of 'path-exclude /usr/share/doc/*' etc, delete all in /usr/share/man -remove unnecessary packages (around max. 70MB can be freed): check installed packages 'with dpkg -l', remove them with 'apt purge xxx' debconf-i18n:-800K, gdbm-l10n:-282K, vim-common:-1.7M, rsyslog:-1.85M,logrotate:-154K, tzdata:-3.1M, (locales:-16.5M (locale configs and i18n folder)) -> 680MB system -install essential apps for configuration/filehandling: mc:+108MB , apt purge libgdbm6:-27.7M, 'apt autoremove' (perl-modules-5.28: -19.3M), apt purge libicu63:-39.3M (and deps:libxml2,shared-mime-info), configure mc for root -> 701MB system -delete unnecessary folders/files (around 80MB can be freed): delete /boot/grub/locale folder (-3MB) (/var/log/installer/cdebconf/templates.dat? 13.7MB what is it? and /var/lib/dpkg/info is 7M <-- keep an eye on these /var/log folders later if they grow, if logrotate needed or logging can be disabled) /usr/share/locale (55MB) - remove all except US (/etc/locale.gen has it) (later maybe install 'localepurge' and set dpkg --path-exclude 'dpkg-reconfigure localepurge' to do it by software) apt purge locales (-16.5MB) -> /usr/share/i18n(15MB) deleted, (strip /usr/bin and /usr/sbin executables later? if they are not stripped already, be careful with compilers or whatever that needs debug-symbols for gdb/etc.) -> 592MB system, reboot to test (with both root and mindeb account and mc) 717MB (xz:155MB) system size, see what was so big... well, it's just /var/cache/apt and var/lib/apt, no way to reduce... saving a 2nd backup way to reduce... saving a 2nd backup o reduce... saving a 2nd backup