Tuesday, April 12, 2022

[SOLVED] Yum error updating openssh-server

Issue

I am trying to run the command on a Centos 7.4 server:

yum update openessh-server

However, I am getting the following error:

Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
openssh-server-7.4p1-13.el7_4.x86_64.rpm                                                                      | 458 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : openssh-server-7.4p1-13.el7_4.x86_64                                                                              1/2 
Error unpacking rpm package openssh-server-7.4p1-13.el7_4.x86_64
warning: /etc/ssh/sshd_config created as /etc/ssh/sshd_config.rpmnew
error: unpacking of archive failed on file /usr/sbin/sshd: cpio: rename
  Verifying  : openssh-server-7.4p1-13.el7_4.x86_64                                                                              1/2 
openssh-server-6.6.1p1-35.el7_3.x86_64 was supposed to be removed but is not!
  Verifying  : openssh-server-6.6.1p1-35.el7_3.x86_64                                                                            2/2 

Failed:
  openssh-server.x86_64 0:6.6.1p1-35.el7_3                           openssh-server.x86_64 0:7.4p1-13.el7_4 

uname -a

Linux XXXXXX 3.10.0-327.10.1.el7.x86_64 #1 SMP Tue Feb 16 17:03:50 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

yum repolist

repo id                                     repo name                                                                          status
base/7/x86_64                               CentOS-7 - Base                                                                     9,591
centosplus/7/x86_64                         CentOS-7 - Plus                                                                        63
epel/x86_64                                 Extra Packages for Enterprise Linux 7 - x86_64                                     12,155
epel-debuginfo/x86_64                       Extra Packages for Enterprise Linux 7 - x86_64 - Debug                              2,694
extras/7/x86_64                             CentOS-7 - Extras                                                                     327
remi                                        Les RPM de remi pour Enterprise Linux 7 - x86_64                                    4,548
remi-php56                                  Les RPM de remi de PHP 5.6 pour Enterprise Linux 7 - x86_64                           415
remi-safe                                   Safe Remi's RPM repository for Enterprise Linux 7 - x86_64                          2,578
updates/7/x86_64                            CentOS-7 - Updates                                                                  1,573
repolist: 33,944

My instinct is to clear the cache and rebuild the rpm db, do a package-clean, remove openssh-server, then install openssh-server. The reason I have not done this yet is because I am afraid of breaking SSH which is how I access the server. I was wondering if anyone could offer some advice as I am not very experienced when it comes to yum/rpm errors. I am also happy to update the question with more information if needed as I was not sure what to include.


Solution

So the solution that worked for me was:

yum clean all
yum remove openssh-server
yum install openssh-server

I did so from the console to be save, but it turned out it would have worked fine via SSH.



Answered By - C Miller
Answer Checked By - David Goodson (WPSolving Volunteer)