My requirement is to make a Custom Ubuntu 16.04.5 version in which the customization that i want is addition of two different users some new files in each of these two users and some new packages or drivers which i will either install with apt or pip or will build from source itself (like OpenCV).
This custom OS is expected to be used to installed on different hardwares which might vary in terms of motherboard, RAM and HDD/SSD.
Can you suggest me some software best suited for this task?
I heard of Cubic also but will it works for creating users and building packages from source?
Or Setting up one machine with all settings and packages and taking a backup of the same as live CD using some tools like systemback etc will work across different hardware?
Edit: This is not duplicate to any other question as it has addition of user in custom Ubuntu and no answers have ever mentioned it.
Best Answer
This is exactly what Cubic does...
User Home Directory
In Cubic, add generic files, that should appear in all new user's home directories, inside the
/etc/skel
directory. Whenever a new user is created, files from this location are copied into the new user's home directory.For example, if you want all users to have an empty
Temp
folder inside thir home directory, create aTemp
folder inside/etc/skel
. If you want all users to have the same configuration for Gimp, add it here as well. If you want all users to have the option to create*.docx
,*.pptx
,*.xlsx
, or*.txt
files by right-clicking in Nautilus, simply add the templates here.Here is an example layout for
/etc/skel
...You could potentially copy user configurations from the home directory of a running system into this directory. But I would not recommend that approach, since you have to be very careful not to copy user specific files.
User Default Settings
A better way to setup default user preferences is to create a file called
90_ubuntu-settings.gschema.override
and place it in/usr/share/glib-2.0/schemas/
directory in Cubic.Here is an example file:
(You can see what the correct keys and values are using
dconf-editor
. Also, look at this answer on how to backup your Gnome Tweaks configuration to a file).Then, compile this schema file using:
All users will have the preferences you specified in
90_ubuntu-settings.gschema.override
.Adding New Users
To add new users, in Cubic, use the following command for each new user you want to create:
The new users will inherit the changes you made in
/etc/skel
, and they will have the default settings you specified in90_ubuntu-settings.gschema.override
.Installing Applications
In addition to installing applications using
apt
, you can also install downloaded packages usingdpkg -i <package>.deb
.Here is an example installing a package using
pip
:These packages will be available in the ISO generated by Cubic.
Compiling Applications from Source
You can also compile packages from source. Just download or copy the source files into Cubic. Make sure you have all required build tools installed, and build your packages.
Here is an example to compile and customize Geany from source, inside Cubic:
The compiled and installed applications will be available in the ISO generated by Cubic.
Drivers
If you are installing drivers, be sure to install
dkms
. Here is an example installing bluetooth an microcode drivers. I've also been successful setting up Nvidia drivers in Cubic.Also, in my experience, it is a good idea to not change or update the kernel Cubic if you are going to install drivers. This is because the chroot environment uses the same kernel as your host machine, so, sometimes, the drivers are installed for that kernel.