1 2 Previous Next 16 Replies Latest reply on Mar 25, 2020 10:40 AM by Michael8773

    OL7 yum update

    Michael8773

      Hello,

       

      1. Is there a command option to test yum to see if it can connect to all the sources it needs (I want to perform a yum update -y)?
      2. How can you determine and update an OL 7.x system to ensure it has all the latest repos and related URLs (for use with yum update)?

       

      Thank you,

       

      Michael

        • 1. Re: OL7 yum update
          Michael8773

          I think I have it down to this:

          [root yum.repos.d]# yum list *release-el7*

           

          Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager

          Error: No matching Packages to list

           

          Given the above status for my OL 7 OS, what do I need to do to be able to accurately run: yum update?

           

           

          Thank you,

           

          Michael

          • 2. Re: OL7 yum update
            Avi Miller-Oracle

            1. "yum repolist" will list all the repos to which this machine is currently subscribed.

            2. "yum search release-el7" will list all the release RPMs this machine can see.

             

            Let's start with those. You appear to have "search-disabled-repos" and 'subscription-manager" installed though which implies this was/is a RHEL7 server, not an OL7 box. You'll probably need to remove those along with other Red Hat packages so as to avoid conflicts with the ones from Oracle.

            1 person found this helpful
            • 3. Re: OL7 yum update
              Avi Miller-Oracle

              What's the output of "rpm -qa | grep yum-plugin" and "rpm -qa | grep release" on that machine?

              1 person found this helpful
              • 4. Re: OL7 yum update
                Michael8773

                Avi,

                 

                Thanks for your help.  Below is the output from the commands:

                [oracle@lnx01 scripts]$ yum repolist

                Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager

                repo id                                            repo name                                                                                          status

                epel/x86_64                                        Extra Packages for Enterprise Linux 7 - x86_64                                                     13,217

                ol6_UEK_latest/x86_64                              Latest Unbreakable Enterprise Kernel for Oracle Linux 7Server (x86_64)                                946

                ol6_latest/x86_64                                  Oracle Linux 7Server Latest (x86_64)                                                               12,465

                ol7_UEKR5/x86_64                                   Latest Unbreakable Enterprise Kernel Release 5 for Oracle Linux 7Server (x86_64)                      263

                ol7_latest/x86_64                                  Oracle Linux 7Server Latest (x86_64)                                                               16,633

                rhel-7-server-rpms/7Server/x86_64                  Red Hat Enterprise Linux 7 Server (RPMs)                                                           27,215

                repolist: 70,739

                 

                 

                [oracle@lnx01 scripts]$ yum search release-el7 > /tmp/release-el7.txt

                [oracle@lnx01 scripts]$ cat /tmp/release-el7.txt

                 

                Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-

                              : manager

                =========================== N/S matched: release-el7 ===========================

                mysql-release-el7.x86_64 : MySQL yum repository configuration

                oracle-ceph-release-el7.x86_64 : Ceph Storage yum repository configuration

                oracle-epel-release-el7.x86_64 : Extra Packages for Enterprise Linux (EPEL) yum

                                               : repository configuration

                oracle-gluster-release-el7.x86_64 : Gluster yum repository configuration

                oracle-golang-release-el7.x86_64 : Go Language  yum repository configuration

                oracle-nodejs-release-el7.x86_64 : Node.js yum repository configuration

                oracle-olcne-release-el7.x86_64 : Oracle Linux Cloud Native Environment yum

                                                : repository configuration

                oracle-openstack-release-el7.x86_64 : Oracle OpenStack for Oracle Linux yum

                                                    : repository configuration

                oracle-php-release-el7.x86_64 : PHP yum repository configuration

                oracle-release-el7.x86_64 : Oracle Software yum repository configuration

                oracle-softwarecollection-release-el7.x86_64 : Software Collection Library yum

                                                             : repository configuration

                oracle-spacewalk-client-release-el7.x86_64 : Spacewalk Client yum repository

                                                           : configuration

                oracle-spacewalk-server-release-el7.x86_64 : Spacewalk Server yum repository

                                                           : configuration

                oraclelinux-developer-release-el7.x86_64 : Oracle Linux Developer yum repository

                                                         : configuration

                oraclelinux-release-el7.x86_64 : Oracle Linux yum repository configuration

                 

                  Name and summary matches only, use "search all" for everything.

                 

                 

                [root@lnx01 ~]# rpm -qa | grep yum-plugin" and "rpm -qa | grep release

                [root@lnx01 ~]#

                 

                ^^^^^^^^^ There was no output for this commend.  ^^^^^^^^^

                 

                 

                What can you recommend?

                 

                Thank you,

                 

                Michael

                • 5. Re: OL7 yum update
                  Avi Miller-Oracle

                  Michael8773 wrote:

                   

                  What can you recommend?

                   

                  You need to split the two commands I sent, i.e. "rpm -qa | grep yum-plugin" is the first command and "rpm -qa | grep release" is the second command. You have enabled OL6 repos on an OL7 machine, so this is badly configured.

                  1 person found this helpful
                  • 6. Re: OL7 yum update
                    Dude!

                    How did you end up with such mess, and how is the following possible:

                    ol6_UEK_latest/x86_64    Latest Unbreakable Enterprise Kernel for Oracle Linux 7Server

                     

                    As rule of thumb, never mix/configure software repositories from different OS release versions that do not match your installed OS release version. So it's either OL 6 or OL 7.

                     

                    I suggest you do the following as user root to clean the system:

                     

                    cd /etc/yum.repos.d

                    yum clean all

                    rm -rf /var/cache/yum

                    gzip *

                     

                    Then follow the instructions outlined in the following URL. You can skip to the part where it outlines:

                    "To install software from Oracle Linux yum server on Red Hat Enterpise Linux, CentOS..."

                     

                     

                    I can make this a bit easier for you, just copy the following into your terminal window:

                     

                    cat >/etc/yum.repos.d/ol7-temp.repo <<'EOF'

                    [ol7_latest]

                    name=Oracle Linux $releasever Latest ($basearch)

                    baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/latest/$basearch/

                    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

                    gpgcheck=1

                    enabled=1

                    EOF

                    #

                     

                    The above will take a while as it's downloading/rebuilding your local yum database. Then install the repositories you need, but don't setup repositories you don't need, as this would extend the time it takes to install software for no good reason. For example:

                     

                    yum install oraclelinux-release-el7

                    yum install oracle-epel-release-el7

                     

                    Then remove the temporary repo you created and the old junk:

                     

                    cd /etc/yum.repos.d

                    rm -f ol7-temp.repo *.gz

                    ls

                    oracle-epel-ol7.repo  oracle-linux-ol7.repo  uek-ol7.repo  virt-ol7.repo

                     

                    Done.

                    • 7. Re: OL7 yum update
                      Dude!

                      Regarding your initial question.... There is no "dry-run" for yum. However, you don't have to specify "-y" to automatically answer "yes" to yum prompts. Hence you can check the output of yum first, to see if there are any issues. However, if I remember correctly, yum will throw an error if there are problems and automatically abort prior to installing anything. Therefore giving you an option to correct any issues.

                       

                      Also, as a general rule, if a system really matters, make a backup before applying any patches or installing software, but that's a different thread. Keep in mind that there can always go something wrong while installing, e.g. system crashing, disk failure, someone cutting off the network cable, etc.

                      1 person found this helpful
                      • 8. Re: OL7 yum update
                        Michael8773

                        Avi,

                         

                        Thank you for clarifying that.  The second command did have some output (below):

                        [root@mlbltdnasolov01 ~]# rpm -qa | grep yum-plugin

                        <<<There was no output>>>

                         

                        [root@mlbltdnasolov01 ~]# rpm -qa | grep release

                        redhat-release-server-7.7-10.el7.x86_64

                        epel-release-7-12.noarch

                        flash-plugin-24.0.0.186-release.x86_64

                        [root@mlbltdnasolov01 ~]#

                        Please let me know your advice based on the output.

                         

                        Thank you,

                         

                        Michael

                        1 person found this helpful
                        • 9. Re: OL7 yum update
                          Michael8773

                          Thank you all for the other responses.  This has only ever been an OL7 system.  Never a OL6 version system.  Somehow in trying to ensure yum could get to all the files it needed I must have enabled grabbing the older files.  I went ahead and did Dude's two suggestions below:

                           

                          cat >/etc/yum.repos.d/ol7-temp.repo <<'EOF'

                          [ol7_latest]

                          name=Oracle Linux $releasever Latest ($basearch)

                          baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/latest/$basearch/

                          gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

                          gpgcheck=1

                          enabled=1

                          EOF

                          #

                           

                          cd /etc/yum.repos.d

                          yum clean all

                          rm -rf /var/cache/yum

                          gzip *

                           

                          I am unclear though exactly what needs to be done next.  Plus I want to see what Avi suggests after seeing the output.  I just want to get the Linux system back to where I can do routine patches again.  Can I simply issue a yum update at this point or are their some other essential configs you would recommend?  Sorry I am new to this.

                           

                          Thanks again for you help,

                           

                          Michael

                          • 10. Re: OL7 yum update
                            Dude!

                            Just follow the documentation. Next would be to add the GPG key (RHEL 7)

                             

                            http://yum.oracle.com/faq.html#a10

                             

                            Then install oraclelinux-release-el7 as mentioned.

                            1 person found this helpful
                            • 11. Re: OL7 yum update
                              Michael8773

                              Dude,

                               

                              I performed the following:

                              # wget https://yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

                              # gpg --quiet --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

                               

                                    pub  2048R/EC551F03 2010-07-01 Oracle OSS group (Open Source Software group) <build@oss.oracle.com>

                                    Key fingerprint = 4214 4123 FECF C55B 9086  313D 72F9 7B74 EC55 1F03

                                   

                              yum install oraclelinux-release-el7

                              Is this ok [y/N]: y

                              Running transaction check

                              Running transaction test

                              Transaction test succeeded

                              Running transaction

                              Warning: RPMDB altered outside of yum.

                                Installing : oraclelinux-release-el7-1.0-8.el7.x86_64

                                Verifying  : oraclelinux-release-el7-1.0-8.el7.x86_64

                              rhel-7-server-rpms/7Server/x86_64/productid

                               

                              Installed:

                                oraclelinux-release-el7.x86_64 0:1.0-8.el7

                               

                              Complete!

                               

                              yum install oracle-epel-release-el7

                              Total download size: 14 k

                              Installed size: 18 k

                              Is this ok [y/d/N]: y

                              Is this ok [y/d/N]: y

                              Downloading packages:

                              oracle-epel-release-el7-1.0-2.el7.x86_64.rpm

                              Running transaction test

                              Transaction test succeeded

                              Running transaction

                                Installing : oracle-epel-release-el7-1.0-2.el7.x86_64

                                Verifying  : oracle-epel-release-el7-1.0-2.el7.x86_64

                               

                              Installed:

                                oracle-epel-release-el7.x86_64 0:1.0-2.el7

                               

                              Complete!

                               

                              Looks like I am all set to do (yum) updates as normal now.  Do you concur?

                               

                               

                              Thanks,

                               

                              Michael

                              • 12. Re: OL7 yum update
                                Dude!

                                Yes, nothing can stop you now.

                                • 13. Re: OL7 yum update
                                  Dude!

                                  Just seeing "Warning: RPMDB altered outside of yum...." You might get that message after using rpm directly. You can try "yum history new" or "yum history sync" to get rid of it, or don't worry about it.

                                  • 14. Re: OL7 yum update
                                    Michael8773

                                    Dude,

                                     

                                    I created a quick VM and tested everything you showed me and it worked great!

                                     

                                    I'll try it tonight on my target system.

                                     

                                    Thanks!

                                     

                                    Michael

                                    1 2 Previous Next