Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm running a machine with CentOS release 6.10 (updated: previously incorrectly stated CentOS-7), and am trying to update PHP from 5.3 to 7.1. I thought it would just be as easy as "sudo yum update php", but apparently not. I found a couple of sites which suggested different ways to do things, but whatever I try I end up with error messages such as below, and I don't know how to resolve the problems which the error messages imply.
I've already done a system update with "sudo yum update", and it seems to have updated everything it knows about with no problems.
So, a sample of the messages I get when trying to update PHP is below:
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
It's basically saying the dependencies required cannot be found in any software repositories you have enabled. Also, CentOS doesn't use sudo by default - you simply run su - to get root privileges.
Can you post the output of the following command using CODE tags:
Code:
yum repolist
I suspect you may not have the epel repo or similar enabled.
Okay; well, I would update to 7 if I could, but apparently I need to update first to 6.5 in order to do that; however, when I try to update to 6.5 it seems there are no updates available.
I tried to remove the php7* repo's, but that didn't seem to work (guess I must be doing something wrong), but now (discovering that the most recent version of PHP I can use on CentOS 6.* is 5.6) I added a 5.6 repo, but that meets with the same errors as I was originally getting when I try to update PHP, so I don't seem able to do that either.
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
First, you should ALWAYS do a clean install of CentOS, not an "upgrade".
Second, if you can't install CentOS 7, then remove the repo's for CentOS/Enterprise 7, then add the same repo's for CentOS 6 instead.
You can't mix repo's for CentOS 7 and repo's for CentOS 6, etc - it won't work. Those packages are built for CentOS/RHEL 7, not CentOS/RHEL 6 - simple as that.
Yeah, unfortunately on this machine I can't do a clean install of CentOS-7, as much as I would like to. (I actually do have 7 on a different machine, which is why I originally said, incorrectly, it was using 7).
Anyway, I had tried to remove the repo's for CentOS-7, but it seemed to error. I don't know if I was doing something wrong (I guess I must have been). I was trying with this:
Code:
# yum remove remi-php71
Loaded plugins: fastestmirror, security
Setting up Remove Process
No Match for argument: remi-php71
Loading mirror speeds from cached hostfile
* epel: mirror.layeronline.com
* remi-php56: mirror.team-cymru.com
* remi-php70: mirror.team-cymru.com
* remi-php71: mirror.team-cymru.com
* remi-safe: mirror.team-cymru.com
No Packages marked for removal
I'm not super-familiar with doing much of this so I guess I have something wrong somewhere along the line. Is there something completely obvious which I'm doing wrong?
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
Quote:
Originally Posted by cheddarcheese
Yeah, unfortunately on this machine I can't do a clean install of CentOS-7, as much as I would like to. (I actually do have 7 on a different machine, which is why I originally said, incorrectly, it was using 7).
Anyway, I had tried to remove the repo's for CentOS-7, but it seemed to error. I don't know if I was doing something wrong (I guess I must have been). I was trying with this:
...
I'm not super-familiar with doing much of this so I guess I have something wrong somewhere along the line. Is there something completely obvious which I'm doing wrong?
Yes, you've asked yum to remove a package that isn't installed.
While I'm not at my machine right now, you can either delete the .repo file for the repo you want to remove (from memory in /etc/yum.repo.d I think - again, I'm not at my machine right now), or run the relevant yum command - you'll have to look it up, as I don't remember it off the top of my head.
Yeah, unfortunately on this machine I can't do a clean install of CentOS-7, as much as I would like to. (I actually do have 7 on a different machine, which is why I originally said, incorrectly, it was using 7).
Oh? Why not? If this machine is capable of running CentOS 7 (and you're trying to UPGRADE to CentOS 7), then it obviously CAN run it. So why can't you do a fresh install??? Schedule downtime, install fresh, and restore data from backups....just as if you would if (when) the server crashes.
Quote:
Anyway, I had tried to remove the repo's for CentOS-7, but it seemed to error. I don't know if I was doing something wrong (I guess I must have been). I was trying with this:
Code:
# yum remove remi-php71
Loaded plugins: fastestmirror, security
Setting up Remove Process
No Match for argument: remi-php71
Loading mirror speeds from cached hostfile
* epel: mirror.layeronline.com
* remi-php56: mirror.team-cymru.com
* remi-php70: mirror.team-cymru.com
* remi-php71: mirror.team-cymru.com
* remi-safe: mirror.team-cymru.com
No Packages marked for removal
I'm not super-familiar with doing much of this so I guess I have something wrong somewhere along the line. Is there something completely obvious which I'm doing wrong?
jsbjsb001 has given some good advice, and I'd strongly suggest you take it. Do *NOT* do an in-place upgrade..you are just asking for trouble, especially going up a few minor versions, then going a MAJOR version up from those.
I can't do a fresh install because it's on a MS Azure VM. The only alternative, in this instance, is creating an entirely new VM, downloading the existing machines setup, etc, etc, and spending forever trying to configure the new VM. Also, in-place upgrades (of the OS) are not supported at all anyway.
So, a CentOS-7 upgrade is not going to happen, but that wasn't my orginal query anyway; I just want to update the version of PHP I have to the latest version which is applicable to the version of CentOS which I have; in this case it'll be PHP-5.6.
Last edited by cheddarcheese; 05-16-2019 at 02:29 PM.
Can't believe this should be so difficult. What do I have to do to get it working?
Do you see all the 'el7' error messages? This indicates you are trying to install CentOS 7 packages on your CentOS 6 system. Disable the repos that are causing the errors (remi-php56 and remi-safe) and try again.
I just don't get it at all. I've done all the stuff I think I'm meant to have done, but still doesn't work.
So, /etc/repos.d/ has this in it:
Code:
# ls -l
total 64
-rw-r--r--. 1 root root 2049 Jan 6 2017 CentOS-Base.repo
-rw-r--r-- 1 root root 647 Jun 26 2018 CentOS-Debuginfo.repo
-rw-r--r-- 1 root root 289 Jun 26 2018 CentOS-fasttrack.repo
-rw-r--r-- 1 root root 630 Jun 26 2018 CentOS-Media.repo
-rw-r--r-- 1 root root 8854 Jun 26 2018 CentOS-Vault.repo
-rw-r--r-- 1 root root 951 Oct 2 2017 epel.repo
-rw-r--r-- 1 root root 1050 Oct 2 2017 epel-testing.repo
-rw-r--r--. 1 root root 282 Jan 6 2017 OpenLogic.repo
-rw-r--r-- 1 root root 446 Mar 8 07:34 remi-glpi91.repo
-rw-r--r-- 1 root root 446 Mar 8 07:34 remi-glpi92.repo
-rw-r--r-- 1 root root 446 Mar 8 07:34 remi-glpi93.repo
-rw-r--r-- 1 root root 446 Mar 8 07:34 remi-glpi94.repo
-rw-r--r-- 1 root root 855 Mar 8 07:34 remi-modular.repo
-rw-r--r-- 1 root root 2605 May 16 19:15 remi.repo
Yum says this:
Code:
# yum repolist
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* epel: mirror.layeronline.com
* remi-php56: mirror.team-cymru.com
repo id repo name status
base CentOS-6 - Base 6,713
epel Extra Packages for Enterprise Linux 7 - x86_64 13,190
extras CentOS-6 - Extras 46
openlogic CentOS-6 - openlogic packages for x86_64 112
remi-php56 Remi's PHP 5.6 RPM repository for Enterprise Linux 7 - x86_64 439
updates CentOS-6 - Updates 463
repolist: 20,963
Tried disabling the remi-php56 repo, as suggested, but that didn't seem to work, and I'm not sure why I'd want to do that anyway, seeing as that's the version of PHP that I'm trying to update to.
Code:
# yum --disablerepo=remi-php56
Loaded plugins: fastestmirror, security
You need to give some command
Aside, why should I be disabling the repo' for PHP 5.6 when that's what I want to be upgrading to? Also, just curious, why would remi-php56 show up in repolist, but not be in /etc/repos.d/?
Last edited by cheddarcheese; 05-16-2019 at 02:59 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.