Otu esi agbanyụọ mmelite ngwugwu site na iji YUM/DNF na RHEL Linux


Nkesa Linux na-acha uhie uhie, nke a na-eji maka ịnweta, wụnye, kwalite, wepụ, na ịjụ ajụjụ site na ebe nchekwa ngwanrọ gọọmentị na ebe nchekwa ndị ọzọ.

Mgbe ị na-emelite usoro ahụ, mgbe ụfọdụ, anyị anaghị emelite ụfọdụ ngwugwu dị ka Apache Server (HTTP), MySQL, PHP, ma ọ bụ ngwa ọ bụla ọzọ dị mkpa, n'ihi na imelite ngwanro dị otú ahụ nwere ike imebi ngwa weebụ na-agba ọsọ ugbu a na ihe nkesa na-akpata isi okwu. A na-atụ aro ka ịkwụsị mmelite maka sọftụwia dị otú ahụ ruo mgbe ejiri mmelite ọhụrụ mechie ngwa ahụ.

N'isiokwu a, anyị ga-egosi gị otu anyị nwere ike isi wepụ (gbanyụọ) mmelite ngwugwu site na iji YUM na onye njikwa ngwugwu DNF na nkesa RPM dị ka RHEL, CentOS, Fedora, Rocky Linux, na AlmaLinux. Anyị nwekwara ike wepu ma ọ bụ gbanyụọ ụfọdụ mmelite ngwugwu na ebe nchekwa ndị ọzọ ọ bụla.

Awepu syntax ga-adị ka ndị a.

exclude=package package1 packages*

A kọwapụtara ntuziaka ewepu n'elu na /etc/yum.conf ma ọ bụ /etc/dnf/dnf.conf nhazi faịlụ yana ndepụta ngwugwu ka ewepu na mmelite ma ọ bụ nrụnye.

Syntax a dị n'elu ga-ewepu ngwugwu, package1, yana ndepụta mmelite ma ọ bụ nrụnye ngwugwu. Ekwesịrị ikewapụ mkpụrụokwu ọ bụla na oghere maka mwepu ngwugwu.

Otu esi ewepu ngwugwu na YUM ma ọ bụ DNF

Iji wepu (gbanyụọ) mmelite ngwungwu, Mepee faịlụ a na-akpọ /etc/yum.conf ma ọ bụ /etc/dnf/dnf.conf na nhọrọ nchịkọta akụkọ gị.

# vi /etc/yum.conf
OR
# vi /etc/dnf/dnf.conf

Tinye ahịrị na-esonụ na ala nke faịlụ na ewepu isiokwu dị ka egosiri n'okpuru.

[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release

# This is the default, if you make this bigger yum won't see if the metadata 
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
#  It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

## Exclude following Packages Updates ##
exclude=httpd php mysql

N'ihe atụ dị n'elu, ewepu ahịrị ahụ ga-ewepụ mmelite maka ngwugwu httpd php na mysql. Ka anyị gbalịa ịwụnye ma ọ bụ na-emelite otu n'ime ha site na iji iwu YUM dị ka egosiri n'okpuru.

# yum update httpd
OR
# dnf update httpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.01link.hk
 * extras: centos.01link.hk
 * updates: mirrors.hns.net.in
base                                                   | 3.7 kB     00:00
extras                                                 | 3.0 kB     00:00
updates                                                | 3.5 kB     00:00
updates/primary_db                                     | 2.7 MB     00:16
Setting up Update Process
No Packages marked for Update

Otu esi ewepu ngwugwu na EPEL Repo

Iji wepu ngwungwu nrụnye ma ọ bụ mmelite na ebe nchekwa EPEL, mepee faịlụ a na-akpọ /etc/yum.repos.d/epel.repo.

# vi /etc/yum.repos.d/epel.repo

Tinye ahịrị mwepu site na ịkọwa ngwungwu a ga-ewepu na mmelite.

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
## Exclude following Packages Updates ##
exclude=perl php python

Ugbu a gbalịa imelite faịlụ ndị akọwapụtara n'elu site na ebe nchekwa EPEL site na iji iwu yum/dnf dị ka egosiri.

# dnf update perl php python
OR
# yum update perl php python
Last metadata expiration check: 0:00:37 ago on Wednesday 17 November 2021 03:41:28 AM EST.
Package perl available, but not installed.
No match for argument: perl
No match for argument: php
No match for argument: python
Error: No packages marked for upgrade.

Ị nwekwara ike iji yum/dnf iwu-ahịrị nhọrọ wepụ ngwugwu na-agbakwunyeghị ha na faịlụ nchekwa.

# yum --exclude=httpd update
Or
# dnf --exclude=httpd update

Iji wepu ndepụta ngwugwu, jiri iwu dị ka ndị a.

# yum --exclude=mysql\* --exclude=httpd\* update
Or
# dnf --exclude=mysql\* --exclude=httpd\* update

Otu a ị nwere ike wepu mmelite maka ngwugwu ọ bụla ịchọrọ. Enwere ọtụtụ ụzọ ndị ọzọ ị nwere ike isi mee ya, dịka ọmụmaatụ, n'oge na-adịbeghị anya, anyị achịkọtara akụkọ na ụzọ 4 bara uru iji gbochie/gbanyụọ ma ọ bụ kpochie ụfọdụ ngwugwu site na iji yum iwu na Linux.