1

I set the wrong path in some environment variables, and now booting gives a whole new taste. The OS is Raspberry Pi OS, which is Debian based.

RESULT:
Right after booting, I get a black screen with a mouse. Click any mouse buttons, and I get 2 options, "reconfigure" and "exit". "Reconfigure" doesn't seem to do anything. I hit "exit" and it feels like the program is being shut down and starting up again. I get a brief moment where I can do "ctrl" + "alt" + "F1" and I get to see for a brief second some command/Terminal code thingy, and then the black screen with the mouse is loaded again. (bad terminology, I'm am very new to Linux)

What I did:
The bad thing I did was sudo nano /etc/environment and added a path to the Vulkan_SDK enviroment file setup-env.sh. (I had no clue how to do it), and this was incredibly stupid of me.

PATH="path/to/setup-env.sh"

Content of setup-env.sh:

# Copyright (c) 2015-2023 LunarG, Inc.

# source this file into an existing shell to setup your environment.
#
# See docs for in depth documentation:
# https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html

ARCH="$(uname -m)"
VULKAN_SDK="$(dirname "$(readlink -f "${BASH_SOURCE:-$0}" )" )/$ARCH"
export VULKAN_SDK
PATH="$VULKAN_SDK/bin:$PATH"
export PATH
LD_LIBRARY_PATH="$VULKAN_SDK/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH
VK_ADD_LAYER_PATH="$VULKAN_SDK/share/vulkan/explicit_layer.d${VK_ADD_LAYER_PATH:+:$VK_ADD_LAYER_PATH}"
export VK_ADD_LAYER_PATH
if [ -n "${VK_LAYER_PATH-}" ]; then
    echo "Unsetting VK_LAYER_PATH environment variable for SDK usage"
    unset VK_LAYER_PATH
fi

How can I get past this, remove this line in envrionment, and get it back to "normal" again?

10
  • 2
    Is this related to askubuntu.com/questions/1542997/…? This is one of the reasons why I was very worried when I saw you made the change in the global /etc/environment file. Can you boot into a live system? I.e. do the same thing you did to originally install the OS onto the machine. You can get live images of Raspbian from raspberrypi.com/software, then boot using one of those and you can go and edit the file on the original system. Let us know if this is an option and we can try to guide you. Commented Mar 6 at 15:59
  • @terdon yeahhh.... thats me. I'm smiling, laughing and crying at the same time. hahaha, filled with shame. I might be able to do as you say. My OS is on a m2 SSD. So I could play with it amd use the SD card, and do as you say. Good idea. Im gonna try that after my dinner date (bad timing) Commented Mar 6 at 16:07
  • @terdon ps. It can be very difficult to find the right stack Exchange. Happy to have found this one over the Ubuntu. Commented Mar 6 at 16:14
  • Very difficult indeed, I know. And I have no idea why you would be filled with shame. You are new to Linux, there's nothing to be ashamed of there! Nobody was born knowing this stuff and we all need to start somewhere. You have nothing to be ashamed about. I am really sorry if my comment made you feel otherwise: yes, it's a bad idea to edit the /etc/environment file for something like this, but hey, I know that because I did what you did and broke my system 20 years ago. That's how we all learn! Commented Mar 6 at 19:16
  • But please answer my question about booting into a live system because that is your best bet to fix this. Commented Mar 6 at 19:17

1 Answer 1

1

with CTRL + (left) ALT + F2, I was able to pop-up the console and login with my user account. Than it was a simple matter of opening the file, deleting the wrongfull path in etc/enviroment, reboot, and it was like nothing ever happend.

So again:

sudo nano /etc/environment

It opend the file and delete the bad line.
Done.

For the full disclosure of my problem:
To the etc/environment, I added: PATH="/home/lake/vulkan/1.x.yy.z/setup-env.sh"

this was a bad, bad thing!
For my case with setting up the VULKAN_SDK environment varriables, it was:

nano ~/.profile 

And than add the line:

. /home/lake/vulkan/1.x.yy.z/setup-env.sh

CTRL + (left) ALT + F2, always remember!

1
  • Thanks! Just also remember that F2 won't always work, so you can just try any of the other F buttons. Commented Mar 11 at 14:55

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.