How to install Kernel 4.4 via Terminal applying Shell Scripting

Selection_007

The commands below can be written verbatim or adapted so that within a single bash shell script or another shell environment run and perform the operation automatically.

Here are the command orders for this task:

uname -r

aptitude install kernel-package -y

aptitude install build-essential -y

aptitude install libncurses5-dev -y

aptitude install fakeroot -y

cd /usr/src

wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.4.tar.xz

unxz linux-4.4.tar.xz

tar xvf linux-4.4.tar

ln -s linux-4.4 linux

cd /usr/src/linux

make clean && make mrproper

cp /boot/config-`uname -r` ./.config

make menuconfig

NOTE: WHEN EXECUTING THIS COMMAND COMMAND, THE KERNEL CONFIGURATION MENU WILL BE INITIATED, WHERE YOU CAN CONFIGURE THE MOST CONVENIENT PARAMETERS FOR YOUR EQUIPMENT. THE 64 BIT OPTION MUST BE CHECKED IF YOU WANT TO CREATE A KERNEL FOR SUCH ARCHITECTURE OR NOT. PRESS THE SAVE BUTTON TO SAVE THE CONFIGURATION, THEN THE EXIT BUTTON AND CONTINUE WITH THE COMPILATION AND INSTALLATION PROCESS.

make-kpkg clean

fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers

cd /usr/src

rm -f linux-4.4.tar.xz

dpkg -i *.deb

uname -r

reboot

uname -r

Visual Tutorial

upgrade-kernel4.4-step01

upgrade-kernel4.4-step02

upgrade-kernel4.4-step03

upgrade-kernel4.4-step04

upgrade-kernel4.4-step05

upgrade-kernel4.4-step06

upgrade-kernel4.4-step07

upgrade-kernel4.4-step08

upgrade-kernel4.4-step09

upgrade-kernel4.4-step10

upgrade-kernel4.4-step01

upgrade-kernel4.4-step11

upgrade-kernel4.4-step12

upgrade-kernel4.4-step13

upgrade-kernel4.4-step14

upgrade-kernel4.4-step15

upgrade-kernel4.4-step16

upgrade-kernel4.4-step17

upgrade-kernel4.4-step18

upgrade-kernel4.4-step19

upgrade-kernel4.4-step20

upgrade-kernel4.4-step21

upgrade-kernel4.4-step22

upgrade-kernel4.4-step23

upgrade-kernel4.4-step24

upgrade-kernel4.4-step25

upgrade-kernel4.4-step26

It is important to learn more in a self-taught way about how to use variables to store environment values ​​and thus make a more stylized and efficient code, within the scripts of bash-shell has create. For example:

kernel=`uname -r`

cp /boot/config-$kernel ./.config

read NUM_VER

NV=${NUM_VER}

echo "linux-$NV.tar.xz"

unxz linux-$NV.tar.xz

This is enough to do by hand, or automate the process in a Bash Shell Script.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Chaparral said

    I'd better leave it to the experts, or when it comes via updates. Touching the kernel is a delicate process and if the system works well for you, why touch it? Also, I think it will be very difficult to leave everything the same afterwards, as there are always bugs. In Manjaro it is very easy to add a new kernel. It is enough to throw this command in a terminal: »sudo mhwd-kernel -i linux (Here write the corresponding one)».
    This is the one I use right now and it goes to the movies: »uname -a
    Linux PackardBell 4.1.15-1-MANJARO # 1 SMP PREEMPT Tue Dec 15 07:48:44 UTC 2015 x86_64 GNU / Linux ».
    But hey, that's what I think: Doctors have the Church.

  2.   Jose Albert said

    You are absolutely right, when I have tried to install any kernel already compiled, something always fails me or the Operating System totally. But this way it has never failed me and everything works. Since I compile my own kernel on my own computer with all the default options!

    1.    brutal said

      But if you compile the kernel so that you activate things that you will never use? I always compile the kernel only for my hardware and peripherals and everything else I deactivate since they eat up resources and space.

      A note to run make -j9 if you use an octacore and not because if you use make you only compile with a kernel.

      1.    brutal said

        Sorry for the bad writing, the web theme does not adapt to my plasma 5 colors and I hardly see what I write o_O

  3.   Federico said

    Good day! Very good contribution. I just got an old asus 1201n atom 330 nvidia ion back. In the last week I have been testing all kinds of distributions, and the one that gives me the best performance is Debian 8.2 with proprietary drivers and with the MATE desktop environment. Trying to obtain more autonomy, since with windows it was not more than 1h 20 min, and with debian it achieved 2 hours, I found the tlp software to better manage the battery and increase the useful life, I also installed the wm i3 to consume less resources. Now I am using this configuration, I thought that installing archlinux would obtain even better performance, since it is the distribution that I use by default on my desktop machine, but to my disappointment it gives me many lags with the same configuration. Now I need two tips, I took out the traditional mechanical hdd disk and I put a 300 gb kingston v240, I added 2gb of ram, now it has 4gb of ram. Do I need to configure something in debian to work fine with SSDs? And the other question is what reference can I use to configure the kernel and compile it exactly with the characteristics of my atom 330 64bit processor?

  4.   Federico said

    ps: correct, now I have an autonomy of 2hs 20 min

  5.   Federico said

    PD2: I know that it is not the subject of this post, but what tips could you recommend me to improve the autonomy of the netbook, I use chrome or firefox, and I want to reduce the consumption of resources by the browsers, and the rest of the team, already disable bluethooth and lan.

  6.   Elvis fonts said

    he paso
    unxz linux-4.4.tar.xz tar xvf linux-4.4.tar can be simplified with tar Jxvf linux-4.4.tar that way the whole kernel source is unpacked at once.

    make clean you will do it only if you have made a kernel preconfiguration and you want it to be redundant to clean all the source of said configuration. make mrproper is used to remove the current kernel configuration you have running with its module configuration. in both cases it is only used if you have already made a preferred configuration of said source.

    If, as I see, you only download the kernel and decompress it, this step is not necessary.

    The motivations that you may have to recompile the kernel are to be seen in the need to load or not modules available in the kernel. Gentoo users have tools like genkernel that do a more or less automatic configuration of the configuration loaded at the time of hardware detection. But this can be generated in the same way with make defconfig and then load and modify the resulting .config in the same directory of the kernel.

  7.   Jose Albert said

    Excellent explanatory and explanatory comment of everything contained here in a summarized way!

  8.   Jose Albert said

    For those who are following the Online Course of "Learn Shell Scripting" soon stay tuned because soon I will start with more advanced codes but exposed so that they are visually understandable despite its complexity.

    Example:

    LPI-SB8 Test ScreenCast (LINUX POST INSTALL - SCRIPT BICENTENARIO 8.0.0)
    (lpi_sb8_adaptation-audiovisual_2016.sh / 43Kb)

    See Screencast: https://www.youtube.com/watch?v=cWpVQcbgCyY