Closed ltalirz closed 5 years ago
I agree that 10 GB is ok and we should try not the have a Vbox size over that (not including the .ova).
A few things we might do:
sudo apt-get clean
in a final 'cleaning-up' role (this frees up at least 500MB currently).~.cache
also is currently at 220 MB; we can clean up also /root/.cache
even if this is small
And probably there is still something that we can clean up (let's and them here and then work on it)Currently, ubuntu-desktop
has the following dependencies:
Depends: alsa-base, alsa-utils, anacron, at-spi2-core, bc, ca-certificates,
checkbox-gui, dmz-cursor-theme, doc-base, fonts-dejavu-core,
fonts-freefont-ttf, foomatic-db-compressed-ppds, genisoimage,
ghostscript-x, gnome-menus, gnome-session-canberra, gstreamer1.0-alsa,
gstreamer1.0-plugins-base-apps, gstreamer1.0-pulseaudio, gvfs-bin,
inputattach, language-selector-gnome, libatk-adaptor, libnotify-bin,
libsasl2-modules, lightdm, memtest86+, nautilus, notify-osd, openprinting-ppds,
printer-driver-pnm2ppa, pulseaudio, rfkill, software-properties-gtk,
ubuntu-artwork, ubuntu-drivers-common, ubuntu-release-upgrader-gtk,
ubuntu-session, ubuntu-settings, ubuntu-sounds, unity, unity-control-center,
unity-greeter, unity-settings-daemon, unzip, update-manager,
update-notifier, wireless-tools, wpasupplicant, xdg-user-dirs, xdg-user-dirs-gtk,
xdiagnose, xkb-data, xorg, yelp, zenity, zip
and the recommended packages (that are installed by default):
Recommends: a11y-profile-manager-indicator, acpi-support,
activity-log-manager, aisleriot, app-install-data-partner, apport-gtk,
avahi-autoipd, avahi-daemon, baobab, bluez, bluez-cups, branding-ubuntu,
brltty, cheese, cups, cups-bsd, cups-client, cups-filters, deja-dup, eog,
evince, example-content, file-roller, firefox, fonts-guru, fonts-kacst-one,
fonts-khmeros-core, fonts-lao, fonts-liberation, fonts-lklug-sinhala,
fonts-nanum, fonts-noto-cjk, fonts-sil-abyssinica, fonts-sil-padauk,
fonts-takao-pgothic, fonts-thai-tlwg, fonts-tibetan-machine, fwupd,
fwupdate, fwupdate-signed, gedit, gnome-accessibility-themes,
gnome-bluetooth, gnome-calculator, gnome-calendar, gnome-disk-utility,
gnome-font-viewer, gnome-keyring, gnome-mahjongg, gnome-mines,
gnome-orca, gnome-power-manager, gnome-screensaver, gnome-screenshot,
gnome-sudoku, gnome-system-log, gnome-system-monitor, gnome-terminal,
gnupg-agent, gucharmap, gvfs-fuse, hplip, ibus, ibus-gtk, ibus-gtk3,
ibus-table, im-config, kerneloops-daemon, laptop-detect, libgail-common,
libnss-mdns, libpam-gnome-keyring, libproxy1-plugin-gsettings,
libproxy1-plugin-networkmanager, libqt4-sql-sqlite, libreoffice-calc,
libreoffice-gnome, libreoffice-impress, libreoffice-math, libreoffice-ogltrans,
libreoffice-pdfimport, libreoffice-style-breeze, libreoffice-writer,
libwmf0.2-7-gtk, mousetweaks, nautilus-sendto, nautilus-share,
network-manager-gnome, network-manager-pptp-gnome, onboard,
overlay-scrollbar-gtk2, pcmciautils, plymouth-theme-ubuntu-logo,
policykit-desktop-privileges, ppp, pppconfig, pppoeconf, printer-driver-brlaser,
printer-driver-c2esp, printer-driver-foo2zjs, printer-driver-min12xxw,
printer-driver-ptouch, printer-driver-pxljr, printer-driver-sag-gdi,
printer-driver-splix, pulseaudio-module-bluetooth, pulseaudio-module-x11,
python3-aptdaemon.pkcompat, qt-at-spi, remmina, rhythmbox, seahorse,
shotwell, simple-scan, snapd, sni-qt, speech-dispatcher,
system-config-printer-gnome, thunderbird, thunderbird-gnome-support,
totem, transmission-gtk, ttf-ancient-fonts-symbola, ttf-ubuntu-font-family,
ubuntu-docs, ubuntu-software, unity-accessibility-profiles,
unity-webapps-common, usb-creator-gtk, vino, whoopsie, xcursor-themes,
xdg-utils, xterm, xul-ext-ubufox, zeitgeist-core, zeitgeist-datahub
I would probably leave all the necessary packages, and instead remove some of the recommended ones? Now that I look the list is pretty massive, maybe better to remove selectively what we know we don't want, to have the asnsible scripts more resilient to upgrade of ubuntu versions? Probably some of the things I would remove include:
after running sudo apt-get remove cups cups-bsd cups-client cups-filters 'printer-driver-*' fonts-* gnome-calendar gnome-font-viewer gnome-mahjongg gnome-mines gnome-sudoku libreoffice-* rhythmbox thunderbird thunderbird-gnome-support ubuntu-docs
followed by sudo apt-get autoremove
we went down by another ~800MB.
Note: in this case adapt the 'customisation' role to remove the two icons of libreoffice from the launcher.
Some of the other things listed probably can be removed but I don't know what they do and if they are essential. We should also check that everything still works... On the other hand, for some plotting libraries (even matplotlib) maybe it would be good to add a "minimal" latex installation? (this risks to be big, though)
Maybe we can also remove jmol
from the list of installed packages - anyway now it does not work, unless we install java...
Another comment - we can remove the source code of codes, or at least remove the .o and similar files at the end.
A few notes:
make clean
- I just did it, but this cleans also the .x files...cp --dereference ~/codes/pw-6.1/bin destdir
to copy only the executables (the files and not the symlinks), then rm -r ~/codes/pw-6.1/*
and finally mv destdir ~/codes/pw-6.1/bin
to keep only the binaries? (again, as a final cleanup process)Thanks for the hints!
A few comments:
apt autoremove
safe? Doesn't it remove all packages that no other packages depend on?Ok thanks!
~/.cache
I would use the ANSIBLE HOME variable as done elsewhereInteresting link (but very outdated! it's from 2008!) https://help.ubuntu.com/community/Diet%20Ubuntu
Regarding the removal of unnecessary packages (+autoremove):
I'm not quite sure how to marry this with the 'idempotency' concept. If one does it just naively, then our apt install ubuntu-desktop
will re-install those packages every time (I just checked).
So, it would seem to me that the way forward is to, instead, come up with a list of packages that we do need. Perhaps by installing ubuntu desktop, then removing unnecessary packages, then autoremove and then listing all installed packages?
Hm... I start thinking that we will just invite problems by trying to also manage all of these packages (then people don't find packages they are used to ...).
autoclean + removing ~/.cache is fine, but perhaps we should let ubuntu decide what to install. Unless there is some 'selection' like ubuntu-desktop
that better serves our needs.
Looks ok.
I would then replace the apt install ubuntu-desktop
with the explicit list of packages I list above, minus the ones I say we can remove.
We can always keep removing stuff later.
Thanks!
I wasted a few hours on this problem on Friday... it's not that trivial.
One can install ubuntu-desktop
with --no-install-recommends
but then it also seems to skip the recommended packages of the required dependencies (which causes numerous problems, e.g. lightdm fails to start).
In the slim-ubuntu-desktop
branch, I've started adding these packages back in, but it's a bit of a pain because it's not easy to figure out which missing packages actually cause the problems. Also, this list of packages might change in the future in and I don't think we want to be forced to maintain it.
Of course, instead of installing ubuntu-desktop
one could also just take the list of packages required by ubuntu-desktop
and install those directly. However, also this list may be subject to change.
I've added a question on askubuntu to see whether there is a maintainable way of achieving what we want.
Another possibility would be to switch to the LXDE - on top of Ubuntu or even on top of the lighter LUbuntu.
Currently there is no LUbuntu bento image, so LUbuntu is not an option for the moment.
Installing LXDE on top of Ubuntu works fine (just replace apt-get install ubuntu-desktop
by apt-get install lxde lxde-common
), and the image size after the common
ansible tasks are
However, the result does look a bit antiquated and would need some work... I don't think it's worth the trouble at the moment.
In summary:
To do:
rm -rf ~/.cache
(421MB on 18.10RC1)sudo rm -rf /root/.cache
(4MB on 18.10RC1) sudo apt-get clean
(979MB on 18.10RC1)sudo rm -rf /var/lib/apt/lists/*
(178MB on 18.10RC1)Not to do:
Is it worth trying lubuntu? https://www.ubuntu.com/download/flavours I don't know if 1) it's lighter 2) there are bento boxes or similar to start with
(or maybe replacing ubuntu-desktop with lxqt + additional needed packages if this does not become a huge list of things to install - see also https://www.tecmint.com/install-lxqt-desktop-in-ubuntu-fedora/)
Concerning lubuntu/lxde, see comment above. I think staying with the default ubuntu desktop is a good choice for the moment.
Ok, but note that
Lubuntu is a light, fast, and modern Ubuntu flavor using LXQt as its default desktop environment. Lubuntu used to use LXDE as its default desktop environment.
Ah sorry - I missed that. Opened #84 for this, so we can close this one.
To-do list completed in marvel-nccr/ansible-role-ubuntu-desktop@73d92233cce43100399c1c1c104ea9141a6957f5
One feedback from Mohamad: In another course, they were asked to download a VM
We are currently at:
Personally, I find 10GB acceptable, but we should be careful to not go too much beyond that. Also, I have never had to space-optimise linux systems, so perhaps someone more knowledgable could give some tips here...