-
Notifications
You must be signed in to change notification settings - Fork 104
Terminal Page
The Cubic Terminal Page is a virtual environment where you can customize your Linux file system. You will need to use the command line, but because you are logged in as a root user, you do not need to use sudo when typing commands.
Any changes you make to the file system are applied immediately. When you are done making your changes, click the Next button. Remember, you can always come back to the terminal environment for this project to make additional customizations in the future.
If you accidentally exit the virtual environment, it will automatically restart.
There are no active services in this virtual environment, as you would find in an actual running OS. This is because the terminal in Cubic is not a "running" OS. It is a secure, sand-boxed file system that you have root access to, in order to edit, add, or delete files. Thus, services such as snapd, systemd, X11, etc. can not run in the virtual environment in Cubic.
You may use the nano text editor to edit files. For example, to edit the sources repositories list, type
nano /etc/apt/sources.list
To exit nano, type Ctrl+X and you will be prompted to save the file. Type Y to save the file, and press Enter to accept the default file name. Otherwise, type N to cancel saving the file.
The right-click context menu allows you to select all text, copy text, and paste text in the terminal. Additionally, the keyboard shortcut Ctrl+Shift+A can be used to select all text, Ctrl+Shift+C can be used to copy text, and Ctrl+Shift+V can be used to paste text.
You may copy files or directories into the current directory by dragging them onto the terminal window, by using the copy button in the header bar, or by using the right-click context menu. Always remember to cd to the directory where you want to copy files into.
The Terminal Copy Page will be shown, listing the files to copy. This page only supports copying local files. To copy files over the network, use the rcp or scp commands within the terminal environment.
For older version of Ubuntu, DNS lookups may not work in this environment, so apt will present a "Name or service not known" error. This is because the link /etc/resolv.conf points to /run/systemd/resolve/stub-resolv.conf. But stub-resolv.conf does not exist.
To resolve this, execute the following commands...
mkdir /run/systemd/resolve/
echo "nameserver 127.0.1.1
search network" | tee /run/systemd/resolve/resolv.conf
ln -sr /run/systemd/resolve/resolv.conf /run/systemd/resolve/stub-resolv.conf
Your customizations may be tested from the Project Test page (for previously generated projects) or from the Finish Test page after you have generated your custom ISO.
While customizing newer versions of Ubuntu (Ubuntu Server Impish Indri 21.10 and newer, Ubuntu Desktop 23.04 Lunar Lobster and newer), some of your customizations may not be visible in the Live Environment because the "overlay" file system (that contains the Subiquity Installer snap package) may obscure your changes. However, when you install your modified OS, the "overlay" file system is not copied onto your computer, and the customizations you made on the Terminal page will be installed.
Snaps cannot be installed using Cubic. However, you can use this technique to remove Snaps for the following versions of Ubuntu:
- Ubuntu Server 22.04 LTS (Jammy Jellyfish) and newer
- Ubuntu Dedktop 23.10 (Mantic Minotaur) and newer
For these versions of Ubuntu, do not remove snapd because Ubuntu's installer is a snap app that requires this package.
Manually remove any related deb packages associated to the snap packages you removed on the previous Snaps page. For example,...
-
If you removed the Firefox Snap, remove the corresponding Debian package using:
apt --yes --quiet --quiet --quiet autoremove --purge '?name(firefox)' -
If you removed the Thunderbird Snap, remove the corresponding Debian package using:
apt --yes --quiet --quiet --quiet autoremove --purge '?name(thunderbird)'
The Ubuntu installer snap package ubuntu-desktop-bootstrap requires an Internet connection do download updates while installing the customized OS. Without an Internet connection, the installer crashes. However, if you intend to run the installer off-line, installing linux-generic and linux-headers-generic seems to resolve the issue (at least on Ubuntu 26.04)
apt --yes install --reinstall linux-generic
apt --yes install --reinstall linux-headers-generic
If the Snap Seed service takes too long, during boot up, set a time-out (such as 60 seconds) as follows.
mkdir --parents /etc/systemd/system/snapd.seeded.service.d
echo -e "[Service]\nTimeoutStartSec=60s" | tee /etc/systemd/system/snapd.seeded.service.d/override.conf
Snaps cannot be installed using Cubic. However, you can use this technique to remove all Snaps for the following versions of Ubuntu:
- Ubuntu Server 21.10 (Impish Indri) and older
- Ubuntu Desktop 23.04 (Lunar Lobster) and older
For these versions of Ubuntu you can simply remove the snapd package to remove all snaps.
apt --yes --quiet --quiet --quiet autoremove --purge snapdHere is an example to copy additional wallpapers into your customized environment.
cd /usr/share/backgrounds
Then simply drag the new wallpapers onto the Cubic window.
Tip: Be sure to list the new wallpapers in an XML file under /usr/share/gnome-background-properties, so they will be listed in the Change Background dialog when the user right-clicks on his/her desktop.
You can replace the Firefox Snap with a Debian version.
-
Select the Firefox snap on the previous Snaps page to remove it.
-
On this page, remove the existing Debian package that forces installation of the Snap version of Firefox.
apt --yes --quiet --quiet --quiet autoremove --purge '?name(firefox)' -
Prioritize the Debian package version of Firefox.
nano /etc/apt/preferences.d/firefoxAdd the following and type CTRL-X, Shift-Y, Enter to save.
Package: firefox* Pin: release o=Ubuntu* Pin-Priority: -1 -
Add the Mozilla repository
apt update apt install software-properties-common add-apt-repository ppa:mozillateam/ppa -
Finally, install the Firefox Debian package.
apt update apt install firefox
You can replace the Firefox Snap with a Debian version.
-
Select the Firefox snap on the previous Snaps page to remove it.
-
On this page, remove the existing Debian package that forces installation of the Snap version of Firefox.
apt --yes --quiet --quiet --quiet autoremove --purge '?name(firefox)' -
Import the Mozilla APT repository signing key.
install -d -m 0755 /etc/apt/keyrings wget --tries=3 --timeout=120 --continue --no-clobber https://packages.mozilla.org/apt/repo-signing-key.gpg -O /etc/apt/keyrings/packages.mozilla.org.asc -
Add Mozilla to your sources list.
nano /etc/apt/sources.list.d/mozilla.sourcesAdd the following and type CTRL-X, Shift-Y, Enter to save.
Types: deb URIs: https://packages.mozilla.org/apt Suites: mozilla Components: main Signed-By: /etc/apt/keyrings/packages.mozilla.org.ascAlso, create a sources list file for mozilla.
nano /etc/apt/sources.list.d/mozilla.listAdd the following and type CTRL-X, Shift-Y, Enter to save.
deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main -
Prioritize the Debian package version of Firefox.
nano /etc/apt/preferences.d/mozillaAdd the following and type CTRL-X, Shift-Y, Enter to save.
Package: * Pin: origin packages.mozilla.org Pin-Priority: 1000 Package: firefox* Pin: release o=Ubuntu Pin-Priority: -1 -
Prevent unattended upgrades from replacing the Deb package with the Snap.
nano /etc/apt/apt.conf.d/51unattended-upgrades-firefoxAdd the following and type CTRL-X, Shift-Y, Enter to save.
Unattended-Upgrade::Allowed-Origins:: "namespaces/moz-fx-productdelivery-pr-38b5/repositories/mozilla:mozilla"; -
Finally, install the Firefox Debian package.
apt update apt install firefox
You can specify custom gsettings. Here is an example to customize which icons appear in the Dock. In this example the Dock will show the Ubuntu Installer, Firefox, Files, Text Editor, Terminal, Calculator, and System Monitor.
-
Create a file named
90_custom-settings.gschema.overrideon your local machine.(Gschema override configuration files that start with higher numbers take precedence over files that start with lower numbers).
-
Add the following content and save the file:
[org.gnome.shell:ubuntu] favorite-apps = ['ubuntu-desktop-bootstrap_ubuntu-desktop-bootstrap.desktop', 'firefox.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.TextEditor.desktop', 'org.gnome.Ptyxis.desktop', 'org.gnome.Calculator.desktop', 'org.gnome.SystemMonitor.desktop']The
favorite-appskey belongs to theorg.gnome.shellgsettings schema. This key is used to specify which applications are shown in the Dock.Note that
ubuntu-desktop-bootstrap_ubuntu-desktop-bootstrap.desktopis the Snap based Desktop Installer. This will only appear in the Live Environment, not in your installed system (because applications that are not installed do not appear in the Dock, even if they are listed in thefavorite-appsgsettings key).Also, note that
firefox.desktopis the name of the Debian version of Firefox. -
On Cubic's Terminal page, change directory to
/usr/share/glib-2.0/schemas/.cd /usr/share/glib-2.0/schemas/ -
Drag the new file
90_custom-settings.gschema.overrideonto Cubic's Terminal. -
When the Terminal Copy page appears, click the Copy button to copy the file into the current directory.
-
Execute the following to update the gsettings:
glib-compile-schemas /usr/share/glib-2.0/schemas/
General Information
Cubic Pages