Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-36272

setup_repository script for Debian platforms not working when following README instructions

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6.21, 11.4.5
    • 10.6, 11.4
    • None
    • All Debain and Ubuntu OS releases

    Description

      When trying to set up a local package repository on Ubuntu or Debian using the "all .deb packages" tarballs, and following the README instructions installation fails as the script to the bundled GPG signing key file is not correct. You can't run the script from outside the directory it is in as it tries to read the key file from the current directory.

      README says to do e.g.:

      tar -xf ~/mariadb-11.4.5-ubuntu-noble-amd64-debs.tar
      mariadb-11.4.5-ubuntu-noble-amd64-debs/setup_repository
      

      but it actually right now only works using

      tar -xf ~/mariadb-11.4.5-ubuntu-noble-amd64-debs.tar
      cw mariadb-11.4.5-ubuntu-noble-amd64-debs
      ./setup_repository
      

      The script determines what directory it is in and stores that in "$dir", then uses it for other paths, but not for the one to the key file.

      But also the /etc/apt/sources.list.d/mariadb.list file gets created before trying to register the key, so next time you try to run the setup_repository script it fails with

      [ERROR] File "/etc/apt/sources.list.d/mariadb.list" already exists. Rename it and re-run this script, or manually create a new .repo file.

      Proposed fixes:

      • try key registration before creating the list file
      • prefix the key file name with $dir/ so that it always looks for it in the correct directory, as determined earlier in the script
      • use the correct Debian .list file ending in error message instead of the yum stile .repo ending

      Combined proposed patch:

      --- old/setup_repository	2025-03-11 14:19:09.974459694 +0000
      +++ new/setup_repository	2025-03-11 14:19:09.387166200 +0000
      @@ -25,7 +25,11 @@
       fi
       
       if [[ -e $file ]] ; then
      -  err 'File "%s" already exists. Rename it and re-run this script, or manually create a new .repo file.' "$file"
      +  err 'File "%s" already exists. Rename it and re-run this script, or manually create a new .list file.' "$file"
      +fi
      +
      +if ! apt-key add "$dir"/MariaDB-C74CD1D8-public.asc;then
      +  err 'Could not import signing key.'
       fi
       
       if ! cat > "$file" <<EoF
      @@ -35,8 +39,4 @@
         err 'Could not create "%s". Please investigate and re-run this script.' "$file"
       fi
       
      -if ! apt-key add MariaDB-C74CD1D8-public.asc;then
      -  err 'Could not import signing key.'
      -fi
      -
       printf 'Repository file successfully created! Please install MariaDB Server with this command:\n\n   %s\n\n' "$install_cmd"
      

      Attachments

        Issue Links

          Activity

            There are no comments yet on this issue.

            People

              dbart Daniel Bartholomew
              hholzgra Hartmut Holzgraefe
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.