Thursday, June 21, 2018

RHEL7 - update from RHEL7.3 to RHEL7.5

Following command below, resolve the issue.
======================================

Issue
- yum update was interrupted in the middle and system is left with older and newer (broken) packages which caused on `duplicates package' issue.
-> We need to remove  newer duplicate packages from the system.

Resolution
Remove duplicate packages. If you have an older version of yum-utils, the --removenewestdupes option may not be available.

Run the command below to cleanup duplicates,
# package-cleanup --cleandupes --removenewestdupes

In our case, the above command fixed our issue. Solution says, if it does not fix, use the following steps below to remove duplicates.

# yum update > file

- edit file to remove lines with conflict present and those number:  entries
used awk to cut out the package name
Then in a loop read the input and did the rpm command : `# rpm -e --justdb <package name> `

For more details, kindly refer : yum fails with package_name-version1 is a duplicate with package_name-version2.

The cleandupes option removes the older packages instead of newer hence can't be used directly.


----------------- Here are the real Steps followed to resolve the issue ...

Boot your system into rescue mode
1. Reboot your system

2. On the timer screen, the grub menu, press arrowkey to stop the timer.

3. Select the kernel line you want to edit and press e to edit.
or
if you have line that says rescue, select and press enter to boot.
It will take you to rescue mode too.

4. Arrow down to the line called 'linux16'.

5. Go to the end of the line (Press CTRL+e) and type
systemd.unit=rescue.target

6. Press CTRL+x to save and boot the system.

select the rescue mode.

7. verify your root is mounted and run the command below, wait until finished.
# package-cleanup --cleandupes --removenewestdupes

8. Run yum update on rescue mode. Make sure you set up local repo.
# yum update

9. Once done, reboot the machine.
# reboot


=================
This is detail what was done ....

# cd /opt/repo/RHEL7-Patch_062017/
# rhn_register
# reposync -n -p /opt/repo/RHEL7-Patch_06112018 --repoid=rhel-7-server-rpms
# tail -30f yum.log
# mpstat -P ALL 2 5
# vmstat 2 5
# tail -300 yum.log
# tail -300f yum.log
# cat yum.log |more
# netstat -an | grep -i established
# cd /etc/yum.repos.d
# cat local.repo
# yum repolist
# yum history
# yum history list all | more
# yum history info yum
# yum history info yum | wc -l
# yum history info httpd
# yum history info httpd | wc -l
# yum history summary httpd
# yum history info 8
# yum history info 7
# yum history info 8 | wc -l
# yum history undo 8
# yum history undo 8
# yum clean all && yum makecache fast
# uname -a >/var/tmp/uname-a-before-reboot.txt
# reboot
# yum history
# yum history redo 8
# yum-complete-transaction
# more /etc/grub2.cfg
# yum-complete-transaction --cleanup-only
# yum history redo last
# man yum
# yum check
# ls | grep ibcanberra
# rpm -qa | grep ibcanberra
# rpm -e libcanberra-gtk3-0.30-5.el7.x86_64
# yum remove libcanberra-gtk3-0.30-5.el7.x86_64
# yum install  libcanberra-gtk3-0.30-5.el7.x86_64
# yum install cheese.x86_64 2:3.14.2-5.el7

# cd /
# find . -name "*canberra*" -print
# cd /usr/lib64
# ls -al | grep -i canberra
# rpm -qf /usr/lib64/libcanberra-gtk3.so.0.1.9
# cd /opt/repo/RHEL7-Patch_06112018/rhel-7-server-rpms/Packages
# ls | grep -i canberra

# ls -ltr | grep -i yum
# grep -i kernel yum.log-20180612
# mpstat -P CPU 2 5
# mpstat -P ALL 2 5

# yum check duplicates
# yum update --skip-broken
# cd /var/lib/rpm
# mkdir /var/tmp/rpm-db-bk
# mv __db* /var/tmp/rpm-db-bk
# rpm --rebuilddb
# yum clean all
# rm -rf /var/cache/yum
# rm -rf __db*
# rpm --rebuilddb

# yum clean all
# yum update
# vi /etc/yum/pluginconf.d/search-disabled-repos.conf
# yum clean all
# yum update
# cd /var/tmp
# package-cleanup --cleandupes --removenewestdupes
# yum update
# which vncserver
# cd /usr
# find . -name "*term*" -print
# systemctl set-default multi-user.target
# yum install tigervnc-server tigervnc
# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
# vi /etc/systemd/system/vncserver@:1.service
# firewall-cmd --permanent --zone=public --add-port 5901/tcp
# vi /etc/ssh/sshd_config

# yum update
# systemctl set-default graphical.target
# systemctl enable graphical.target

==========================================


1. What happened was I ran yum update command and it took more then 2 hours just to complete 521 packages output 1701. After that session timed out.

  Updating   : gtkmm24-2.24.5-1.el7.x86_64                        520/1701
  Updating   : adwaita-gtk2-theme-3.22.2-2.el7_5.x86_64 [###############  ]      521/1701

[root@srmp-lnx-v01 log]# yum history
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
ID     | Login user               | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
     8 | Sam Sharma <ssharma>   | 2018-06-11 15:03 | I, O, U        |  912 *<
     7 | Sam Sharma <ssharma>   | 2017-06-05 15:36 | Install        |    3 >
     6 | Sam Sharma <ssharma>   | 2017-06-05 15:16 | Install        |    5
     5 | Ram Sharma <rsharma>    | 2017-05-31 11:05 | I, U           |  163 EE
     4 | Sam Sharma <ssharma>   | 2017-05-30 10:39 | Install        |    1  <
     3 | Sam Sharma <ssharma>   | 2017-04-20 11:06 | Install        |    1 >
     2 | Sam Sharma <ssharma>   | 2017-04-20 09:48 | Install        |    1
     1 | System <unset>           | 2017-04-19 11:43 | Install        | 1286
Warning: RPMDB altered outside of yum.
** Found 478 pre-existing rpmdb problem(s), 'yum check' output follows:

The output shows history as well as any incomplete packages...

2. Checked the log at /var/log/yum.log
This file also had 520 entires.

[root@srmp-lnx-v01 ~]# yum history list all | more


3. using transaction id
[root@srmp-lnx-v01 ~]# yum history info 8

This command output is too much.
[root@srmp-lnx-v01 ~]# yum history info 8 | wc -l
1725
[root@srmp-lnx-v01 ~]#


[root@srmp-lnx-v01 ~]# yum history info 7
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Transaction ID : 7
Begin time     : Mon Jun  5 15:36:45 2017
Begin rpmdb    : 1299:bf60fd111096aedefb3f12847c700fd25cd3496b
End time       :            15:37:03 2017 (18 seconds)
End rpmdb      : 1302:46b6f6bb058d5410b29e1966d318e631c568354d **
User           : Sam Sharma <ssharma>
Return-Code    : Success
Command Line   : install elinks
Transaction performed with:
    Installed     rpm-4.11.3-21.el7.x86_64                  @anaconda/7.3
    Installed     subscription-manager-1.17.15-1.el7.x86_64 @anaconda/7.3
    Installed     yum-3.4.3-150.el7.noarch                  @anaconda/7.3
Packages Altered:
    Install     elinks-0.12-0.36.pre6.el7.x86_64   @LOCAL
    Dep-Install js-1:1.8.5-19.el7.x86_64           @LOCAL
    Dep-Install nss_compat_ossl-0.9.6-8.el7.x86_64 @LOCAL
history info
[root@srmp-lnx-v01 ~]#


4. Now, I decided to back out the update to transaction 7.

[root@srmp-lnx-v01 ~]# yum history
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
ID     | Login user               | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
     8 | Sam Sharma <ssharma>   | 2018-06-11 15:03 | I, O, U        |  912 *<
     7 | Sam Sharma <ssharma>   | 2017-06-05 15:36 | Install        |    3 >
     6 | Sam Sharma <ssharma>   | 2017-06-05 15:16 | Install        |    5
     5 | Ram Sharma <rsharma>    | 2017-05-31 11:05 | I, U           |  163 EE
     4 | Sam Sharma <ssharma>   | 2017-05-30 10:39 | Install        |    1  <
     3 | Sam Sharma <ssharma>   | 2017-04-20 11:06 | Install        |    1 >
     2 | Sam Sharma <ssharma>   | 2017-04-20 09:48 | Install        |    1
     1 | System <unset>           | 2017-04-19 11:43 | Install        | 1286

[root@srmp-lnx-v01 ~]# yum history undo 8

'''''
 libgpg-error                             i686     1.12-3.el7                     -                      0.0

Transaction Summary
===============================================================================================================
Remove          58 Packages
Reinstall      463 Packages
Not installed   54 Packages

Total download size: 199 M
Is this ok [y/d/N]: y
Downloading packages:
---------------------------------------------------------------------------------------------------------------
Total                                                                          126 MB/s | 199 MB  00:00:01
Running transaction check
Running transaction test

Transaction check error:

Error Summary
-------------

[root@srmp-lnx-v01 ~]#


ran the command yum history redo
yum clean all && yum makecache fast
# yum history undo 8

failed

# yum clean all && yum makecache fast

5. rebooted and did yum update
# yum-complete-transaction --cleanup-only

[root@srmp-lnx-v01 ~]# yum update
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-tr                                                                                                                        ansaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try r                                                                                                                        emoving/installing packages by hand (maybe package-cleanup can help).
--> Running transaction check
---> Package ModemManager.x86_64 0:1.6.0-2.el7 will be updated
---> Package ModemManager.x86_64 0:1.6.10-1.el7 will be an update
---> Package NetworkManager.x86_64 1:1.4.0-20.el7_3 will be obsoleted
--> Processing Dependency: NetworkManager(x86-64) = 1:1.4.0-20.el7_3 for package: 1:NetworkManager-wifi-1.4.0-20.el7_                                                                                                                        3.x86_64
--> Processing Dependency: NetworkManager(x86-64) = 1:1.4.0-20.el7_3 for package: 1:NetworkManager-team-1.4.0-20.el7_                                                                                                                        3.x86_64
---> Package NetworkManager-adsl.x86_64 1:1.4.0-20.el7_3 will be updated
---> Package NetworkManager-adsl.x86_64 1:1.10.2-14.el7_5 will be an update
---> Package NetworkManager-config-server.x86_64 1:1.4.0-20.el7_3 will be updated


=====================
yum update error

rror: Package: 1:gnome-bluetooth-libs-3.20.1-1.el7.x86_64 (LOCAL-Jun-2018-PATCH)
           Requires: libcanberra-gtk3.so.0()(64bit)
           Removing: libcanberra-gtk3-0.30-5.el7.x86_64 (@anaconda/7.3)
               libcanberra-gtk3.so.0()(64bit)
 You could try using --skip-broken to work around the problem
** Found 478 pre-existing rpmdb problem(s), 'q' output follows:
ModemManager-glib-1.6.10-1.el7.x86_64 is a duplicate with ModemManager-glib-1.6.0-2.el7.x86_64
1:NetworkManager-1.10.2-14.el7_5.x86_64 is a duplicate with 1:NetworkManager-1.4.0-20.el7_3.x86_64
1:NetworkManager-glib-1.10.2-14.el7_5.x86_64 has installed conflicts NetworkManager-libnm < ('1', '1.10.2', '14.el7_5'): 1:NetworkManager-libnm-1.4.0-20.el7_3.x86_64
1:NetworkManager-glib-1.10.2-14.el7_5.x86_64 is a duplicate with 1:NetworkManager-glib-1.4.0-20.el7_3.x86_64
1:NetworkManager-libnm-1.10.2-14.el7_5.x86_64 has installed conflicts NetworkManager-glib < ('1', '1.10.2', '14.el7_5'): 1:NetworkManager-glib-1.4.0-20.el7_3.x86_64
1:NetworkManager-libnm-1.10.2-14.el7_5.x86_64 is a duplicate with 1:NetworkManager-libnm-1.4.0-20.el7_3.x86_64

.......


           Available: libvirt-client-3.9.0-14.el7_5.4.i686 (rhel-7-server-rpms)
               Not found
Error: avahi-glib conflicts with avahi-0.6.31-19.el7.x86_64
Error: Package: mesa-dri-drivers-11.2.2-2.20160614.el7.x86_64 (@anaconda/7.3)
           Requires: libLLVM-3.8-mesa.so()(64bit)
           Removing: mesa-private-llvm-3.8.1-1.el7.x86_64 (@anaconda/7.3)
               libLLVM-3.8-mesa.so()(64bit)
           Updated By: mesa-private-llvm-3.9.1-3.el7.x86_64 (LOCAL-Jun-2018-PATCH)
              ~libLLVM-3.9-mesa.so()(64bit)
 You could try using --skip-broken to work around the problem
** Found 478 pre-existing rpmdb problem(s), 'yum check' output follows:
ModemManager-glib-1.6.10-1.el7.x86_64 is a duplicate with ModemManager-glib-1.6.0-2.el7.x86_64
1:NetworkManager-1.10.2-14.el7_5.x86_64 is a duplicate with 1:NetworkManager-1.4.0-20.el7_3.x86_64
1:NetworkManager-glib-1.10.2-14.el7_5.x86_64 has installed conflicts NetworkManager-libnm < ('1', '1.10.2', '14.el7_5'): 1:NetworkManager-libnm-1.4.0-20.el7_3.x86_64
1:NetworkManager-glib-1.10.2-14.el7_5.x86_64 is a duplicate with 1:NetworkManager-glib-1.4.0-20.el7_3.x86_


====================
removed packages


Dependencies Resolved

=================================================================================================================================================
 Package                                                                       Arch                                       Version
=================================================================================================================================================
Removing:
 libcanberra-gtk3                                                              x86_64                                     0.30-5.el7
Removing for dependencies:
 cheese                                                                        x86_64                                     2:3.14.2-5.el7
 cheese-libs                                                                   x86_64                                     2:3.14.2-5.el7
 control-center                                                                x86_64                                     1:3.14.5-19.el7
 empathy                                                                       x86_64                                     3.12.10-2.el7
 firstboot                                                                     x86_64                                     19.12-1.el7
 gdm                                                                           x86_64                                     1:3.14.2-20.el7_3
 gnome-classic-session                                                         noarch                                     3.14.4-21.el7
 gnome-color-manager                                                           x86_64                                     3.14.2-1.el7
 gnome-contacts                                                                x86_64                                     3.14.2-4.el7
 gnome-disk-utility                                                            x86_64                                     3.14.0-2.el7
 gnome-initial-setup                                                           x86_64                                     3.14.4-5.el7
 gnome-packagekit                                                              x86_64                                     3.14.3-7.el7
 gnome-packagekit-common                                                       x86_64                                     3.14.3-7.el7
 gnome-packagekit-installer                                                    x86_64                                     3.14.3-7.el7
 gnome-packagekit-updater                                                      x86_64                                     3.14.3-7.el7
 gnome-screenshot                                                              x86_64                                     3.14.0-3.el7
 gnome-settings-daemon                                                         x86_64                                     3.14.4-12.el7
 gnome-shell                                                                   x86_64                                     3.14.4-53.el7
 gnome-shell-extension-alternate-tab                                           noarch                                     3.14.4-21.el7
 gnome-shell-extension-apps-menu                                               noarch                                     3.14.4-21.el7
 gnome-shell-extension-common                                                  noarch                                     3.14.4-21.el7
 gnome-shell-extension-launch-new-instance                                     noarch                                     3.14.4-21.el7
 gnome-shell-extension-places-menu                                             noarch                                     3.14.4-21.el7
 gnome-shell-extension-window-list                                             noarch                                     3.14.4-21.el7
 gnome-tweak-tool                                                              noarch                                     3.14.3-2.el7
 initial-setup-gui                                                             x86_64                                     0.3.9.36-1.el7
 libcanberra-gtk2                                                              x86_64                                     0.30-5.el7
 metacity                                                                      x86_64                                     2.34.13-7.el7
 mutter                                                                        x86_64                                     3.14.4-31.el7
 orca                                                                          x86_64                                     3.6.3-4.el7
 pulseaudio-gdm-hooks                                                          x86_64                                     6.0-9.el7_3
 subscription-manager-initial-setup-addon                                      x86_64                                     1.17.15-1.el7
 system-config-printer                                                         x86_64                                     1.4.1-19.el7

Transaction Summary
===========================================================================================================================================

Removed:
  libcanberra-gtk3.x86_64 0:0.30-5.el7

Dependency Removed:
cheese.x86_64 2:3.14.2-5.el7                              
cheese-libs.x86_64 2:3.14.2-5.el7
control-center.x86_64 1:3.14.5-19.el7                     
gnome-initial-setup.x86_64 0:3.14.4-5.el7
empathy.x86_64 0:3.12.10-2.el7
firstboot.x86_64 0:19.12-1.el7 
gdm.x86_64 1:3.14.2-20.el7_3
gnome-classic-session.noarch 0:3.14.4-21.el7
gnome-color-manager.x86_64 0:3.14.2-1.el7
gnome-contacts.x86_64 0:3.14.2-4.el7
gnome-disk-utility.x86_64 0:3.14.0-2.el7
gnome-packagekit.x86_64 0:3.14.3-7.el7
gnome-packagekit-common.x86_64 0:3.14.3-7.el7             
gnome-packagekit-installer.x86_64 0:3.14.3-7.el7
gnome-packagekit-updater.x86_64 0:3.14.3-7.el7
gnome-screenshot.x86_64 0:3.14.0-3.el7
gnome-settings-daemon.x86_64 0:3.14.4-12.el7
gnome-shell.x86_64 0:3.14.4-53.el7
gnome-shell-extension-alternate-tab.noarch 0:3.14.4-21.el7
gnome-shell-extension-apps-menu.noarch 0:3.14.4-21.el7
gnome-shell-extension-common.noarch 0:3.14.4-21.el7       
gnome-shell-extension-launch-new-instance.noarch 0:3.14.4-21.el7
gnome-shell-extension-places-menu.noarch 0:3.14.4-21.el7  
gnome-shell-extension-window-list.noarch 0:3.14.4-21.el7
gnome-tweak-tool.noarch 0:3.14.3-2.el7                    
initial-setup-gui.x86_64 0:0.3.9.36-1.el7
libcanberra-gtk2.x86_64 0:0.30-5.el7  
metacity.x86_64 0:2.34.13-7.el7
mutter.x86_64 0:3.14.4-31.el7  
orca.x86_64 0:3.6.3-4.el7
pulseaudio-gdm-hooks.x86_64 0:6.0-9.el7_3 
subscription-manager-initial-setup-addon.x86_64 0:1.17.15-1.el7
system-config-printer.x86_64 0:1.4.1-19.el7

Complete!
[root@srmp-lnx-v01 Packages]#
[root@srmp-lnx-v01 Packages]#


===========================
installation completed

 Verifying  : nautilus-3.14.3-12.el7.x86_64                  48/51
  Verifying  : 1:totem-3.14.3-6.el7.x86_64                       49/51
  Verifying  : gnome-session-3.14.0-5.el7.x86_64                   50/51
  Verifying  : evince-libs-3.14.2-17.el7.x86_64                     51/51

Installed:
  cheese.x86_64 2:3.22.1-2.el7

Dependency Installed:
  cheese-libs.x86_64 2:3.22.1-2.el7     clutter-gst3.x86_64 0:3.0.22-1.el7                    compat-gnome-desktop314.x86_64 0:3
  webkitgtk4-jsc.x86_64 0:2.16.6-6.el7  webkitgtk4-plugin-process-gtk2.x86_64 0:2.16.6-6.el7

Updated:
  gedit.x86_64 2:3.22.0-3.el7

Dependency Updated:
  eog.x86_64 0:3.20.5-2.el7                  evince.x86_64 0:3.22.1-7.el7                  evince-libs.x86_64 0:3.22.1-7.el7
  gnome-desktop3.x86_64 0:3.22.2-2.el7       gnome-font-viewer.x86_64 0:3.22.0-1.el7       gnome-online-accounts.x86_64 0:3.26.2
  gnome-software.x86_64 0:3.22.7-5.el7       grilo.x86_64 0:0.3.3-1.el7                    grilo-plugins.x86_64 0:0.3.4-3.el7
  gtksourceview3.x86_64 0:3.22.2-1.el7       nautilus.x86_64 0:3.22.3-5.el7                nautilus-extensions.x86_64 0:3.22.3-5

Complete!
[root@srmp-lnx-v01 Packages]#

No comments:

Post a Comment