Huu Phan | Blog Linux operating system | Linux operating system -Blog Huu Phan | www.huuphan.com
huuphan.com. Powered by Blogger.

CentOS/RHEL Use yum Command To Downgrade Upgrade or Rollback Updates

Use yum Command To Downgrade Upgrade or Rollback Update. How to downgrade the package? How to upgrade the package? How to rollback update the package?. I'm running commands with root account.

You may reading link below :






How to  Downgrade Upgrade package use yum command


The basic syntax Downgrade package
yum downgrade package1
yum downgrade package1 package2
showing multiple versions of a package
yum --showduplicates list package
For example
How to Downgrade php-fpm 7.0.21 roll-back php-fpm 5.3.3
yum downgrade php-fpm
The output as bellow
Resolving Dependencies
--> Running transaction check
---> Package php-fpm.x86_64 0:7.0.20-1.el6.remi will be a downgrade
--> Processing Dependency: php-common(x86-64) = 7.0.20-1.el6.remi for package: php-fpm-7.0.20-1.el6.remi.x86_64
---> Package php-fpm.x86_64 0:7.0.21-1.el6.remi will be erased
--> Finished Dependency Resolution
Error: Package: php-fpm-7.0.20-1.el6.remi.x86_64 (remi-php70)
           Requires: php-common(x86-64) = 7.0.20-1.el6.remi
           Installed: php-common-7.0.21-1.el6.remi.x86_64 (@remi-php70)
               php-common(x86-64) = 7.0.21-1.el6.remi
           Available: php-common-5.3.3-49.el6.x86_64 (base)
               php-common(x86-64) = 5.3.3-49.el6
           Available: php-common-7.0.20-1.el6.remi.x86_64 (remi-php70)
               php-common(x86-64) = 7.0.20-1.el6.remi
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
Due to, the package php-fpm dependency with php-common, your downgrade the package php-fpm and php-common.
yum downgrade php-fpm php-common
The method another, you can downgrade the all package php.
yum downgrade $(rpm -qa --queryformat="%{name} \n" |grep ^php)
if the during downgrade, the package dependency remi repo, your disable remi repo before downgrade the package.
yum-config-manager --disable remi-php70

How to upgrade the package use yum command


The basic syntax
yum update package1
yum update package1 package2
For example, how to upgrade php-fpm 5.3.3 to php-fpm 7.0.21
yum update php-fpm php-mysql --enablerepo=remi-php70
How to List installed packages with YUM
yum list installed | egrep php

How to roll back an update using yum command? How to Roll-back package


yum history
The output as bellow
ID     | Login user               | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
    12 |  <huupv>                 | 2017-07-20 15:42 | I, O, U        |    9  <
    11 |  <huupv>                 | 2017-07-20 14:46 | Install        |   18 >
    10 |  <huupv>                 | 2017-07-20 11:06 | Install        |    1  
     9 |  <huupv>                 | 2017-07-20 10:51 | Install        |    1  
     8 |  <huupv>                 | 2017-07-20 10:46 | Install        |    4  
     7 |  <huupv>                 | 2017-07-20 10:44 | Install        |   16  
     6 |  <huupv>                 | 2017-07-20 10:40 | Install        |    4  
     5 |  <huupv>                 | 2017-07-20 10:38 | Install        |    5  
     4 |  <huupv>                 | 2017-07-20 10:38 | Install        |    1  
     3 | root <root>              | 2017-07-20 09:30 | Install        |  241  
     2 | root <root>              | 2017-07-20 09:28 | I, U           |   98 EE
     1 | System <unset>           | 2017-07-20 09:20 | Install        |  205  
Roll-back the package with ID 8
yum history
yum history info 8
yum history undo 8

The conclusion


To use yum command to Downgrade/ Upgrade or Rollback the package on CentOS/RHEL system

post new :

Huu Phan | Blog Linux operating system | Huu Phan ~ Zimbra Mail Server,linux,bash script,centos,linux command | www.huuphan.com