Introducción
En esta guía tutorial, aprenderá cómo actualizar su servidor Linux de CentOS 7 a CentOS 8.
Solo sigue estos pasos:
Instalar el Repositorio EPEL
Necesitas instalar el EPL repositorio con el siguiente comando:
[root@unixcop ~]# yum install epel-release -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.mirror.ndchost.com
* epel: mirror.prgmr.com
* extras: mirrors.raystedman.org
* updates: mirror.sjc02.svwh.net
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be updated
---> Package epel-release.noarch 0:7-13 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================================================================
Package Arch Version Repository Size
======================================================================================================================================================
Updating:
epel-release noarch 7-13 epel 15 k
Transaction Summary
======================================================================================================================================================
Upgrade 1 Package
Total download size: 15 k
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
warning: /var/cache/yum/x86_64/7/epel/packages/epel-release-7-13.noarch.rpm: Header V4 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Public key for epel-release-7-13.noarch.rpm is not installed
epel-release-7-13.noarch.rpm | 15 kB 00:00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
Userid : "Fedora EPEL (7) <[email protected]>"
Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
Package : epel-release-7-11.noarch (@extras)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : epel-release-7-13.noarch 1/2
Cleanup : epel-release-7-11.noarch 2/2
Verifying : epel-release-7-13.noarch 1/2
Verifying : epel-release-7-11.noarch 2/2
Updated:
epel-release.noarch 0:7-13
Complete!
[root@unixcop ~]#
Instalar herramientas yum-utils
Así que instala yum-utils con el comando:
[root@unixcop ~]# yum install yum-utils -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.san.fastserv.com
* epel: mirror.sfo12.us.leaseweb.net
* extras: mirrors.raystedman.org
* updates: mirror.sjc02.svwh.net
Resolving Dependencies
--> Running transaction check
---> Package yum-utils.noarch 0:1.1.31-54.el7_8 will be installed
--> Processing Dependency: python-kitchen for package: yum-utils-1.1.31-54.el7_8.noarch
--> Processing Dependency: libxml2-python for package: yum-utils-1.1.31-54.el7_8.noarch
--> Running transaction check
---> Package libxml2-python.x86_64 0:2.9.1-6.el7.5 will be installed
---> Package python-kitchen.noarch 0:1.1.1-5.el7 will be installed
--> Processing Dependency: python-chardet for package: python-kitchen-1.1.1-5.el7.noarch
--> Running transaction check
---> Package python-chardet.noarch 0:2.2.1-3.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================================================================
Package Arch Version Repository Size
======================================================================================================================================================
Installing:
yum-utils noarch 1.1.31-54.el7_8 base 122 k
Installing for dependencies:
libxml2-python x86_64 2.9.1-6.el7.5 base 247 k
python-chardet noarch 2.2.1-3.el7 base 227 k
python-kitchen noarch 1.1.1-5.el7 base 267 k
Transaction Summary
======================================================================================================================================================
Install 1 Package (+3 Dependent packages)
Total download size: 863 k
Installed size: 4.3 M
Downloading packages:
(1/4): python-chardet-2.2.1-3.el7.noarch.rpm | 227 kB 00:00:00
(2/4): libxml2-python-2.9.1-6.el7.5.x86_64.rpm | 247 kB 00:00:00
(3/4): yum-utils-1.1.31-54.el7_8.noarch.rpm | 122 kB 00:00:00
(4/4): python-kitchen-1.1.1-5.el7.noarch.rpm | 267 kB 00:00:00
------------------------------------------------------------------------------------------------------------------------------------------------------
Total 1.1 MB/s | 863 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : python-chardet-2.2.1-3.el7.noarch 1/4
Installing : python-kitchen-1.1.1-5.el7.noarch 2/4
Installing : libxml2-python-2.9.1-6.el7.5.x86_64 3/4
Installing : yum-utils-1.1.31-54.el7_8.noarch 4/4
Verifying : libxml2-python-2.9.1-6.el7.5.x86_64 1/4
Verifying : python-kitchen-1.1.1-5.el7.noarch 2/4
Verifying : yum-utils-1.1.31-54.el7_8.noarch 3/4
Verifying : python-chardet-2.2.1-3.el7.noarch 4/4
Installed:
yum-utils.noarch 0:1.1.31-54.el7_8
Dependency Installed:
libxml2-python.x86_64 0:2.9.1-6.el7.5 python-chardet.noarch 0:2.2.1-3.el7 python-kitchen.noarch 0:1.1.1-5.el7
Complete!
[root@unixcop ~]#
Ahora necesita resolver los paquetes RPM con los siguientes comandos:
Primero instale rpmconf
# yum install rpmconf
Luego resuelva los paquetes RPM con:
[root@unixcop ~]# rpmconf -a
Configuration file 'https://1118798822.rsc.cdn77.org/etc/nsswitch.conf'
-rw-r--r--. 1 root root 1938 Apr 28 09:31 /etc/nsswitch.conf.rpmnew
-rw-r--r--. 1 root root 1746 Aug 20 07:14 /etc/nsswitch.conf
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
M : merge configuration files
Z : background this process to examine the situation
S : skip this file
The default action is to keep your current version.
*** aliases (Y/I/N/O/D/M/Z/S) [default=N] ?
Your choice: N
[root@unixcop ~]#
Entonces, la acción predeterminada que N es mantener la versión del mantenedor del paquete.
A continuación, realice una limpieza de todos los paquetes que no necesita con los siguientes comandos:
[root@unixcop ~]# package-cleanup --leaves
Loaded plugins: fastestmirror
bind-libs-lite-9.11.4-26.P2.el7_9.5.x86_64
libsysfs-2.1.0-16.el7.x86_64
[root@unixcop ~]#
[root@unixcop ~]# package-cleanup --orphans
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.mirror.ndchost.com
* epel: mirror.sfo12.us.leaseweb.net
* extras: mirrors.raystedman.org
* updates: mirror.sjc02.svwh.net
kernel-3.10.0-957.el7.x86_64
[root@unixcop ~]#
Instalar el dnf en CentOS 7
DNF es el administrador de paquetes predeterminado en CentOS 8. Instálelo con el comando:
# yum install dnf
Ahora elimine el administrador de paquetes yum con los siguientes comandos:
[root@unixcop ~]# dnf remove yum yum-metadata-parser -y
Dependencies resolved.
======================================================================================================================================================
Package Arch Version Repository Size
======================================================================================================================================================
Removing:
yum noarch 3.4.3-168.el7.centos @System 5.6 M
yum-metadata-parser x86_64 1.1.4-10.el7 @System 57 k
Removing dependent packages:
yum-plugin-fastestmirror noarch 1.1.31-54.el7_8 @System 53 k
yum-utils noarch 1.1.31-54.el7_8 @System 337 k
Transaction Summary
======================================================================================================================================================
Remove 4 Packages
Freed space: 6.0 M
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Erasing : yum-utils-1.1.31-54.el7_8.noarch 1/4
Erasing : yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch 2/4
Erasing : yum-3.4.3-168.el7.centos.noarch 3/4
Erasing : yum-metadata-parser-1.1.4-10.el7.x86_64 4/4
Verifying : yum-3.4.3-168.el7.centos.noarch 1/4
Verifying : yum-metadata-parser-1.1.4-10.el7.x86_64 2/4
Verifying : yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch 3/4
Verifying : yum-utils-1.1.31-54.el7_8.noarch 4/4
Removed:
yum-3.4.3-168.el7.centos.noarch yum-metadata-parser-1.1.4-10.el7.x86_64 yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch
yum-utils-1.1.31-54.el7_8.noarch
Complete!
[root@unixcop ~]#
# rm -Rf /etc/yum
Actualizar CentOS 7 a CentOS 8
En primer lugar, actualice el administrador de paquetes dnf con el comando:
# dnf upgrade
Luego instale el paquete de lanzamiento de CentOS 8 usando dnf con el siguiente comando:
[root@unixcop ~]# dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/{centos-linux-repos-8-2.el8.noarch.rpm,centos-gpg-keys-8-2.el8.noarch.rpm,centos-linux-release-8.4-1.2105.el8.noarch.rpm} -y
Last metadata expiration check: 0:03:39 ago on Tue 24 Aug 2021 07:24:11 AM EDT.
centos-linux-repos-8-2.el8.noarch.rpm 72 kB/s | 20 kB 00:00
centos-gpg-keys-8-2.el8.noarch.rpm 68 kB/s | 12 kB 00:00
centos-linux-release-8.4-1.2105.el8.noarch.rpm 266 kB/s | 22 kB 00:00
Dependencies resolved.
======================================================================================================================================================
Package Arch Version Repository Size
======================================================================================================================================================
Installing:
centos-linux-repos noarch 8-2.el8 @commandline 20 k
centos-gpg-keys noarch 1:8-2.el8 @commandline 12 k
centos-linux-release noarch 8.4-1.2105.el8 @commandline 22 k
replacing centos-release.x86_64 7-9.2009.1.el7.centos
Transaction Summary
======================================================================================================================================================
Install 3 Packages
Total size: 53 k
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : centos-gpg-keys-1:8-2.el8.noarch 1/4
Installing : centos-linux-release-8.4-1.2105.el8.noarch 2/4
Installing : centos-linux-repos-8-2.el8.noarch 3/4
Obsoleting : centos-release-7-9.2009.1.el7.centos.x86_64 4/4
warning: file /etc/yum/vars/infra: remove failed: No such file or directory
warning: file /etc/yum/vars/contentdir: remove failed: No such file or directory
Verifying : centos-linux-repos-8-2.el8.noarch 1/4
Verifying : centos-gpg-keys-1:8-2.el8.noarch 2/4
Verifying : centos-linux-release-8.4-1.2105.el8.noarch 3/4
Verifying : centos-release-7-9.2009.1.el7.centos.x86_64 4/4
Installed:
centos-linux-repos-8-2.el8.noarch centos-gpg-keys-1:8-2.el8.noarch centos-linux-release-8.4-1.2105.el8.noarch
Complete!
[root@unixcop ~]#
A continuación, actualice el repositorio de EPEL de la siguiente manera:
[root@unixcop ~]# dnf upgrade https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y
Extra Packages for Enterprise Linux 7 - x86_64 14 MB/s | 17 MB 00:01
CentOS Linux 8 - BaseOS 7.2 MB/s | 5.6 MB 00:00
CentOS Linux 8 - AppStream 39 MB/s | 8.8 MB 00:00
CentOS Linux 8 - Extras 141 kB/s | 10 kB 00:00
epel-release-latest-8.noarch.rpm 60 kB/s | 23 kB 00:00
Dependencies resolved.
======================================================================================================================================================
Package Arch Version Repository Size
======================================================================================================================================================
Upgrading:
epel-release noarch 8-11.el8 @commandline 23 k
Transaction Summary
======================================================================================================================================================
Upgrade 1 Package
Total size: 23 k
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Upgrading : epel-release-8-11.el8.noarch 1/2
Cleanup : epel-release-7-13.noarch 2/2
Verifying : epel-release-8-11.el8.noarch 1/2
Verifying : epel-release-7-13.noarch 2/2
Upgraded:
epel-release-8-11.el8.noarch
Complete!
[root@unixcop ~]#
Ahora, elimine todos los archivos temporales con el siguiente comando:
[root@unixcop ~]# dnf clean all
55 files removed
[root@unixcop ~]#
Elimine el antiguo núcleo del kernel de CentOS 7 con el comando:
# rpm -e `rpm -q kernel`
También debe eliminar todos los paquetes en conflicto con el siguiente comando:
# rpm -e --nodeps sysvinit-tools
Inicie la actualización del sistema CentOS 8 como se muestra a continuación:
[root@unixcop ~]# dnf --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync -y
Extra Packages for Enterprise Linux 8 - x86_64 8.2 MB/s | 10 MB 00:01
CentOS Linux 8 - BaseOS 7.2 MB/s | 5.6 MB 00:00
Extra Packages for Enterprise Linux Modular 8 - x86_64 5.1 MB/s | 931 kB 00:00
CentOS Linux 8 - AppStream 38 MB/s | 8.8 MB 00:00
CentOS Linux 8 - Extras 166 kB/s | 10 kB 00:00
Dependencies resolved.
.......
...
Instalar el nuevo Kernel Core para CentOS 8
Para instalar un nuevo kernel para CentOS 8 , use este comando a continuación:
# dnf install kernel-core -y
NOTA:
Es posible que tenga algunos problemas con el comando anterior que indica que hay un problema :solicitudes en conflicto a los paquetes
Entonces puede agregar estas opciones al comando para resolver este problema:
# dnf install kernel-core -y --allowerasing --skip-broken
- La –autorización opción para reemplazar paquetes en conflicto.
- El –salto roto opción para omitir paquetes desinstalables.
Instalar paquetes mínimos de CentOS 8
Ahora está listo para instalar el paquete mínimo de CentOS 8. Puede hacerlo ejecutando el siguiente comando:
# dnf groupupdate "Core" "Minimal Install" -y
NOTA:
Además, si tiene el mismo problema anterior, puede usar este comando para resolver el problema:
# dnf groupupdate "Core" "Minimal Install" -y --allowerasing --skip-broken
¡Así que la tarea de actualización de CentOS 7 a CentOS 8 se ha completado!
Ahora puedes comprobar la versión de CentOS con:
[root@unixcop ~]# cat /etc/redhat-release
CentOS Linux release 8.4.2105
[root@unixcop ~]#
Conclusión
Entonces, este artículo le muestra cómo puede actualizar desde CentOS 7 a CentOS 8 .