
Remove unnecessary packages from Raspbian. Or how to make your Raspbian Mini ...
Raspbian is the recommended distribution for anyone starting out with Raspberry Pi, the only problem is that many packages are included by default. And since very few use raspberries as a desktop, these packages can hardly be considered necessary. On the Internet, you can find images of minimal versions (for example, from this article ), but unfortunately the 2 versions presented there (Raspbian Server Edition and Raspbian Minimal) have not been updated for more than 2 years.
In this regard, it was decided to independently cut out all unnecessary components from the installed system. On the Internet, only one more or less complete article in English was found. Most of it was taken from it with my small corrections and additions.
PS Linux connoisseurs are unlikely to have problems with this, but it can be useful for beginners.
A clean installation of the system was made (at the time of writing, NOOBS LITE version 1.4 Release date 2015-02-18 was installed).
Installation was carried out on an 8 GB flash drive, according to the instructions: www.raspberrypi.org/help/noobs-setup .
As a result, after installation, we have:
As you can see, 2,521,720 Bytes are occupied, that is 2.5 GB. Also, when loading, raspberry eats about 200 MB of RAM.
Before starting, you can run raspi-config and make the necessary settings. Here is what I changed:
To view the list of installed packages, you can use two commands:
The second command, in addition to the name, displays a description of the packages.
Delete the graphical interface and desktop environment:
Remove LXDE Tails
Delete python:
Let's remove packages for developers:
Delete raspi-config, we don’t need it anymore:
Remove sound support. There is no need on the server
After X's there is still a lot of garbage. It would also be nice to delete it:
Leave only the latest version of GCC:
The latest installed version is 4.8, the other three are deleted:
Now you can remove packages that you do not need. A list of the minimum required packages for Debian is given below. Also, when you try to delete some packages, you will receive a warning from the system. Such packages should also not be removed.
Here's what happened to me:
By executing the top command, we also deleted the SSH server, instead we will put a more lightweight dropbear:
We clear the remaining configuration files:
Clear the caches:
Delete the directory with the sample video (/opt/vc/src/hello_pi/hello_video/test.h264):
Delete the toys that are in the home directory:
Next, we clear the logs:
That's all. Checking the free space:
In total, 330 MB (swap takes 100 MB) on a USB flash drive and 42 MB of occupied RAM are still occupied. We can assume that our Raspbian Mini is ready.
Thanks article from cnxsoft
In this regard, it was decided to independently cut out all unnecessary components from the installed system. On the Internet, only one more or less complete article in English was found. Most of it was taken from it with my small corrections and additions.
PS Linux connoisseurs are unlikely to have problems with this, but it can be useful for beginners.
What is available
A clean installation of the system was made (at the time of writing, NOOBS LITE version 1.4 Release date 2015-02-18 was installed).
Installation was carried out on an 8 GB flash drive, according to the instructions: www.raspberrypi.org/help/noobs-setup .
As a result, after installation, we have:
# df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 7338472 2521720 4420928 37% /
/dev/root 7338472 2521720 4420928 37% /
devtmpfs 470416 0 470416 0% /dev
tmpfs 94944 240 94704 1% /run
tmpfs 5120 0 5120 0% /run/lock
tmpfs 189880 0 189880 0% /run/shm
/dev/mmcblk0p5 61302 19164 42138 32% /boot
As you can see, 2,521,720 Bytes are occupied, that is 2.5 GB. Also, when loading, raspberry eats about 200 MB of RAM.
Before starting, you can run raspi-config and make the necessary settings. Here is what I changed:
- Locale (4 Internationalization Options -> I1 Change Locale -> ru_RU.UTF-8 UTF-8)
- Time Zone (4 Internationalization Options -> I2 Change Timezone)
- Performance Settings (7 Overclock -> Pi2 1000MHz ARM, 500MHz core, 500MHz SDRAM, 2 overvolt)
- Reduced memory for the graphics subsystem (8 Advanced Options -> A3 Memory Split -> 16)
- SSH Enabled (8 Advanced Options -> A4 SSH -> Enable)
To view the list of installed packages, you can use two commands:
# dpkg --get-selections
# aptitude search '~i'
The second command, in addition to the name, displays a description of the packages.
Getting started to delete
Delete the graphical interface and desktop environment:
# aptitude purge x11-common lxde gconf2-common gnome-desktop3-data
Remove LXDE Tails
# aptitude purge lxappearance lxde-common lxde-icon-theme lxinput lxmenu-data lxpanel lxpanel-data lxpolkit lxrandr lxsession lxsession-edit lxshortcut lxtask lxterminal
Delete python:
# aptitude purge python python-minimal python2.7 python2.7-minimal python3 python3-minimal python3.2 python3.2-minimal
Let's remove packages for developers:
# aptitude purge `sudo dpkg --get-selections | grep "\-dev" | sed s/install//`
Delete raspi-config, we don’t need it anymore:
# aptitude purge raspi-config
Remove sound support. There is no need on the server
# aptitude purge `sudo dpkg --get-selections | grep -v "deinstall" | grep sound | sed s/install//`
After X's there is still a lot of garbage. It would also be nice to delete it:
# aptitude purge `sudo dpkg --get-selections | grep -v "deinstall" | grep x11 | sed s/install//`
Leave only the latest version of GCC:
# dpkg --get-selections | grep gcc\-
gcc-4.5-base:armhf install
gcc-4.6 install
gcc-4.6-base:armhf install
gcc-4.7-base:armhf install
gcc-4.8-base:armhf install
The latest installed version is 4.8, the other three are deleted:
# aptitude purge gcc-4.5-base:armhf gcc-4.6-base:armhf gcc-4.7-base:armhf
Now you can remove packages that you do not need. A list of the minimum required packages for Debian is given below. Also, when you try to delete some packages, you will receive a warning from the system. Such packages should also not be removed.
Here's what happened to me:
# aptitude purge xkb-data xdg-utils xarchiver weston epiphany-browser-data gconf-service gconf2-common gnome-desktop3-data gnome-icon-theme gnome-icon-theme-symbolic gnome-themes-standard gnome-themes-standard-data libgconf-2-4 libgnome-keyring-common libgnome-keyring0 libsoup-gnome2.4-1 libxml2 gconf-service gconf2-common aspell bash-completion binutils bzip2 ca-certificates cgroup-bin cifs-utils console-setup-linux cups-common dbus debian-reference-common desktop-file-utils dictionaries-common ed fbset file fontconfig fontconfig-config fonts-freefont-ttf freepats fuse gdbserver gir1.2-glib-2.0 gsfonts gstreamer1.0-libav gstreamer1.0-omx gstreamer1.0-plugins-base hicolor-icon-theme init-system-helpers initramfs-tools isc-dhcp-client isc-dhcp-common java-common keyboard-configuration klibc-utils krb5-locales less logrotate lua5.1 luajit make makedev menu menu-xdg mime-support module-init-tools ncdu ncurses-term netsurf-common nfs-common openresolv parted pciutils perl pkg-config psmisc qdbus strace tasksel usbutils v4l-utils xz-utils zenity-common libaspell15 libasyncns0 libavahi-client3 libavahi-common-data libavahi-common3 libavahi-glib1 libavahi-gobject0 libavcodec53 libavutil51 libavutil52 libbluetooth3 libbluray1 libboost-iostreams1.46.1 libboost-iostreams1.48.0 libboost-iostreams1.49.0 libboost-iostreams1.50.0 libbsd0 libcap2 libcdio-cdda1 libcdio-paranoia1 libcdio13 libchromaprint0 libck-connector0 libcups2 libcurl3 libcwidget3 libdatrie1 libdca0 libdirac-encoder0 libdrm-nouveau1a libdrm-radeon1 libdrm2 libdvdnav4 libdvdread4 libedit2 libenca0 libept1.4.12 libexif12 libexpat1 libfaad2 libffi5 libfftw3-3 libflac8 libfontenc1 libfreetype6 libfribidi0 libfuse2 libgcrypt11 libgdbm3 libgdk-pixbuf2.0-common libgif4 libgirepository-1.0-1 libgl1-mesa-dri libglapi-mesa libglib2.0-0 libglib2.0-data libgme0 libgnutls26 libgomp1 libgpg-error0 libgphoto2-port0 libgpm2 libgraphite2-2.0.0 libgsm1 libgssapi-krb5-2 libgtk2.0-common libgtop2-7 libgtop2-common libharfbuzz-icu0 libharfbuzz0a libhunspell-1.3-0 libid3tag0 libident libidn11 libilmbase6 libiw30 libjack-jackd2-0 libjasper1 libjavascriptcoregtk-3.0-0 libjbig0 libjpeg8 libjson0 libk5crypto3 libkate1 libkeyutils1 libklibc libkrb5-3 libkrb5support0 liblcms1 libldap-2.4-2 libltdl7 libmagic1 libmimic0 libmms0 libmng1 libmodplug1 libmp3lame0 libmpg123-0 libnettle4 libnewt0.52 libnih-dbus1 libnih1 libnspr4 libnss3 libofa0 libogg0 libopenal-data libopenal1 libopencv-calib3d2.4 libopencv-core2.4 libopencv-features2d2.4 libopencv-flann2.4 libopencv-imgproc2.4 libopencv-ml2.4 libopencv-photo2.4 libopencv-stitching2.4 libopencv-ts2.4 libopencv-video2.4 libopenexr6 libopenjpeg2 libopts25 liborc-0.4-0 libp11-kit0 libpipeline1 libpixman-1-0 librtmp0 libsamplerate0 libsasl2-2 libsasl2-modules libsbc1 libschroedinger-1.0-0 libsecret-1-0 libsecret-common libwebkitgtk-3.0-common libwebp2 libwildmidi-config libwildmidi1 libwnck-3-common libx264-123 libxapian22 libxau6 libxcb-glx0 libxcb-render0 libxcb-shm0 libxcb-util0 libxcb1 libxdmcp6 libxfont1 libxvidcore4 libpng12-0 libpolkit-agent-1-0 libpolkit-backend-1-0 libpolkit-gobject-1-0 libqt4-xml libqtcore4 libqtdbus4 libsigc++-1.2-5c2 libsigc++-2.0-0c2a libsndfile1 libspandsp2 libspeex1 libsqlite3-0 libsrtp0 libswscale2 libsysfs2 libsystemd-login0 libtasn1-3 libthai-data libthai0 libtheora0 libtiff4 libva1 libvorbis0a libvorbisenc2 libvpx1
By executing the top command, we also deleted the SSH server, instead we will put a more lightweight dropbear:
# apt-get install dropbear
We clear the remaining configuration files:
# apt-get purge `dpkg-query -f '${Package} ${Status}\n' -W | grep config-files$ | cut -d" " -f1`
Clear the caches:
# apt-get clean
Delete the directory with the sample video (/opt/vc/src/hello_pi/hello_video/test.h264):
# rm -rf /opt
Delete the toys that are in the home directory:
# rm -rf /home/pi/python_games
Next, we clear the logs:
# cd /var/log/
# rm `find . -type f`
That's all. Checking the free space:
# df -h
Файловая система Размер Использовано Дост Использовано% Cмонтировано в
rootfs 7,0G 430M 6,3G 7% /
/dev/root 7,0G 430M 6,3G 7% /
devtmpfs 484M 0 484M 0% /dev
tmpfs 98M 204K 98M 1% /run
tmpfs 5,0M 0 5,0M 0% /run/lock
tmpfs 195M 0 195M 0% /run/shm
/dev/mmcblk0p5 60M 19M 42M 32% /boot
In total, 330 MB (swap takes 100 MB) on a USB flash drive and 42 MB of occupied RAM are still occupied. We can assume that our Raspbian Mini is ready.
Debian - Recommended Packages
adduser
apt
apt-utils
aptitude
bsdmainutils
cpio
cron
debian-archive-keyring
debian-backports-keyring
debian-multimedia-keyring
dhcp3-client
dhcp3-common
dmidecode
ed
gnupg
gpgv
groff-base
ifupdown
info
install-info
iproute
iptables based
files
base
bash
bsdutils
coreutils
debconf
debconf-i18n
debianutils
diffutils
dpkg
e2fslibs
e2fsprogs
findutils
gcc-4.2-base
4.3--the gcc base
the gcc-4.4-base
the grep
the gzip
the hostname
initscripts
libacl1
libattr1
libblkid1
the libc-bin directory
by libc6
libcomerr2
libgcc1
liblocale-the gettext-perl
by libncurses5
for libpam-the modules
for libpam-the runtime
libpam0g
libselinux1
libsepol1
libslang2
libss2
the libstdc ++ 6
libtext-charwidth-perl
libtext -iconv-perl
libtext-wrapi18n-perl
libunwind7
libuuid1
libvolume-id1
login
lsb-base
lzma
mawk
mount
ncurses-base
ncurses-bin
passwd
perl-base
procps
sed
sensible-utils
sysv-rc
sysvinit
sysvinit-utils
tar
tzdata
util-linux
zlib1g
apt
apt-utils
aptitude
bsdmainutils
cpio
cron
debian-archive-keyring
debian-backports-keyring
debian-multimedia-keyring
dhcp3-client
dhcp3-common
dmidecode
ed
gnupg
gpgv
groff-base
ifupdown
info
install-info
iproute
iptables based
files
base
bash
bsdutils
coreutils
debconf
debconf-i18n
debianutils
diffutils
dpkg
e2fslibs
e2fsprogs
findutils
gcc-4.2-base
4.3--the gcc base
the gcc-4.4-base
the grep
the gzip
the hostname
initscripts
libacl1
libattr1
libblkid1
the libc-bin directory
by libc6
libcomerr2
libgcc1
liblocale-the gettext-perl
by libncurses5
for libpam-the modules
for libpam-the runtime
libpam0g
libselinux1
libsepol1
libslang2
libss2
the libstdc ++ 6
libtext-charwidth-perl
libtext -iconv-perl
libtext-wrapi18n-perl
libunwind7
libuuid1
libvolume-id1
login
lsb-base
lzma
mawk
mount
ncurses-base
ncurses-bin
passwd
perl-base
procps
sed
sensible-utils
sysv-rc
sysvinit
sysvinit-utils
tar
tzdata
util-linux
zlib1g
Thanks article from cnxsoft