Bii o ṣe le Fi sii tabi Igbesoke si Kernel 5.0 ni CentOS 7


Botilẹjẹpe diẹ ninu eniyan lo ọrọ Lainos lati ṣe aṣoju ẹrọ iṣiṣẹ lapapọ, o ṣe pataki lati ṣe akiyesi pe, ni sisọ muna, Lainos nikan ni ekuro. Ni apa keji, pinpin kan jẹ eto iṣẹ-ṣiṣe ni kikun ti a ṣe lori oke ekuro pẹlu ọpọlọpọ awọn irinṣẹ ohun elo ati awọn ile ikawe.

Lakoko awọn iṣẹ ṣiṣe deede, ekuro jẹ ẹri fun ṣiṣe awọn iṣẹ pataki meji:

    Ṣiṣẹ bi wiwo laarin hardware ati sọfitiwia ti n ṣiṣẹ lori ẹrọ naa.
  1. Ṣiṣakoso awọn orisun eto daradara bi o ti ṣee.

Lati ṣe eyi, ekuro ṣe ibaraẹnisọrọ pẹlu ohun elo nipasẹ awọn awakọ ti a kọ sinu rẹ tabi awọn ti o le fi sii nigbamii bi module.

Fun apẹẹrẹ, nigbati ohun elo ti n ṣiṣẹ lori ẹrọ rẹ ba fẹ sopọ si nẹtiwọọki alailowaya, o fi ibere naa silẹ si ekuro, eyiti o wa ni lilo awakọ ti o tọ lati sopọ si nẹtiwọọki naa.

Pẹlu awọn ẹrọ tuntun ati imọ-ẹrọ ti n jade lorekore, o ṣe pataki lati tọju ekuro wa titi di oni ti a ba fẹ ṣe pupọ julọ ninu wọn. Ni afikun, mimu ekuro wa ṣe yoo ṣe iranlọwọ fun wa lati lo awọn iṣẹ ekuro tuntun ati lati daabobo ara wa kuro awọn ailagbara ti a ti ṣawari ni awọn ẹya ti tẹlẹ.

Ṣetan lati ṣe imudojuiwọn ekuro rẹ lori CentOS 7 tabi ọkan ninu awọn itọsẹ wọn bii RHEL 7 ati Fedora? Ti o ba jẹ bẹ, pa kika!

Igbesẹ 1: Ṣiṣayẹwo Ẹya Ekuro Ti Fi sori ẹrọ

Nigba ti a ba fi sori ẹrọ pinpin o ni ẹya kan ti ekuro Linux. Lati fihan ẹya ti isiyi ti a fi sori ẹrọ lori ẹrọ wa a le ṣe:

# uname -sr

Aworan ti o tẹle n fihan iṣuṣẹ ti aṣẹ loke ni olupin CentOS 7 kan:

Ti a ba lọ si https://www.kernel.org/, a yoo rii pe ẹya ekuro tuntun jẹ 5.0 ni akoko kikọ yi (awọn ẹya miiran wa lati aaye kanna).

Ẹya Kernel 5.0 tuntun yii jẹ igbasilẹ igba pipẹ ati pe yoo ni atilẹyin fun ọdun mẹfa, ni iṣaaju gbogbo awọn ẹya Kernel Linux ni a ṣe atilẹyin fun ọdun meji nikan.

Ohun pataki kan lati gbero ni iyika igbesi aye ti ẹya ekuro - ti ẹya ti o nlo lọwọlọwọ ti sunmọ opin aye rẹ, ko si awọn atunṣe kokoro diẹ sii ti yoo pese lẹhin ọjọ naa. Fun alaye diẹ sii, tọka si iwe Awọn iwejade ekuro.

Igbesẹ 2: Igbesoke Igbega ni CentOS 7

Pupọ awọn kaakiri ode oni pese ọna lati ṣe igbesoke ekuro nipa lilo eto iṣakoso package bi yum ati ibi ipamọ ti o ni atilẹyin ifowosi.

Pataki: Ti o ba n wa lati ṣiṣe Kernel ti a ṣe akojọpọ aṣa, lẹhinna o yẹ ki o ka nkan wa ti o ṣalaye Bii o ṣe le ṣajọ Kernel Linux lori CentOS 7 lati awọn orisun.

Sibẹsibẹ, eyi yoo ṣe igbesoke nikan si ẹya ti o ṣẹṣẹ julọ ti o wa lati awọn ibi ipamọ pinpin - kii ṣe tuntun ti o wa ni https://www.kernel.org/. Laanu, Red Hat nikan gba laaye lati ṣe igbesoke ekuro nipa lilo aṣayan iṣaaju.

Ni ilodisi Red Hat, CentOS gba laaye lilo ELRepo, ibi-ipamọ ẹni-kẹta kan ti o ṣe igbesoke si ẹya to ṣẹṣẹ jẹ ekuro kan.

Lati jẹki ibi ipamọ ELRepo lori CentOS 7, ṣe:

# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm 

Lọgan ti ibi ipamọ ti ṣiṣẹ, o le lo aṣẹ atẹle lati ṣe atokọ awọn idii ekuro ti o wa:

# yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * elrepo-kernel: mirror-hk.koddos.net
Available Packages
kernel-lt.x86_64                        4.4.176-1.el7.elrepo        elrepo-kernel
kernel-lt-devel.x86_64                  4.4.176-1.el7.elrepo        elrepo-kernel
kernel-lt-doc.noarch                    4.4.176-1.el7.elrepo        elrepo-kernel
kernel-lt-headers.x86_64                4.4.176-1.el7.elrepo        elrepo-kernel
kernel-lt-tools.x86_64                  4.4.176-1.el7.elrepo        elrepo-kernel
kernel-lt-tools-libs.x86_64             4.4.176-1.el7.elrepo        elrepo-kernel
kernel-lt-tools-libs-devel.x86_64       4.4.176-1.el7.elrepo        elrepo-kernel
kernel-ml.x86_64                        5.0.0-1.el7.elrepo          elrepo-kernel
kernel-ml-devel.x86_64                  5.0.0-1.el7.elrepo          elrepo-kernel
kernel-ml-doc.noarch                    5.0.0-1.el7.elrepo          elrepo-kernel
kernel-ml-headers.x86_64                5.0.0-1.el7.elrepo          elrepo-kernel
kernel-ml-tools.x86_64                  5.0.0-1.el7.elrepo          elrepo-kernel
kernel-ml-tools-libs.x86_64             5.0.0-1.el7.elrepo          elrepo-kernel
kernel-ml-tools-libs-devel.x86_64       5.0.0-1.el7.elrepo          elrepo-kernel
perf.x86_64                             5.0.0-1.el7.elrepo          elrepo-kernel
python-perf.x86_64                      5.0.0-1.el7.elrepo          elrepo-kernel

Nigbamii, fi ekuro idurosinsin akọkọ akọkọ sori ẹrọ:

# yum --enablerepo=elrepo-kernel install kernel-ml
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.mirror.net.in
 * elrepo: mirror-hk.koddos.net
 * elrepo-kernel: mirror-hk.koddos.net
 * epel: repos.del.extreme-ix.org
 * extras: centos.mirror.net.in
 * updates: centos.mirror.net.in
Resolving Dependencies
--> Running transaction check
---> Package kernel-ml.x86_64 0:5.0.0-1.el7.elrepo will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================
 Package                Arch        Version                 Repository        Size
====================================================================================
Installing:
 kernel-ml              x86_64      5.0.0-1.el7.elrepo      elrepo-kernel     47 M

Transaction Summary
====================================================================================
Install  1 Package

Total download size: 47 M
Installed size: 215 M
Is this ok [y/d/N]: y
Downloading packages:
kernel-ml-5.0.0-1.el7.elrepo.x86_64.rpm                           |  47 MB  00:01:21     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : kernel-ml-5.0.0-1.el7.elrepo.x86_64                1/1 
  Verifying  : kernel-ml-5.0.0-1.el7.elrepo.x86_64                1/1 

Installed:
  kernel-ml.x86_64 0:5.0.0-1.el7.elrepo                                                                                                                                                                            

Complete!

Lakotan, atunbere ẹrọ rẹ lati lo ekuro tuntun, ati lẹhinna yan ekuro tuntun lati inu akojọ aṣayan bi o ti han.

Wọle bi gbongbo, ati ṣiṣe atẹle atẹle lati ṣayẹwo ẹya ekuro:

# uname -sr

Igbesẹ 3: Ṣeto Ẹya Ekuro aiyipada ni GRUB

Lati ṣe ẹya tuntun ti a fi sori ẹrọ ni aṣayan bata aiyipada, iwọ yoo ni lati yipada iṣeto GRUB gẹgẹbi atẹle:

Ṣii ki o ṣatunkọ faili/abbl/aiyipada/grub ki o ṣeto GRUB_DEFAULT = 0 . Eyi tumọ si pe ekuro akọkọ ninu iboju akọkọ GRUB yoo ṣee lo bi aiyipada.

GRUB_TIMEOUT=5
GRUB_DEFAULT=0
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap crashkernel=auto rhgb quiet"
GRUB_DISABLE_RECOVERY="true"

Nigbamii, ṣiṣe aṣẹ atẹle lati ṣe atunto iṣeto ekuro.

# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.0.0-1.el7.elrepo.x86_64
Found initrd image: /boot/initramfs-5.0.0-1.el7.elrepo.x86_64.img
Found linux image: /boot/vmlinuz-4.20.0-1.el7.elrepo.x86_64
Found initrd image: /boot/initramfs-4.20.0-1.el7.elrepo.x86_64.img
Found linux image: /boot/vmlinuz-4.19.11-1.el7.elrepo.x86_64
Found initrd image: /boot/initramfs-4.19.11-1.el7.elrepo.x86_64.img
Found linux image: /boot/vmlinuz-4.19.0-1.el7.elrepo.x86_64
Found initrd image: /boot/initramfs-4.19.0-1.el7.elrepo.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-957.1.3.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-957.1.3.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-693.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-693.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-1e2b46dbc0c04b05b592c837c366bb76
Found initrd image: /boot/initramfs-0-rescue-1e2b46dbc0c04b05b592c837c366bb76.img
done

Atunbere ki o rii daju pe ekuro tuntun ti lo ni aiyipada.

Oriire! O ti ṣe igbesoke ekuro rẹ ni CentOS 7!

Ninu nkan yii a ti ṣalaye bi o ṣe le ṣe igbesoke ekuro Linux lori ẹrọ rẹ. Ọna miiran wa ti a ko ti bo bii o ṣe ṣajọ ekuro lati orisun, eyiti yoo yẹ fun odidi iwe kan ati pe a ko ṣe iṣeduro lori awọn ọna ṣiṣe.

Botilẹjẹpe o duro fun ọkan ninu awọn iriri ẹkọ ti o dara julọ ati gba laaye fun iṣeto didara-ekuro ti ekuro, o le fun eto rẹ lailewu ati pe o le ni lati tun fi sii lati ibere.

Ti o ba tun nife ninu kiko ekuro bi iriri ẹkọ, iwọ yoo wa awọn itọnisọna lori bii o ṣe le ni oju-iwe Kernel Newbies.

Gẹgẹbi igbagbogbo, ni ominira lati lo fọọmu ti o wa ni isalẹ ti o ba ni ibeere tabi awọn asọye nipa nkan yii.