LoginSignup
0
0

leapp preupgradeしたら使ってないPostgreSQLのリポジトリがないと怒られる件

Posted at

ELevating CentOS 7 to RockyLinux 8

ZABBIX5.0+PostgreSQL13環境のCentOS7からRocky8へのアップグレードを試行中。
AlmaLinuxのこの記事を参考に実施したところ

leapp preupgradeを実行すると、以下のように怒られる

============================================================
                           ERRORS                           
============================================================

2024-02-02 08:07:05.123618 [ERROR] Actor: dnf_transaction_check
Message: DNF execution failed with non zero exit code.
STDOUT:
Extra Packages for Enterprise Linux 8 - x86_64   12 MB/s |  16 MB     00:01    
PostgreSQL 11 for RHEL / Rocky 8 - x86_64        85  B/s | 146  B     00:01    

STDERR:
No matches found for the following disable plugin patterns: subscription-manager
Repository extras is listed more than once in the configuration
Errors during downloading metadata for repository 'el8-pgdg11':
  - Status code: 404 for https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-8-x86_64/repodata/repomd.xml (IP: 147.75.85.69)
Error: Failed to download metadata for repo 'el8-pgdg11': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

そもそもPostgreSQL11使ってないし、
このhttps://download.postgresql.org/pub/repos/yum/11/redhat/rhel-8-x86_64/repodata/repomd.xmlなんていうのは存在しないURLだし。。

どうやらleappが勝手に作ってるRepoファイルがある

/var/lib/leapp/el8userspace/etc/yum.repos.d/配下にもrepoファイルがあるんだけど、これをいくらイジってもleapp preupgradeすると再作成されて無駄。
/var/log/leapp/leapp-preupgrade.logを確認すると、どうやら雛形にしているファイル?があるらしく、そっちをイジるのが正解っぽい。
/etc/leapp/files/vendors.d/postgresql.repoel8-pgdg11をコメントアウト。

/etc/leapp/files/vendors.d/postgresql.repo
#[el8-pgdg11]
#name=PostgreSQL 11 for RHEL / Rocky 8 - $basearch
#baseurl=https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-8-$basearch
#enabled=1
#gpgcheck=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
#module_hotfixes=true

ついでにpostgresql_map.jsonも怪しいので編集しちゃう。
jsonなのでコメントアウト出来ないから、念のためバックアップを残しておくこと。

/etc/leapp/files/vendors.d/postgresql_map.json
--- /etc/leapp/files/vendors.d/postgresql_map.json.bk	2024-02-02 08:20:36.861027885 +0900
+++ /etc/leapp/files/vendors.d/postgresql_map.json	2024-02-02 08:21:21.083302873 +0900
@@ -43,14 +43,6 @@
                         "el8-pgdg-centos8-sysupdates",
                         "el8-pgdg-rhel8-extras"
                     ]
-                },
-                {
-                    "source": "pgdg11",
-                    "target": [
-                        "el8-pgdg11",
-                        "el8-pgdg-centos8-sysupdates",
-                        "el8-pgdg-rhel8-extras"
-                    ]
                 }
             ]
         }
@@ -117,18 +109,6 @@
             ]
         },
         {
-            "pesid": "pgdg11",
-            "entries": [
-                {
-                    "major_version": "7",
-                    "repoid": "pgdg11",
-                    "arch": "x86_64",
-                    "channel": "ga",
-                    "repo_type": "rpm"
-                }
-            ]
-        },
-        {
             "pesid": "el8-pgdg-common",
             "entries": [
                 {
@@ -189,18 +169,6 @@
             ]
         },
         {
-            "pesid": "el8-pgdg11",
-            "entries": [
-                {
-                    "major_version": "8",
-                    "repoid": "el8-pgdg11",
-                    "arch": "x86_64",
-                    "channel": "ga",
-                    "repo_type": "rpm"
-                }
-            ]
-        },
-        {
             "pesid": "el8-pgdg-centos8-sysupdates",
             "entries": [
                 {
@@ -229,4 +197,4 @@
         "1.1",
         "2.0"
     ]

これでleapp preupgradeしても怒られなくなった。
PostgreSQLに限らず、同じような事象で苦しむ人の助けになれば良いなと思ってメモ書き程度ですが、残しておくことにします。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0