kubuntu skripts

This commit is contained in:
Robert Köpferl 2021-02-27 22:41:24 +01:00
parent 7615dcb136
commit 2ec149040a
2 changed files with 346 additions and 0 deletions

114
kubuntu/computertruhe.seed Normal file
View File

@ -0,0 +1,114 @@
# My preseed file for Kubuntu 20.0 LTS
d-i debian-installer/locale string de_DE
d-i localechooser/supported-locales multiselect de_DE.UTF-8, en_GB.UTF-8, ar_SY.UTF-8, fa_IR.UTF-8, uz_Arab_AF.UTF-8
d-i keyboard-configuration/xkb-keymap select de
d-i keyboard-configuration/layoutcode string de
# Optionally specify additional locales to be generated.
d-i debian-installer/splash boolean false
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string de
d-i console-setup/variantcode string
### Partitioning
# If the system has free space you can choose to only partition that space.
# This is only honoured if partman-auto/method (below) is not set.
#d-i partman-auto/init_automatically_partition select biggest_free
# Alternatively, you may specify a disk to partition. If the system has only
# one disk the installer will default to using that, but otherwise the device
# name must be given in traditional, non-devfs format (so e.g. /dev/sda
# and not e.g. /dev/discs/disc0/disc).
# For example, to use the first SCSI/SATA hard disk:
#d-i partman-auto/disk string /dev/sda
# In addition, you'll need to specify the method to use.
# The presently available methods are:
# - regular: use the usual partition types for your architecture
# - lvm: use LVM to partition the disk
# - crypto: use LVM within an encrypted partition
#d-i partman-auto/method string regular
# You can choose one of the three predefined partitioning recipes:
# - atomic: all files in one partition
# - home: separate /home partition
# - multi: separate /home, /var, and /tmp partitions
#d-i partman-auto/choose_recipe select atomic
#d-i partman/default_filesystem string ext3
#d-i partman/choose_partition select finish
# If one of the disks that are going to be automatically partitioned
# contains an old LVM configuration, the user will normally receive a
# warning. This can be preseeded away...
#d-i partman-lvm/device_remove_lvm boolean true
# The same applies to pre-existing software RAID array:
#d-i partman-md/device_remove_md boolean true
# And the same goes for the confirmation to write the lvm partitions.
#d-i partman-lvm/confirm boolean true
#d-i partman-lvm/confirm_nooverwrite boolean true
# Just in case, the positive answer to all other imagineable conformation questions:
#d-i partman-partitioning/confirm_write_new_label boolean true
#d-i partman/confirm boolean true
#d-i partman/confirm_nooverwrite boolean true
#d-i partman/confirm_write_new_label boolean true
#d-i partman-md/confirm boolean true
# Time
d-i time/zone string Europe/Berlin
d-i clock-setup/utc boolean true
d-i clock-setup/ntp boolean true
d-i clock-setup/ntp-server string ntp.ubuntu.com
### Mirror settings
# If you select ftp, the mirror/country string does not need to be set.
#d-i mirror/protocol string ftp
#d-i mirror/country string manual
#d-i mirror/http/hostname string http.us.debian.org
#d-i mirror/http/directory string /debian
d-i mirror/http/proxy string http://apt-proxy:3142
# LinuxMint will *demand* a user during installation, ignoring the value
# of the passwd/make-user flag, so we need to provide the user data here.
# You should not preseed the password in clear text, this is just an example!
d-i passwd/user-fullname string OEM
d-i passwd/username string oem
d-i passwd/user-password-crypted password $6$8Wk7hOnUGc1ffBRY$nefXDPeChvZGK3B/bA4Hzv91sOU8IqmXE4IJATV.BRFtaWJtBQqJKtBQO.e092nf4Jg1.4L2TH5TaLtFy02x1.
d-i passwd/user-password-again password $6$8Wk7hOnUGc1ffBRY$nefXDPeChvZGK3B/bA4Hzv91sOU8IqmXE4IJATV.BRFtaWJtBQqJKtBQO.e092nf4Jg1.4L2TH5TaLtFy02x1.
d-i passwd/root-login boolean false
d-i user-setup/encrypt-home boolean false
d-i user-setup/allow-password-weak boolean true
# Use non-free packages
ubiquity ubiquity/use_nonfree boolean true
#### Advanced options
### Running custom commands during the installation
# d-i preseeding is inherently not secure. Nothing in the installer checks
# for attempts at buffer overflows or other exploits of the values of a
# preconfiguration file like this one. Only use preconfiguration files from
# trusted locations! To drive that home, and because it's generally useful,
# here's a way to run any shell command you'd like inside the installer,
# automatically.
# This first command is run as early as possible, just after
# preseeding is read.
#d-i preseed/early_command string anna-install some-udeb
# This command is run immediately before the partitioner starts. It may be
# useful to apply dynamic partitioner preseeding that depends on the state
# of the disks (which may not be visible when preseed/early_command runs).
#d-i partman/early_command \
# string debconf-set partman-auto/disk "$(list-devices disk | head -n1)"
# This command is run just before the install finishes, but when there is
# still a usable /target directory. You can chroot to /target and use it
# directly, or use the apt-install and in-target commands to easily install
# packages and run commands in the target system.
#d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh
# Script am Ende
d-i preseed/late_command string wget -O - http://netboot/kubuntu_late_command.sh | bash
# on target:
#d-i preseed/late_command string chroot /target bash /cdrom/setup/install/settings.sh

View File

@ -0,0 +1,232 @@
#!/usr/bin/env bash
# execute self with sudo if user is not root
[[ $UID -ne 0 ]] && exec sudo ./"$0"
###
# Set variables
###
export DEBIAN_FRONTEND=noninteractive
DPKG_CFG_FRAGMENT=/etc/dpkg/dpkg.cfg.d/non-interactive
# Linux distro
script_distro='Linux Mint 20'
# Additional packages
packages=(
# Graphics
gimp
inkscape
pinta
krita
# Office
libreoffice
# Security
keepassxc
# Games
0ad
beneath-a-steel-sky
billard-gl
blobby
blockout2
flight-of-the-amazon-queen
freeciv
frozen-bubble
gbrainy
gnome-games
gweled
hedgewars
lincity-ng
lure-of-the-temptress
minetest
openttd
pingus
pipewalker
pokerth
supertux
supertuxkart
teeworlds
wesnoth
widelands
# Gaming platforms
playonlinux
steam
wine-stable
winetricks
# System management
gparted
# Tools
f3
hardinfo
regionset
vim
# Media
cheese
vlc
# Knowledge (incl. programs from the former ubunbu-edu-* meta packages)
blinken
calibre
cantor
chemtool
dia
einstein
fritzing
gamine
gcompris
goldendict
inkscape
kalgebra
kalzium
kanagram
kbruch
kgeography
khangman
kig
klettres
kmplot
kstars
ktouch
ktuberling
kturtle
kwordquiz
laby
lightspeed
lybniz
marble
melting
parley
pencil2d
ri-li
rocs
step
tuxmath
tuxpaint
tuxtype
yorick
# Language support
language-selector-common
openoffice.org-hyphenation
language-pack-ar
language-pack-gnome-ar
language-pack-fa
language-pack-gnome-fa
)
###
# Functions
###
# $*: message to echo
e() {
printf "\e[31m>>>\e[0m %s\n" "$*"
}
# It's a pain to stop (ctrl+c, kill) execution with all the Python applications
# so we catch SIGINT and SIGTERM and exit immediately
handle_signal() {
e "Ausführung abgebrochen! Skript wird beendet."
exit 1
}
# always executed on shell exit regardless of reason. for cleanup tasks
handle_exit() {
e "Finales Cleanup wird durchgeführt …"
rm -f "$DPKG_CFG_FRAGMENT"
}
trap handle_signal SIGINT SIGTERM
trap handle_exit EXIT
pkg() {
apt install "$@" --yes --quiet
}
###
# Greeting
###
echo "\
#####################################
# Computertruhe-Installationsskript #
#####################################
###
# Maintainer: Computertruhe e. V.
# Website: https://computertruhe.de/
# Version: 1.0.0
# Repo: https://codeberg.org/Computertruhe/computertruhe-setup
# Distro: ${script_distro}
###
"
e "Starte initiales Setup für Rechner mit frisch installiertem '${script_distro}' …"
###
# Automatic installation
###
# place temporary dpkg configurations to ensure non-interactive upgrade
cat <<'DPKG' >"$DPKG_CFG_FRAGMENT"
force-confold
force-confdef
DPKG
e "Besten Spiegelserver für '${script_distro}' auswählen …"
mint-switch-to-local-mirror
e "Paketquellen aktualisieren …"
apt update --yes --quiet
e "System aktualisieren (apt) …"
apt full-upgrade --yes --quiet
e "Proprietäre Treiber installieren (sofern verfügbar) …"
ubuntu-drivers autoinstall
e "Zusätzliche Software installieren …"
pkg "${packages[@]}"
e "Sprachunterstützung vervollständigen …"
pkg $(check-language-support)
pkg fonts-arabeyes
# these packages have to be installed after "$(check-language-support)"
pkg hunspell-de-at hunspell-de-ch hunspell-de-de
e "Unnötige Pakete entfernen und Cache bereinigen …"
apt clean --yes --quiet
apt autoremove --yes --quiet
# https://askubuntu.com/questions/1037553/how-to-configure-a-dconf-key-globally-across-all-user-accounts#1037557
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/desktop_migration_and_administration_guide/custom-default-values-system-settings
e "Tastatur- und Desktop-Optionen anpassen …"
mkdir -vp /etc/dconf/{profile,db/local.d}
cat <<'EOF' > /etc/dconf/profile/user
user-db:user
system-db:local
EOF
cat <<'EOF' > /etc/dconf/db/local.d/00-keyboard-layout
[org/gnome/libgnomekbd/keyboard]
layouts=['de', 'ara', 'ir']
[org/cinnamon/desktop/interface]
keyboard-layout-show-flags=false
keyboard-layout-use-upper=true
keyboard-layout-prefer-variant-names=true
EOF
dconf update
###
# Finalisation
###
e "Initiales Setup beendet."
oem-config-prepare