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

本文涉及的产品
实时计算 Flink 版,5000CU*H 3个月
检索分析服务 Elasticsearch 版,2核4GB开发者规格 1个月
大数据开发治理平台 DataWorks,不限时长
简介: 系统未使用 `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
相关文章
|
4天前
|
Ubuntu
蓝易云 - Ubuntu20.04安装软件报错:The following packages have unmet dependencies
如果以上步骤都不能解决问题,可能需要手动查找并安装缺失的依赖软件包。你可以通过运行 `sudo apt-cache search <package-name>`来搜索软件包,然后使用 `sudo apt install <package-name>`进行安装。
11 2
|
12天前
|
Ubuntu PHP
ubuntu php libzip安装 ./configure报错 checking for libzip... not found configure
ubuntu php libzip安装 ./configure报错 checking for libzip... not found configure
|
14天前
|
Linux Ubuntu
蓝易云 - Linux学习之Ubuntu20使用systemd管理OpenResty服务
这就是在Ubuntu 20使用systemd管理OpenResty服务的基本方法。
36 3
|
27天前
|
Ubuntu
Ubuntu20.04安装软件报错:The following packages have unmet dependencies - 蓝易云
请注意,替换上述命令中的 `<package-name>`为你实际要安装的软件包名。
99 0
|
12天前
|
Ubuntu 编译器 Windows
ubuntu 18.04安装ftp为wordpress添加ftp
ubuntu 18.04安装ftp为wordpress添加ftp
|
2天前
|
存储 Ubuntu JavaScript
ubuntu安装npm环境
ubuntu安装npm环境
6 0
|
5天前
|
Ubuntu Java
蓝易云 - ubuntu22安装和部署Kettle8.2
现在你应该可以看到Kettle的图形界面了。这就完成了Ubuntu 22上Kettle 8.2的安装和部署。
8 1
|
6天前
|
Ubuntu 编译器 C语言
蓝易云 - ubuntu上安装boost库为SOMEIP的X86和ARM下编译做准备(编译两种版本)
以上就是在Ubuntu上安装Boost库并为SOME/IP的X86和ARM架构编译做准备的全部步骤。
17 0
|
10天前
|
Java 开发工具
Ubuntu18.04 安装jdk1.8
Ubuntu18.04 安装jdk1.8
|
11天前
|
Ubuntu Java Linux
Ubuntu20.04下载jdk遇到各种奇怪问题大集,Linux如何将默认的OpenJDK切换成自己安装的JDK版本(以JDK1.8为例),无需卸载原有OpenJDK,Some packages co
Ubuntu20.04下载jdk遇到各种奇怪问题大集,Linux如何将默认的OpenJDK切换成自己安装的JDK版本(以JDK1.8为例),无需卸载原有OpenJDK,Some packages co

热门文章

最新文章