[MDEV-25991] problems with mariadb_repos_setup requiring apt-transport-https Created: 2021-06-22  Updated: 2021-07-19  Resolved: 2021-06-30

Status: Closed
Project: MariaDB Server
Component/s: N/A
Affects Version/s: None
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Hartmut Holzgraefe Assignee: Daniel Bartholomew
Resolution: Fixed Votes: 0
Labels: None


 Description   

Starting with apt 1.5, apt-transport-https is deprecated:

apt (1.5~beta1) unstable; urgency=medium
 
  [ New HTTPS method ]
  The default http method now supports HTTPS itself, including encrypted proxies
  and connecting to HTTPS sites via HTTPS proxies; and the apt-transport-https
  package only provides a "curl+https" method now as a fallback, but will be
  removed shortly. [...]

In all Ubuntu LTS versions from 18.04 and above, and in Debian 10, the apt-transport-https package is just a dummy, installing some documentation files in /usr/share/doc/apt-transport-https/ only, and not installed by default.

Still, mariadb_repo_setup checks for this package on all Debian and Ubuntu versions, and complains when not finding it:

[error] The following package is needed by the script, but not installed:
            apt-transport-https
        Please install and rerun the script.
        To disable this check add the `--skip-check-installed` flag

While --skip-checked-installed allows to work around it, I don't think that it is a good thing to fail on recent Ubuntu and Debian installations by default unless either the skip action is used or the dummy package installed.

Add to this that on Ubuntu trying to install the package can actually fail in interesting way. E.g. on a fresh Vagrant instance, set up from the official ubuntu/bionic64 or ubuntu/focal64 base boxes I'm getting this:

# apt-get install -y apt-transport-https
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'apt' instead of 'apt-transport-https'
apt is already the newest version (1.6.13).
apt set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Only after running apt-get update at least once I can actually install that deprecated package:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  apt-transport-https
0 upgraded, 1 newly installed, 0 to remove and 12 not upgraded.
Need to get 1,692 B of archives.
After this operation, 154 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 apt-transport-https all 1.6.13 [1,692 B]
Fetched 1,692 B in 0s (18.6 kB/s)               
Selecting previously unselected package apt-transport-https.
(Reading database ... 60026 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_1.6.13_all.deb ...
Unpacking apt-transport-https (1.6.13) ...
Setting up apt-transport-https (1.6.13) ...



 Comments   
Comment by Hartmut Holzgraefe [ 2021-06-22 ]

Suggested fix: the "perfect" fix would check whether apt version is >=1.5, but as there is no easy shell command for comparing version numbers, and knowing that of the still supported apt platforms only Debian 9 "Stretch" still has an apt version older than that, I suggest changing the check for this package from checking for Debian or Ubuntu os type to just Debian Stretch OS version:

--- old/mariadb_repo_setup	2021-06-14 14:42:44.000000000 +0200
+++ new/mariadb_repo_setup	2021-06-22 16:48:49.931057564 +0200
@@ -515,8 +515,8 @@
   msg info "Skipping check for script prerequisites."
 else
   msg info "Checking for script prerequisites."
-case $os_type in
-  debian|ubuntu) check_installed curl ca-certificates apt-transport-https ;;
+case $os_version in
+  stretch) check_installed curl ca-certificates apt-transport-https ;;
   *) check_installed curl ca-certificates ;;
 esac
 fi

Comment by Daniel Bartholomew [ 2021-06-30 ]

Pushed out an update to mariadb_repo_setup and mariadb_es_repo_setup to remove the apt-transport-https check from all except Debian 9 Stretch.

Generated at Thu Feb 08 09:41:56 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.