Ubuntu 20.04 systemctl 错误:System has not been booted with systemd as init system (PID 1). Can't operate.
发表于|更新于|编程文摘
|浏览量:
在 Ubuntu 20.04 系统中,使用 systemctl 命令启动 logstash,出现以下错误:
1 | $ systemctl start logstash |
这是因为 systemctl 不是 Ubuntu 系统自带的命令,可以通过 apt 命令进行安装:
1 | sudo apt install systemctl |
安装过程中,会提示你输入 Yes, do as I say! 以继续安装。
(END)
文章作者: Johnson Lin
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Johnson Lin!
相关推荐
2023-04-26
Ubuntu 20.04 apt upgrade Error: Could not read response to hello message from hook
当我运行 sudo apt upgrade 命令以更新 Ubuntu 子系统(WSL)中的软件包时,出现了以下错误: 123456789101112131415161718$ sudo apt upgradeReading package lists... DoneBuilding dependency treeReading state information... DoneCalculating upgrade... DoneThe following packages were automatically installed and are no longer required: ant ant-optional gdisk gir1.2-packagekitglib-1.0 jruby-openssl junit4 libappstream4 libasm-java libatasmart4 libbcpkix-java libbcprov-java libblockdev-crypto2 libblockdev-fs2 libblockdev-loop2 libbl...
2024-08-15
Understanding the "chattr: Inappropriate ioctl for device while reading flags" Error
If you’ve encountered the error message chattr: Inappropriate ioctl for device while reading flags on /etc/nginx/conf.d/test.conf, you’re not alone. This error can be confusing, especially if you’re not familiar with the chattr command and its uses. Let’s break down what this error means and how to resolve it. What is the chattr Command?The chattr (change attribute) command in Linux is used to change file attributes on files and directories. These attributes can control various aspects of fil...
2024-08-16
A Deep Dive into the apt Command: Linux Package Management Simplified
The apt command is a powerful tool used for managing packages on Debian-based Linux distributions such as Ubuntu. It simplifies the process of installing, updating, and removing software packages. Whether you’re a beginner or an experienced user, mastering the apt command can greatly enhance your Linux experience. In this guide, we’ll explore some of the most commonly used apt commands with practical examples. Syntax1apt [options] [command] [package ...] Options: Optional settings, such as -...
2022-06-27
【Linux常用命令】查看主机名
主机名(英语:hostname),也称计算机名,是指分配给计算机的一串唯一标识码,用于在网络上唯一识别该计算机。通常由字母、数字组成,也可以包含一些特殊字符,如英文连字符(-)、英文句点(.)和下划线(_)。典型的主机名最多包含 253 个字符。 在大多数 Linux 发行版中,主机名通常存储在 /etc/hostname 文件中。默认情况下,通过 ssh 命令在终端成功连接到目标服务器时,也可以看到目标服务器的主机名。如以下命令可以看到目标服务器的主机名为 kafka-eagle。 123456$ ssh hadoop@10.10.18.8Last login: Fri May 13 20:50:56 2022 from 10.10.18.215Welcome to Alibaba Cloud Elastic Compute Service ![hadoop@kafka-eagle ~]$ 介绍完主机名的概念,接下来,我们一起了解在 Linux 操作系统中其他各种查找主机名的命令。 使用 hostname 命令hostname 命令用于显示 Linux 系统的 DNS 名称和主...

2024-06-05
Finding the Hostname in Linux: A Guide to Common Methods
Finding the hostname in Linux can be done in a few different ways, depending on your specific needs and the Linux distribution you’re using. Here are a few common methods: 1. Using the hostname CommandThe simplest way to find the hostname of your Linux system is to use the hostname command in your terminal. Simply open a terminal window and type:1hostnameThis command will display the hostname of your system.For example:12$ hostnamepresto-node-10 2. Using the uname CommandWhile the uname comma...
2023-03-22
Linux 常用命令 | head 详解
Linux 命令行工具提供了足够丰富的命令用于管理服务器上的文件和目录。其中最常用的命令之一是 head,它允许我们只查看文件的前几行内容,这在查看超大文件(文件大小为几个 GB 以上)时尤其有用。在这篇博文中,我们将详细讨论该命令的使用说明、注意事项、技巧窍门等,以充分利用该命令。 使用说明head 命令用于显示一个文件的前几行。要使用该命令,只需输入 head 和你想查看的文件名即可。例如,要查看一个名为 example.log 的文件的前10行,你可以输入以下命令: 1head -n 10 example.log 其中,-n 选项用于指定要查看的行数。如果不指定数字,它将默认为 10 行。还可以使用 - 号来表示除了文件最后多少行外输出所有行内容。例如,要查看文件的所有行,但不包括最后的 11 行,可以输入以下命令: 1head -n -11 example.log 注意事项在使用 head 命令时,有两个地方需要注意: 首先,注意不要使用 > 操作符意外覆盖原来的文件。例如,执行以下命令会导致 example.log 文件被其前 10 行的内容覆盖,相当于 exam...


