Clear all

No /etc/rc.local file on Ubuntu 18.04? Here's what to do...  


Joined: 6 years ago
Posts: 226
27/09/2018 12:17 pm  

The /etc/rc.local file on Ubuntu and Debian systems are used to execute commands at system startup. But there's no such file in Ubuntu 18.04.

So what can we do? We can just create the file. Let's do it. Create the /etc/rc.local file with nano text editor,

nano /etc/rc.local

Paste the following lot,

#!/bin/sh -e
# rc.local
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# bits.
# By default this script does nothing.

exit 0

That's the content of Ubuntu 16.04's stock /etc/rc.local file. Now make it executable,

chmod +x /etc/rc.local

That's it. You can now use this file to execute commands at system boot. Just paste your commands above the line that says exit 0

This topic was modified 2 years ago 4 times by Tharindu
This topic was modified 1 year ago 2 times by Tharindu
This topic was modified 9 months ago by Tharindu

Become a affiliate and earn up to 10% commissions from your referrals

Back to top button

We use cookies to give you the best online experience. By agreeing you accept the use of cookies in accordance with our cookie policy.