diff --git a/install.sh b/install.sh
index d0370731a8359c7dc7515f6894c4149f5cc158eb..353ace08fe43688fbc056cc1edded49f1642c138 100644
--- a/install.sh
+++ b/install.sh
@@ -49,6 +49,7 @@ $protonvpn_key "$protonvpn_label" $protonvpn_enabled \
 $flatseal_key "$flatseal_label" $flatseal_enabled \
 $wireguard_key "$wireguard_label" $wireguard_enabled \
 $remmina_key "$remmina_label" $remmina_enabled \
+$mainline_key "$mainline_label" $mainline_enabled \
 $swap_key "$swap_label" $swap_enabled \
 3>&1 1>&2 2>&3)
 IFS=' ' read -a selected_options <<< $selected_tags
@@ -187,6 +188,9 @@ do
     elif [ $option = $remmina_key ]
     then
         install_remmina
+    elif [ $option = $mainline_key ]
+    then
+        install_mainline_kernel
     elif [ $option = $swap_key ]
     then
         setup_swap
diff --git a/install_functions.sh b/install_functions.sh
index b973bbf325eb854113605d32471ae6a6a5540a87..99e1f108a5db6915270ed4323ff091e005d2c5f0 100644
--- a/install_functions.sh
+++ b/install_functions.sh
@@ -35,6 +35,14 @@ update_upgrade() {
     else
         echo "flatpak does not exist; skipping update"
     fi
+
+    if command_exists mainline
+    then
+        sudo mainline install-minor || true
+        echo "kernel was updated to latest minor version, upgrading to a major version must be done manually"
+    else
+        echo "mainline does not exist; skipping update"
+    fi
 }
 
 flatpak_add_repo() {
@@ -214,11 +222,12 @@ install_dl_driver() {
     install_curl
     display_link_keyring="$downloads_path/synaptics-repository-keyring.deb"
     curl https://www.synaptics.com/sites/default/files/Ubuntu/pool/stable/main/all/synaptics-repository-keyring.deb -o $display_link_keyring
-    sudo apt install -y $display_link_keyring
+    $apt_install_cmd $display_link_keyring
     sudo rm $display_link_keyring
-
     sudo apt update
-    sudo apt install -y displaylink-driver
+
+    $apt_install_cmd gcc-14 # newer kernels require gcc 14
+    $apt_install_cmd displaylink-driver
 }
 
 install_obsidian() {
@@ -365,3 +374,15 @@ install_wireguard() {
 install_remmina() {
     install_flatpak_app org.remmina.Remmina
 }
+
+install_mainline_kernel() {
+    sudo add-apt-repository ppa:cappelikan/ppa
+    $apt_update_cmd
+    $apt_install_cmd mainline
+
+    mainline list
+    echo "if displaylink driver is installed, make sure that displaylink evdi supports the kernel: https://github.com/DisplayLink/evdi/releases"
+    read -p "Kernel version (e.g. 6.11.10): " mainline_kernel_version
+
+    sudo mainline install $mainline_kernel_version || true
+}
diff --git a/options.sh b/options.sh
index 52ca3effdad0756030439a2d2f900c94fced0ac8..09e22d30199712d92d1873cf4786b5c28950fe56 100644
--- a/options.sh
+++ b/options.sh
@@ -46,6 +46,7 @@ protonvpn_enabled=$checkbox_unchecked
 flatseal_enabled=$checkbox_unchecked
 wireguard_enabled=$checkbox_unchecked
 remmina_enabled=$checkbox_unchecked
+mainline_enabled=$checkbox_unchecked
 swap_enabled=$checkbox_unchecked
 
 # labels
@@ -92,6 +93,7 @@ protonvpn_key="proton_vpn"
 flatseal_key="flatseal"
 wireguard_key="wireguard"
 remmina_key="remmina"
+mainline_key="mainline"
 swap_key="swap"
 
 # show text
@@ -138,4 +140,5 @@ protonvpn_label="proton-vpn"
 flatseal_label="flatseal"
 wireguard_label="wireguard"
 remmina_label="remmina"
+mainline_label="mainline kernel"
 swap_label="swap"