How do I install chkconfig on Ubuntu?

前端 未结 7 1624
孤城傲影
孤城傲影 2021-01-30 09:22

I am running Ubuntu 13.10, and I\'m pretty new to Linux. I tried:

$ sudo apt-get install chkconfig

Package chkconfig is not ava

相关标签:
7条回答
  • 2021-01-30 09:26

    The command chkconfig is no longer available in Ubuntu.The equivalent command to chkconfig is update-rc.d.This command nearly supports all the new versions of ubuntu.

    The similar commands are

    update-rc.d <service> defaults
    
    update-rc.d <service> start 20 3 4 5
    
    update-rc.d -f <service>  remove
    
    0 讨论(0)
  • 2021-01-30 09:27

    Install this package in Ubuntu:

    apt install sysv-rc-conf
    

    its a substitute for chkconfig cmd.

    After install run this cmd:

    sysv-rc-conf --list
    

    It'll show all services in all the runlevels. You can also run this:

    sysv-rc-conf --level (runlevel number ex:1 2 3 4 5 6 )
    

    Now you can choose which service should be active in boot time.

    0 讨论(0)
  • 2021-01-30 09:34

    Chkconfig is no longer available in Ubuntu.

    Chkconfig is a script. You can download it from here.

    0 讨论(0)
  • 2021-01-30 09:39

    But how do I run this? I tried typing: sudo chkconfig.install which doesn't work.

    I'm not sure where you got this package or what it contains; A url of download would be helpful. Without being able to look at the contents of chkconfig.install; I'm surprised to find a unix tool like chkconfig to be bundled in a zip archive, maybe it is still yet to be uncompressed, a tar.gz? but maybe it is a shell script?

    I should suggest editing it and seeing what you are executing.

    sh chkconfig.install or ./chkconfig.install ; which might work....but my suggestion would be to learn to use update-rc.d as the other answers have suggested but do not speak directly to the question...which is pretty hard to answer without being able to look at the data yourself.

    0 讨论(0)
  • 2021-01-30 09:48

    In Ubuntu /etc/init.d has been replaced by /usr/lib/systemd. Scripts can still be started and stoped by 'service'. But the primary command is now 'systemctl'. The chkconfig command was left behind, and now you do this with systemctl.

    So instead of:

    chkconfig enable apache2
    

    You should look for the service name, and then enable it

    systemctl status apache2
    systemctl enable apache2.service
    

    Systemd has become more friendly about figuring out if you have a systemd script, or an /etc/init.d script, and doing the right thing.

    0 讨论(0)
  • 2021-01-30 09:50

    sysv-rc-conf is an alternate option for Ubuntu.

    sudo apt-get install sysv-rc-conf
    
    sysv-rc-conf --list xxxx
    
    0 讨论(0)
提交回复
热议问题