为什么无法使用 readline 库安装指定的 mariadb 版本?

为什么无法使用 readline 库安装指定的 mariadb 版本?

我的操作系统信息:

uname -a
Linux debian 5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30) x86_64 GNU/Linux

区域设置:

locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

我按照网页的介绍安装了mariadb。

安装 mariadb

sudo apt update && sudo apt upgrade
sudo apt-get install curl software-properties-common dirmngr -y
sudo curl -LsSO https://mariadb.org/mariadb_release_signing_key.asc
sudo chmod -c 644 mariadb_release_signing_key.asc
sudo mv -vi mariadb_release_signing_key.asc /etc/apt/trusted.gpg.d/
sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] https://mirror.realcompute.io/mariadb/repo/10.6/debian bullseye main'
sudo apt update
sudo apt install mariadb-server mariadb-client

现在您可以获得所需的版本,如下所示:

mariadb --version
mariadb  Ver 15.1 Distrib 10.6.4-MariaDB, for debian-linux-gnu (x86_64) using readline EditLine wrapper

在我的操作系统中,我得到的是以下信息:

mariadb --version
mariadb  Ver 15.1 Distrib 10.5.12-MariaDB, for debian-linux-gnu (x86_64) using  EditLine wrapper

问题#1:在我的 /etc/apt/sources.list 中,它是:

deb [arch=ppc64el,arm64,amd64] https://mirror.realcompute.io/mariadb/repo/10.6/debian bullseye main
deb-src [arch=ppc64el,arm64,amd64] https://mirror.realcompute.io/mariadb/repo/10.6/debian bullseye main

我已经指定了版本——10.6为什么sources.list是安装的版本10.5

问题#2:我已经libreadline-dev在操作系统中安装了:

sudo  dpkg -l | grep  readline
ii  libreadline-dev:amd64                  8.1-1                           amd64        GNU readline and history libraries, development files
ii  libreadline8:amd64                     8.1-1                           amd64        GNU readline and history libraries, run-time libraries
ii  readline-common                        8.1-1                           all          GNU readline and history libraries, common files

为什么for debian-linux-gnu (x86_64) using EditLine wrapper我安装后在操作系统中而不是for debian-linux-gnu (x86_64) using readline EditLine wrapper网页中描述的那样?

cat  /etc/apt/sources.list
deb http://mirrors.163.com/debian/ bullseye main non-free contrib
deb http://mirrors.163.com/debian/ bullseye-updates main non-free contrib
deb http://mirrors.163.com/debian/ bullseye-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ bullseye main non-free contrib
deb-src http://mirrors.163.com/debian/ bullseye-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ bullseye-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ bullseye/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ bullseye/updates main non-free contrib
deb http://httpredir.debian.org/debian/ bullseye main contrib non-free

deb http://deb.debian.org/debian bullseye-backports main
deb [arch=amd64] https://download.docker.com/linux/debian bullseye stable
deb [arch=ppc64el,arm64,amd64] https://mirror.realcompute.io/mariadb/repo/10.6/debian bullseye main
deb-src [arch=ppc64el,arm64,amd64] https://mirror.realcompute.io/mariadb/repo/10.6/debian bullseye main

使用sources.list更新:

sudo apt update && sudo apt list --upgradable
Hit:1 http://mirrors.163.com/debian bullseye InRelease
Hit:2 http://repo.mysql.com/apt/debian buster InRelease                                                                                                                     
Get:3 http://mirrors.163.com/debian bullseye-updates InRelease [39.4 kB]                                                                                                    
Hit:4 http://dl.google.com/linux/chrome/deb stable InRelease                                                                                                                
Get:5 http://mirrors.163.com/debian bullseye-backports InRelease [43.7 kB]                                                                                                  
Get:6 http://deb.debian.org/debian bullseye-backports InRelease [43.7 kB]                                                                                                   
Hit:7 http://httpredir.debian.org/debian bullseye InRelease                                                                                                                 
Ign:8 http://mirrors.163.com/debian-security bullseye/updates InRelease                                                                                                     
Err:9 http://mirrors.163.com/debian-security bullseye/updates Release                                                
  404  Not Found [IP: 112.90.131.246 80]
Hit:11 https://download.docker.com/linux/debian bullseye InRelease                                                   
Hit:10 https://cli-assets.heroku.com/apt ./ InRelease                                          
Get:12 http://mirrors.163.com/debian bullseye-backports/main Sources.diff/Index [63.3 kB]
Get:13 http://deb.debian.org/debian bullseye-backports/main amd64 Packages.diff/Index [63.3 kB]
Get:14 http://mirrors.163.com/debian bullseye-backports/main amd64 Packages.diff/Index [63.3 kB]
Get:15 http://ppa.launchpad.net/boltgolt/howdy/ubuntu impish InRelease [18.0 kB]       
Get:16 http://mirrors.163.com/debian bullseye-backports/main Sources T-2021-11-13-1401.28-F-2021-11-13-0801.26.pdiff [623 B]
Get:17 http://deb.debian.org/debian bullseye-backports/main Translation-en.diff/Index [25.2 kB]
Get:16 http://mirrors.163.com/debian bullseye-backports/main Sources T-2021-11-13-1401.28-F-2021-11-13-0801.26.pdiff [623 B]
Get:18 http://mirrors.163.com/debian bullseye-backports/main amd64 Packages T-2021-11-13-1401.28-F-2021-11-13-1401.28.pdiff [191 B]
Get:18 http://mirrors.163.com/debian bullseye-backports/main amd64 Packages T-2021-11-13-1401.28-F-2021-11-13-1401.28.pdiff [191 B]
Err:15 http://ppa.launchpad.net/boltgolt/howdy/ubuntu impish InRelease            
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8CEBC97F3E9E1D58
Get:19 http://deb.debian.org/debian bullseye-backports/main amd64 Packages T-2021-11-13-2001.35-F-2021-11-13-1401.28.pdiff [14.5 kB]
Get:19 http://deb.debian.org/debian bullseye-backports/main amd64 Packages T-2021-11-13-2001.35-F-2021-11-13-1401.28.pdiff [14.5 kB]
Get:20 http://deb.debian.org/debian bullseye-backports/main Translation-en T-2021-11-13-2001.35-F-2021-11-13-2001.35.pdiff [9,997 B]
Get:20 http://deb.debian.org/debian bullseye-backports/main Translation-en T-2021-11-13-2001.35-F-2021-11-13-2001.35.pdiff [9,997 B]
Err:21 https://mirror.realcompute.io/mariadb/repo/10.6/debian bullseye InRelease                                                                                            
  Connection failed [IP: 114.141.111.226 443]
Reading package lists... Done                                                                                                                                               
E: The repository 'http://mirrors.163.com/debian-security bullseye/updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://ppa.launchpad.net/boltgolt/howdy/ubuntu impish InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8CEBC97F3E9E1D58
E: The repository 'http://ppa.launchpad.net/boltgolt/howdy/ubuntu impish InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

答案1

升级 MariaDB

好的,看来您的条目中存在一些/etc/apt/sources.list需要解决的问题(有关更多信息,请参阅下面的部分),尽管据我所知这些与您的 MariaDB 问题无关。 MariaDB 10.6 存储库的条目似乎工作正常。

根据您给我的信息,我最好的猜测是 MariaDB 的版本由于已经安装而被保留在 10.5.12更新的 MariaDB 存储库已添加到您的sources.list.我的猜测是跑步sudo apt upgrade看起来像这样:

$ sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  mariadb-server
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

apt不会自动将 MariaDB 升级到 10.6,因为这样做需要删除一些特定于 10.5 的依赖包。解决这个问题应该像明确指定要升级的软件包mariadb-server一样简单。mariadb-client只需运行sudo apt upgrade mariadb-server mariadb-client,提示符应如下所示:

$ sudo apt upgrade mariadb-server mariadb-client
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
  libconfig-inifiles-perl
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
  mariadb-client-10.5 mariadb-client-core-10.5 mariadb-server-10.5 mariadb-server-core-10.5
The following NEW packages will be installed:
  libdaxctl1 libndctl6 libpmem1 liburing1 mariadb-client mariadb-client-10.6 mariadb-client-core-10.6 mariadb-server-10.6 mariadb-server-core-10.6
The following packages will be upgraded:
  mariadb-server
1 upgraded, 9 newly installed, 4 to remove and 0 not upgraded.
Need to get 13.7 MB of archives.
After this operation, 5,323 kB of additional disk space will be used.
Do you want to continue? [Y/n] 

如果是这样,只需输入y继续,然后验证 MariaDB 版本 10.6 是否已安装mariadb --version

$ mariadb --version
mariadb  Ver 15.1 Distrib 10.6.5-MariaDB, for debian-linux-gnu (x86_64) using readline EditLine wrapper

作为关于您问题中的问题 #2 的附注,版本 10.5mariadb --version输出应该using EditLine wrapper而不读using readline Editline wrapper。这种特殊的怪癖是完全正常的,与 的存在无关libreadline-dev


旁注:Debian 安全镜像

正如我之前所说,您有一些问题sources.list需要解决。这超出了您的 MariaDB 问题的范围,但我将在这里切题以解决这些问题中最重要的问题,因为这是与安全相关的。

这两个debian-security源使用 Debian 10 (Buster) 及更早版本的旧格式,该格式在升级到 Debian 11 (Bullseye) 期间发生了更改。您可以看到他们在 的输出中创建了错误sudo apt update

deb http://mirrors.163.com/debian-security/ bullseye/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ bullseye/updates main non-free contrib

这些行应该被删除并替换为新格式。Debian 的安全团队不鼓励使用镜像作为安全仓库,所以这是官方镜像。

deb http://security.debian.org/debian-security bullseye-security main contrib non-free
deb-src http://security.debian.org/debian-security bullseye-security main contrib non-free

还有一些来自内部源文件的其他错误/etc/apt/sources.list.d/,但修复这些错误超出了本问题的范围。sudo apt update如果您想自行修复这些错误,请查看输出中的错误。

相关内容