LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 09-04-2019, 07:33 AM   #1
madmax25
Member
 
Registered: Aug 2018
Posts: 348

Rep: Reputation: Disabled
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.

Last edited by madmax25; 09-04-2019 at 07:36 AM.
 
Old 09-04-2019, 03:20 PM   #2
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bodhi - Kernel update via bash - My suggestion. Your opinion? madmax25 Bodhi 5 09-23-2019 06:25 PM
[SOLVED] (initial) software update error in Xubuntu 16.04 - applies to all methods to update barnac1e Linux - Newbie 2 10-03-2017 03:32 PM
[SOLVED] [Suggestion] Linux Kernel 3.18 it's Longterm now, suggestion for Slackware Current sardinha Slackware 27 04-03-2015 05:17 PM
My wireless networking is disabled after Upgrade from Xubuntu 11.10 to Xubuntu 12.04 vutar Linux - Laptop and Netbook 8 10-22-2012 02:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration