I have mistakenly deleted all the environment variables from a file by running the following command and restarted my Ubuntu 16.04.
sudo gedit /etc/environment
Now, it is loading and showing black screen and doing nothing. How can fix this issue?
I have mistakenly deleted all the environment variables from a file by running the following command and restarted my Ubuntu 16.04.
sudo gedit /etc/environment
Now, it is loading and showing black screen and doing nothing. How can fix this issue?
Here is the contents of my stock /etc/environment file from an Ubuntu 16.04 installation. It is only one line setting your PATH variable. Without knowing where to look for commands, that could definitely halt your boot. Can you add the below line to your /etc/environment file so it is the only line and see if it boots? Did your /etc/environment file only have one line in the beginning?
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
Boot the installation media, choose "Try Ubuntu", mount your root filesystem in /mnt
, copy /etc/environment
to /mnt/etc/
(use sudo cp -a
to preserve timestamps, ownership and access mode), unmount /mnt
and reboot.