Ubuntu 安装redis失败:Failed to restart redis-server.service: Unit redis-server.service not found

  • 安装Redis的日志:
	Ign:2 https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 InRelease                                                                                                   
	Hit:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy InRelease                                                                                                                                           
	Hit:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates InRelease                                                                                                                                   
	Hit:4 http://repo.mysql.com/apt/ubuntu jammy InRelease                                                                                                                                                     
	Hit:5 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-backports InRelease                                                                                                                                 
	Hit:6 http://security.ubuntu.com/ubuntu jammy-security InRelease                                                                                                                                           
	Hit:7 https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 Release                                                                                                       
	Hit:9 https://packages.clickhouse.com/deb stable InRelease                                                                                              
	Hit:10 https://ppa.launchpadcontent.net/openjdk-r/ppa/ubuntu jammy InRelease         
	Reading package lists... Done
	W: http://repo.mysql.com/apt/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
	W: https://packages.clickhouse.com/deb/dists/stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
	Reading package lists... Done
	Building dependency tree... Done
	Reading state information... Done
	You might want to run 'apt --fix-broken install' to correct these.
	The following packages have unmet dependencies:
	 libmysqlclient23 : Depends: mysql-common (>= 8.3.0-1ubuntu22.04) but 5.8+1.0.8 is to be installed
	 mysql-client : Depends: mysql-community-client (= 8.3.0-1ubuntu22.04) but it is not installable
	 mysql-community-server-debug : Depends: mysql-community-server (= 8.3.0-1ubuntu22.04) but it is not installable
	 mysql-community-test-debug : Depends: mysql-community-test but it is not installable
	 mysql-server : Depends: mysql-community-server (= 8.3.0-1ubuntu22.04) but it is not installable
	 mysql-testsuite : Depends: mysql-community-test (= 8.3.0-1ubuntu22.04) but it is not installable
	 redis : Depends: redis-server (< 5:6.0.16-1ubuntu1.1~) but it is not going to be installed
	         Depends: redis-server (>= 5:6.0.16-1ubuntu1) but it is not going to be installed
	E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
	Failed to start redis-server.service: Unit redis-server.service not found.
	sed: can't read /etc/redis/redis.conf: No such file or directory
	sed: can't read /etc/redis/redis.conf: No such file or directory
	Failed to restart redis-server.service: Unit redis-server.service not found
  • 原因分析:
    在这里插入图片描述

  • 解决方法:
    修复系统中的破损依赖关系,运行命令

sudo apt --fix-broken install -y

再次安装就不报错了

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值