How to reduce the size of the installation?

New to Debian (Or Linux in general)? Ask your questions here!

How to reduce the size of the installation?

Postby TygerTung » 2020-08-03 17:09

I have installed Debian 9 on an old HP thin client as I wish to use it as a Pi-hole DNS server. The problem is that it only has a 1 GB flash drive, so not a lot of room.
I installed only the base system and SSL so I don't have to have a keyboard and monitor hooked up at all times.

I wish I had gotten a machine with a bigger drive now. I didn't realise that Linux had ballooned in size so much. When I started using it back in '09, Ubuntu with Gnome 2 would easily fit on a CD, so I figured a basic system would easily fit on a 1GB drive. I know I could use a USB flash drive, but I don't really want to have one sticking out the side in case it gets knocked. I just want to have a bit of spare space on the internal drive for the data logging. A bit of head room is always a good thing.

I found this page https://wiki.debian.org/ReduceDebian but I am not very advanced and don't entirely understand it all.
I used apt-get purge with all those packages listed after it with a space between them and I've freed up a little space as you can see:

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 967320 806032 144904 85% /

It didn't free up a lot of space though as you can see.

When partitioning the drive I left no reserved blocks and no swap space, so it is lucky that the machine has so much RAM (2GB).

Maybe there is enough free space now, but I am surprised how much is used up for a system with very minimal utilities and no desktop environment. Maybe there are still packages on there which I don't need. I wonder how to find out.

Amiga workbench used to fit on a single DD floppy with room for some games and other utilities, so it it surprising how big this is.

There seems to be a lot of packages installed, surely I don't need all of them!:

adduser install
apt install
apt-utils install
base-files install
base-passwd install
bash install
bsdmainutils install
bsdutils install
busybox install
console-setup install
console-setup-linux install
coreutils install
cpio install
cron install
curl install
dash install
dbus install
debconf install
debconf-i18n install
debian-archive-keyring install
debianutils install
dhcpcd5 install
dictionaries-common deinstall
diffutils install
discover install
discover-data install
dmidecode install
dmsetup install
dns-root-data install
dpkg install
e2fslibs:i386 install
e2fsprogs install
emacsen-common deinstall
findutils install
gcc-6-base:i386 install
git install
git-man install
gnupg-agent install
gpgv install
grep install
gzip install
hostname install
idn2 install
ifupdown install
init install
init-system-helpers install
initramfs-tools install
initramfs-tools-core install
installation-report install
iproute2 install
iptables install
iputils-ping install
isc-dhcp-client install
isc-dhcp-common install
kbd install
keyboard-configuration install
klibc-utils install
kmod install
krb5-locales install
libacl1:i386 install
libapparmor1:i386 install
libapt-inst2.0:i386 install
libapt-pkg5.0:i386 install
libassuan0:i386 install
libattr1:i386 install
libaudit-common install
libaudit1:i386 install
libblkid1:i386 install
libbsd0:i386 install
libbz2-1.0:i386 install
libc-bin install
libc-l10n install
libc6:i386 install
libcap-ng0:i386 install
libcap2:i386 install
libcap2-bin install
libcomerr2:i386 install
libcryptsetup4:i386 install
libcurl3:i386 install
libcurl3-gnutls:i386 install
libdb5.3:i386 install
libdbus-1-3:i386 install
libdebconfclient0:i386 install
libdevmapper1.02.1:i386 install
libdiscover2 install
libdns-export162 install
libedit2:i386 install
libelf1:i386 install
liberror-perl install
libestr0 install
libexpat1:i386 install
libfam0:i386 install
libfastjson4:i386 install
libfdisk1:i386 install
libffi6:i386 install
libgcc1:i386 install
libgcrypt20:i386 install
libgdbm3:i386 install
libgmp10:i386 install
libgnutls30:i386 install
libgpg-error0:i386 install
libgssapi-krb5-2:i386 install
libhogweed4:i386 install
libicu57:i386 install
libidn11:i386 install
libidn2-0:i386 install
libip4tc0:i386 install
libip6tc0:i386 install
libiptc0:i386 install
libisc-export160 install
libk5crypto3:i386 install
libkeyutils1:i386 install
libklibc install
libkmod2:i386 install
libkrb5-3:i386 install
libkrb5support0:i386 install
libksba8:i386 install
libldap-2.4-2:i386 install
libldap-common install
liblocale-gettext-perl install
liblogging-stdlog0:i386 install
liblognorm5:i386 install
liblz4-1:i386 install
liblzma5:i386 install
libmagic-mgc install
libmagic1:i386 install
libmnl0:i386 install
libmount1:i386 install
libncurses5:i386 install
libncursesw5:i386 install
libnetfilter-conntrack3:i386 install
libnettle6:i386 install
libnewt0.52:i386 install
libnfnetlink0:i386 install
libnghttp2-14:i386 install
libnpth0:i386 install
libp11-kit0:i386 install
libpam-modules:i386 install
libpam-modules-bin install
libpam-runtime install
libpam-systemd:i386 install
libpam0g:i386 install
libpci3:i386 install
libpcre3:i386 install
libperl5.24:i386 install
libpipeline1:i386 install
libpopt0:i386 install
libprocps6:i386 install
libpsl5:i386 install
libreadline7:i386 install
librtmp1:i386 install
libsasl2-2:i386 install
libsasl2-modules-db:i386 install
libseccomp2:i386 install
libselinux1:i386 install
libsemanage-common install
libsemanage1:i386 install
libsepol1:i386 install
libslang2:i386 install
libsmartcols1:i386 install
libsqlite3-0:i386 install
libss2:i386 install
libssh2-1:i386 install
libssl1.0.2:i386 install
libssl1.1:i386 install
libstdc++6:i386 install
libsystemd0:i386 install
libtasn1-6:i386 install
libtext-charwidth-perl install
libtext-iconv-perl install
libtext-wrapi18n-perl install
libtinfo5:i386 install
libudev1:i386 install
libunistring0:i386 install
libusb-0.1-4:i386 install
libustr-1.0-1:i386 install
libuuid1:i386 install
libwrap0:i386 deinstall
libx11-6:i386 install
libx11-data install
libxapian30:i386 install
libxau6:i386 install
libxcb1:i386 install
libxdmcp6:i386 install
libxext6:i386 install
libxml2:i386 install
libxmuu1:i386 install
libxslt1.1:i386 install
libxtables12:i386 install
lighttpd install
linux-base install
linux-image-4.9.0-13-686-pae install
linux-image-686-pae install
locales install
login install
logrotate install
lsb-base install
lsof install
mawk install
mime-support install
mount install
multiarch-support install
nano install
ncurses-base install
ncurses-bin install
netbase install
openssh-client install
openssh-server deinstall
openssl install
passwd install
pciutils install
perl install
perl-base install
perl-modules-5.24 install
php-cgi install
php-common install
php-intl install
php-sqlite3 install
php-xml install
php7.0-cgi install
php7.0-cli install
php7.0-common install
php7.0-intl install
php7.0-json install
php7.0-opcache install
php7.0-readline install
php7.0-sqlite3 install
php7.0-xml install
pinentry-curses install
procps install
psmisc install
readline-common install
rsyslog install
sed install
sensible-utils install
sqlite3 install
sudo install
systemd install
systemd-sysv install
sysvinit-utils install
tar install
tzdata install
ucf install
udev install
util-linux install
util-linux-locales install
wget install
whiptail install
xauth install
xkb-data install
xxd install
zlib1g:i386 install

According to this command, these are the only essential packages, so does that mean I can remove the rest?

dpkg-query -Wf '${Package;-40}${Essential-
}\n' | grep yes
base-files yes
base-passwd yes
bash yes
bsdutils yes
coreutils yes
dash yes
debianutils yes
diffutils yes
dpkg yes
e2fsprogs yes
findutils yes
grep yes
gzip yes
hostname yes
init-system-helpers yes
libc-bin yes
login yes
mount yes
ncurses-base yes
ncurses-bin yes
perl-base yes
sed yes
sysvinit-utils yes
tar yes
util-linux yes

Any help would be much appreciated.

Cheers,

Sam
TygerTung
 
Posts: 27
Joined: 2020-08-03 17:00

Re: How to reduce the size of the installation?

Postby Head_on_a_Stick » 2020-08-03 18:10

Use Alpine Linux instead.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12488
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: How to reduce the size of the installation?

Postby TygerTung » 2020-08-03 19:03

But will pi-hole see it as Debian?
TygerTung
 
Posts: 27
Joined: 2020-08-03 17:00

Re: How to reduce the size of the installation?

Postby Head_on_a_Stick » 2020-08-03 20:13

I know nothing about Pi-Hole, sorry, but if you want a Linux system with a minimal disk footprint then use Alpine:
Alpine wrote:a minimal installation to disk requires around 130 MB of storage

https://alpinelinux.org/about/
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12488
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: How to reduce the size of the installation?

Postby TygerTung » 2020-08-03 20:48

Thanks. PiHole is very fussy about installing on supported systems so I think I need Debian.
TygerTung
 
Posts: 27
Joined: 2020-08-03 17:00

Re: How to reduce the size of the installation?

Postby RU55EL » 2020-08-03 21:16

Please use the code button:

Code: Select all
adduser install
apt install
apt-utils install
base-files install
base-passwd install
bash install
bsdmainutils install
bsdutils install
busybox install
console-setup install
console-setup-linux install
coreutils install
cpio install
cron install
curl install
dash install
dbus install
debconf install
debconf-i18n install
debian-archive-keyring install
debianutils install
dhcpcd5 install
dictionaries-common deinstall
diffutils install
discover install
discover-data install
dmidecode install
dmsetup install
dns-root-data install
dpkg install
e2fslibs:i386 install
e2fsprogs install
emacsen-common deinstall
findutils install
gcc-6-base:i386 install
git install
git-man install
gnupg-agent install
gpgv install
grep install
gzip install
hostname install
idn2 install
ifupdown install
init install
init-system-helpers install
initramfs-tools install
initramfs-tools-core install
installation-report install
iproute2 install
iptables install
iputils-ping install
isc-dhcp-client install
isc-dhcp-common install
kbd install
keyboard-configuration install
klibc-utils install
kmod install
krb5-locales install
libacl1:i386 install
libapparmor1:i386 install
libapt-inst2.0:i386 install
libapt-pkg5.0:i386 install
libassuan0:i386 install
libattr1:i386 install
libaudit-common install
libaudit1:i386 install
libblkid1:i386 install
libbsd0:i386 install
libbz2-1.0:i386 install
libc-bin install
libc-l10n install
libc6:i386 install
libcap-ng0:i386 install
libcap2:i386 install
libcap2-bin install
libcomerr2:i386 install
libcryptsetup4:i386 install
libcurl3:i386 install
libcurl3-gnutls:i386 install
libdb5.3:i386 install
libdbus-1-3:i386 install
libdebconfclient0:i386 install
libdevmapper1.02.1:i386 install
libdiscover2 install
libdns-export162 install
libedit2:i386 install
libelf1:i386 install
liberror-perl install
libestr0 install
libexpat1:i386 install
libfam0:i386 install
libfastjson4:i386 install
libfdisk1:i386 install
libffi6:i386 install
libgcc1:i386 install
libgcrypt20:i386 install
libgdbm3:i386 install
libgmp10:i386 install
libgnutls30:i386 install
libgpg-error0:i386 install
libgssapi-krb5-2:i386 install
libhogweed4:i386 install
libicu57:i386 install
libidn11:i386 install
libidn2-0:i386 install
libip4tc0:i386 install
libip6tc0:i386 install
libiptc0:i386 install
libisc-export160 install
libk5crypto3:i386 install
libkeyutils1:i386 install
libklibc install
libkmod2:i386 install
libkrb5-3:i386 install
libkrb5support0:i386 install
libksba8:i386 install
libldap-2.4-2:i386 install
libldap-common install
liblocale-gettext-perl install
liblogging-stdlog0:i386 install
liblognorm5:i386 install
liblz4-1:i386 install
liblzma5:i386 install
libmagic-mgc install
libmagic1:i386 install
libmnl0:i386 install
libmount1:i386 install
libncurses5:i386 install
libncursesw5:i386 install
libnetfilter-conntrack3:i386 install
libnettle6:i386 install
libnewt0.52:i386 install
libnfnetlink0:i386 install
libnghttp2-14:i386 install
libnpth0:i386 install
libp11-kit0:i386 install
libpam-modules:i386 install
libpam-modules-bin install
libpam-runtime install
libpam-systemd:i386 install
libpam0g:i386 install
libpci3:i386 install
libpcre3:i386 install
libperl5.24:i386 install
libpipeline1:i386 install
libpopt0:i386 install
libprocps6:i386 install
libpsl5:i386 install
libreadline7:i386 install
librtmp1:i386 install
libsasl2-2:i386 install
libsasl2-modules-db:i386 install
libseccomp2:i386 install
libselinux1:i386 install
libsemanage-common install
libsemanage1:i386 install
libsepol1:i386 install
libslang2:i386 install
libsmartcols1:i386 install
libsqlite3-0:i386 install
libss2:i386 install
libssh2-1:i386 install
libssl1.0.2:i386 install
libssl1.1:i386 install
libstdc++6:i386 install
libsystemd0:i386 install
libtasn1-6:i386 install
libtext-charwidth-perl install
libtext-iconv-perl install
libtext-wrapi18n-perl install
libtinfo5:i386 install
libudev1:i386 install
libunistring0:i386 install
libusb-0.1-4:i386 install
libustr-1.0-1:i386 install
libuuid1:i386 install
libwrap0:i386 deinstall
libx11-6:i386 install
libx11-data install
libxapian30:i386 install
libxau6:i386 install
libxcb1:i386 install
libxdmcp6:i386 install
libxext6:i386 install
libxml2:i386 install
libxmuu1:i386 install
libxslt1.1:i386 install
libxtables12:i386 install
lighttpd install
linux-base install
linux-image-4.9.0-13-686-pae install
linux-image-686-pae install
locales install
login install
logrotate install
lsb-base install
lsof install
mawk install
mime-support install
mount install
multiarch-support install
nano install
ncurses-base install
ncurses-bin install
netbase install
openssh-client install
openssh-server deinstall
openssl install
passwd install
pciutils install
perl install
perl-base install
perl-modules-5.24 install
php-cgi install
php-common install
php-intl install
php-sqlite3 install
php-xml install
php7.0-cgi install
php7.0-cli install
php7.0-common install
php7.0-intl install
php7.0-json install
php7.0-opcache install
php7.0-readline install
php7.0-sqlite3 install
php7.0-xml install
pinentry-curses install
procps install
psmisc install
readline-common install
rsyslog install
sed install
sensible-utils install
sqlite3 install
sudo install
systemd install
systemd-sysv install
sysvinit-utils install
tar install
tzdata install
ucf install
udev install
util-linux install
util-linux-locales install
wget install
whiptail install
xauth install
xkb-data install
xxd install
zlib1g:i386 install
User avatar
RU55EL
 
Posts: 474
Joined: 2014-04-07 03:42
Location: /home/russel


Re: How to reduce the size of the installation?

Postby TygerTung » 2020-08-04 01:01

I'd rather run it on a native Debian system. I have managed to get Debian on there, I just want to free up a bit of extra room.
TygerTung
 
Posts: 27
Joined: 2020-08-03 17:00

Re: How to reduce the size of the installation?

Postby stevepusser » 2020-08-04 03:46

Sure--the compressed Debian GNOME 2 ISO used to fit on a CD, but even that sure wouldn't fit in 1 GB after being decompressed and installed. Suggest you look at the minimum requirements of that release...

If the system can boot off a USB drive, have you thought of using a persistent Live USB instead, maybe with antiX as a kind of Debian base?
MX Linux packager and developer
User avatar
stevepusser
 
Posts: 11983
Joined: 2009-10-06 05:53

Re: How to reduce the size of the installation?

Postby Deb-fan » 2020-08-04 06:59

So you've got in the neighborhood of 260 packages and are at 85% used of one GB diskspace, leaves you roughly 150mbs free. Yes I know that 1gb = 1024mbs, so not getting exact figures there but close enough for these purposes. Was revisiting something parallel to what you're discussing, that being what constitutes an absolute minimal base install, see ...

https://wiki.debian.org/BusterPriorityRequalification


Lists some interesting stuff/cmds and observations which could be useful in this context. Outlines that a mini-base is going to consist of packages with a priority of required and many of those of priority important too, on a Stretch (Debian 9) install I have, that equals out to being like 131 pkgs between the installed pkgs with a priority of required/important, 1/2 or so of what yours presently has installed, even with the packages with the priority of standard on that OS included, it's still a total of about 193 packages, still less than yours. Obviously yes, there's still plenty of things which can be removed to make a minimal install for that system, what would constitute a good/workable OS according to your tastes and the usecase here, that's clearly up to you. No graphical goodies but for someone who's used to or wants to cuddle up with command-line could be awesome.

Still this is an interesting exercise/thread. :)
Most powerful FREE tech-support tool on the planet * HERE. *
Deb-fan
 
Posts: 889
Joined: 2012-08-14 12:27

Re: How to reduce the size of the installation?

Postby TygerTung » 2020-08-04 20:36

That is a very interesting page. It looks like there isn't an option for installing that minimal base install yet, but perhaps I can just do a current base install and then remove all the removable packages?
TygerTung
 
Posts: 27
Joined: 2020-08-03 17:00

Re: How to reduce the size of the installation?

Postby Deb-fan » 2020-08-05 15:49

In a manner of speaking, yeah. If someone doesn't want to look over the gnu/Linux remixes for this sort of thing ie: Alpine, then starting with as few packages as necessary makes sense. :)
Most powerful FREE tech-support tool on the planet * HERE. *
Deb-fan
 
Posts: 889
Joined: 2012-08-14 12:27

Re: How to reduce the size of the installation?

Postby Deb-fan » 2020-08-06 01:26

Havent really explored things like ...

Code: Select all
debootstrap --variant=minbase


Seems well suited to what you're trying to do. Pretty much always stuck with selecting base + standard system utilities in the netinstall and building from there. Info in that link makes it clear someone can further remove things, even from an absolutely minimal base, though of course even that, a bare minimum install is something most arent going to be comfortable using. Answer to whomever started that webpg, seems to me could be dirty package hackery, ie: using dummy packages perhaps but didn't say dirty hackery for nothing.

Even further trimming of a min-base install could easily lead to a badly mauled or mostly unusable OS. If you decide to keep going would be cool if you'd post here about the adventure. Bound to learn some good stuff about package management fiddling around with this type of project. Think it's interesting. :)
Most powerful FREE tech-support tool on the planet * HERE. *
Deb-fan
 
Posts: 889
Joined: 2012-08-14 12:27

Re: How to reduce the size of the installation?

Postby TygerTung » 2020-08-06 20:14

I didn't even install the standard system utilities and still ended up with quite a big install which didn't seem to be lacking in anything.

What I might do is install the Debian 10 base onto a USB flash drive, thin it right out, and then clone it onto the 1GB IDE flash drive installed in the box.
TygerTung
 
Posts: 27
Joined: 2020-08-03 17:00

Re: How to reduce the size of the installation?

Postby TygerTung » 2020-08-07 00:03

I tried installing the alpine Linux, but it ran out of space on the internal IDE flash drive when I was installing it, and now when trying to restart, I can't even get the bios screen to open up; it has somehow ruined the machine?!

I am not sure how to fix it. It is still ruined even if I unplug the internal IDE flash drive.

It is a HP T510
TygerTung
 
Posts: 27
Joined: 2020-08-03 17:00

Next

Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable