LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Xubuntu - Kernel update via bash - My suggestion. Your opinion? (https://www.linuxquestions.org/questions/ubuntu-63/xubuntu-kernel-update-via-bash-my-suggestion-your-opinion-4175660312/)

madmax25 09-04-2019 08:33 AM

Xubuntu - Kernel update via bash - My suggestion. Your opinion?
 
I already posted this in the Bodhi section, but I thought, perhaps, it might be interesting for Ubuntu/Xubuntu users, too.

Because I consider it quite annoying to type in the name of each of the 5 kernel packages, when installing (or removing) a new kernel, I created a bash script to make it easier.
What do you think about it?

Code:

Install kernel:
*****************

read -p "Please enter kernel number: `echo '\n> '`" a
sleep 1
echo

sudo apt install linux-headers-"${a}" linux-headers-"${a}"-generic linux-image-"${a}"-generic linux-modules-"${a}"-generic linux-modules-extra-"${a}"-generic
sleep 2
echo

read -p "Please close with the Enter-key ... " Enter

and here the script for removing the kernel:

Code:

Remove kernel:
****************

read -p "Please enter kernel number: `echo '\n> '`" a
sleep 1
echo

sudo apt purge linux-headers-"${a}" linux-headers-"${a}"-generic linux-image-"${a}"-generic linux-modules-"${a}"-generic linux-modules-extra-"${a}"-generic
sleep 2
echo

read -p "Please close with the Enter-key ... " Enter

I did this, because ukuu failed to install a kernel lately.

Skaperen 09-04-2019 04:20 PM

you should make scripts that can also take the info if given on the command line arguments. it should ask if that info is not given.

your bash scripts should include the "#!/bin/bash" line at the top so it is easy to just move into a personal "~/bin" directory.


All times are GMT -5. The time now is 07:42 AM.