layout: post
title: “安装mysql以及换源”
date: 2024-1-2 15:39:08 +0800
tags: 树莓派
安装mysql以及换可以使用的源
出现的问题
之前按照网上的教程给树莓派换了一个源, 在下载sysql的时候出现问题
[2021-01-05]在树莓派 4B+ 里安装 MySQL数据库(实际安装的是 mariadb-server)_在樹梅派安裝mysql-CSDN博客
jiao@raspberrypi:# sudo apt-get install mariadb-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
mariadb-server : Depends: mariadb-server-10.4 (>= 1:10.4.7+maria~stretch) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
发现我的这个系统基于Debian12, 但是国内的源是给Debian11使用的
这导致我没办法下载
mariadb-server
解决
我看了一下树莓派的管理源的文件/etc/apt/sources.list, 发现它直接使用的是Debian的源
所以我找到Debian12的镜像源换了一下, 可以使用
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
# deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
debian | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
下载的程序没有问题
具体有没有其他问题我暂时没有发现