Ubuntu 报错:System has not been booted with systemd as init system (PID 1). Can‘t operate.

本文涉及的产品
智能开放搜索 OpenSearch行业算法版,1GB 20LCU 1个月
大数据开发治理平台 DataWorks,不限时长
检索分析服务 Elasticsearch 版,2核4GB开发者规格 1个月
简介: 系统未使用 `systemd` 初始化导致错误。解决方法是通过 `apt` 安装。首先备份并更换`sources.list`,添加阿里云镜像源,然后更新源并以管理员权限运行 `apt-get install systemd -y` 和 `apt-get install systemctl -y` 安装所需组件。

@[toc]

错误原因

该错误提示表明你的系统没有使用 systemd 作为初始化系统。

在 Linux 系统中,初始化系统是启动系统时第一个启动的进程,负责启动和管理系统中的各种服务。

我在使用其它组件中出现了这个问题,通过 apt 安装该指令后成功解决。

通过 apt 进行安装

更换下载源并进行更新:

# 备份旧的下载源
mv /etc/apt/sources.list /etc/apt/sources.list.old

# 创建新的下载源
vim /etc/apt/sources.list

添加新的下载源(亲测可用):

deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

添加完成后,保存并退出,更新下载源:

apt update

安装

非管理员用户在命令前添加 sudo 权限指令:

apt-get install systemd -y
apt-get install systemctl -y
相关文章
|
13天前
|
Ubuntu
蓝易云 - Ubuntu20.04安装软件报错:The following packages have unmet dependencies
如果以上步骤都不能解决问题,可能需要手动查找并安装缺失的依赖软件包。你可以通过运行 `sudo apt-cache search <package-name>`来搜索软件包,然后使用 `sudo apt install <package-name>`进行安装。
15 2
|
21天前
|
Ubuntu PHP
ubuntu php libzip安装 ./configure报错 checking for libzip... not found configure
ubuntu php libzip安装 ./configure报错 checking for libzip... not found configure
19 1
|
23天前
|
Linux Ubuntu
蓝易云 - Linux学习之Ubuntu20使用systemd管理OpenResty服务
这就是在Ubuntu 20使用systemd管理OpenResty服务的基本方法。
43 3
|
1月前
|
Ubuntu
Ubuntu20.04安装软件报错:The following packages have unmet dependencies - 蓝易云
请注意,替换上述命令中的 `<package-name>`为你实际要安装的软件包名。
140 0
|
Ubuntu Linux Unix
Ubuntu init启动流程分析
        现行的Linux distros主流的有两种init方式:一种是广为流传的System V initialization,它来源于Unix并且至今仍被各种Linux distros所采用;另一种是近几年提出的Upstart方式,基于事件机制,系统的所有服务,任务都是由事件驱动的。据我所知,采用后一种方式的目前有Ubuntu(6.10 and later),Fedora(
1326 0
|
21天前
|
Ubuntu 编译器 Windows
ubuntu 18.04安装ftp为wordpress添加ftp
ubuntu 18.04安装ftp为wordpress添加ftp
22 0
|
7天前
|
Ubuntu PHP Apache
蓝易云 - 如何在Ubuntu 22.04上安装PHP8.1并设置本地开发环境
以上就是在Ubuntu 22.04上安装PHP 8.1并设置本地开发环境的步骤。
14 2
|
8天前
|
缓存 Ubuntu 应用服务中间件
Ubuntu 22.04 上安装、配置和使用 Nginx 可以分为几个简单的步骤
Ubuntu 22.04 上安装、配置和使用 Nginx 可以分为几个简单的步骤
|
14天前
|
Ubuntu Java
蓝易云 - ubuntu22安装和部署Kettle8.2
现在你应该可以看到Kettle的图形界面了。这就完成了Ubuntu 22上Kettle 8.2的安装和部署。
15 1