如何在Ubuntu 14.04中使用systemctl [英] How to use systemctl in Ubuntu 14.04

查看:799
本文介绍了如何在Ubuntu 14.04中使用systemctl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在Ubuntu 14.04中执行以下命令:

I try to perform the following command in Ubuntu 14.04:

systemctl enable --now docker-cleanup-dangling-images.timer

我也用sudo尝试过,我尝试用service和systemd替换systemctl,但是没有用

I also tried it with sudo, I tried to replace systemctl with service and systemd but nothing works

sudo: systemd: command not found
systemd: command not found
sudo: service: command not foud

如何在Ubuntu 14.04中执行此命令,或者还有另一种方法可以执行同一命令?

How can I execute this command in Ubuntu 14.04 or is there another way to execute the same command?

推荐答案

我自己遇到了这个问题,发现Ubuntu 14.04使用Upstart而不是Systemd,因此systemctl命令将不起作用.此版本在15.04中已更改,因此解决此问题的一种方法是更新ubuntu安装.

I just encountered this problem myself and found that Ubuntu 14.04 uses Upstart instead of Systemd, so systemctl commands will not work. This changed in 15.04, so one way around this would be to update your ubuntu install.

如果这不是您的选择(现在不适合我),则需要找到可以执行所需操作的Upstart命令.

If this is not an option for you (it's not for me right now), you need to find the Upstart command that does what you need to do.

要启用,通用外观如下:

For enable, the generic looks to be the following:

update-rc.d <service> enable

与Ubuntu文档的链接: https://wiki.ubuntu.com/SystemdForUpstartUsers

Link to Ubuntu documentation: https://wiki.ubuntu.com/SystemdForUpstartUsers

这篇关于如何在Ubuntu 14.04中使用systemctl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆