Kali path variables messed up and now SUDO is useless [closed] - linux

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 days ago.
Improve this question
I was watching this video shorturl.at/loG48 and got to the point 2:20. I was unable to install snap in the end but forgot to put $ behind the PATH in the environment variable setup. Now I can't run sudo without typing export PATH=$PATH:/usr/bin every single time. I just installed kali and I am really scared please help me.
Doing anything now gives me
`Command 'sudo' is available in the following places
/bin/sudo
/usr/bin/sudo
The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable.
sudo: command not found
`
I just wanted to download snap but I ended up messing my PATH variables.
By following some guides here and there I managed to find this in my /etc/environment PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games even though I don't know what this is supposed to be. Please help fast.

Related

How to make linux tool in nested folder to be available globally in linux terminal [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 days ago.
Improve this question
So I have PostgreSQL installed via Asdf which is available and could be accessed via this command $HOME/.asdf/shims/pg_ctl
It's too much hustle to type so I'm trying to make it available globally just using pg_ctl command
I've tried using .profile like so,
export pg_ctl=$HOME/.asdf/shims/pg_ctl status
but I'm still need to add $ prefix
$pg_ctl
is there a way so I could make the $HOME/.asdf/shims/pg_ctl to be called just using pg_ctl and available globally in terminal?
Run this:
# Place export in bashrc file that is run before every shell session
echo "export pg_ctl=$HOME/.asdf/shims/pg_ctl status" >> ~/.bashrc
# Source the export command for your current shell
source ~/.bashrc
Now your custom command will persist in your PATH.

Bash 'export environment variable [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
New kali linux terminal starts with a bash error:
bash: ‘export: command not found
I think I messed up my bash environment when workin on a jsnode installation and do not know how to fix it.
I think I need to fix my environment variable, but do not know where that is in Kali. Appreciate any help.
There seems to be a typo in a command. It should be export but instead it's ‘export. The errant character is Unicode U+2018, LEFT SINGLE QUOTATION MARK.
The first place to look is your .bashrc, then depending on your OS, .profile or .bash_profile, then any number of other Bash startup scripts that might get called like .bash_functions, or higher up the chain like /etc/bash.bashrc.

Recursive PATH variable? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
This is more of a curiosity question, but I feel it's worth asking.
Frequently when downloading software on Linux, I'm used to using sudo apt-get install [package] or whatever package manager is available, but for some projects like sbt, they don't have a repository (so I can't just type sudo apt-get install sbt and use it out of the box). I have to download the binaries and add them to PATH.
What I like to do is create a directory specific to programs like sbt, specifically ~/Programs. I move the unpacked directory into it, and add it to PATH. However, I'm always a little wary about moving the binary out of the directory it came in, so I don't want to remove it.
Is there such a thing as a recursive PATH variable, so that not only ~/Programs is added but also ~/Programs/sbt, ~/Programs/other_program, etc.? And if not, is it a good idea to make it recursive? I've tinkered with the Linux kernel before as part of a university class, I wonder if it's worth experimenting with.
Add something like this to ~/.bashrc or ~/.bash_profile:
for each in ~/Programs/*
do
PATH+=:"$each"
done

KDE exibition glitch [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
My KDE is broken, the desktop Widgets cannot be displayed. And many KDE programs look like this:
All the software written in GTK is all right.
Can any one give me any suggestion about what's happening and which part is broken?
Where can I find error log?
You don't say what disto you're using (please add it to the tags in your question), nor how you got in this state - new installation? dist-upgrade? hard crash? That would be useful information.
But in general, here's what I would try:
Log out and go to a bare terminal with CTRL-ALT-F1, then login and rename your .kde / .kde4 directories: mv ~/.kde ~/.kde.old and reboot or otherwise restart your GUI system.
That will at least tell you whether the problem is messed up personal settings or messed-up system files.
If that doesn't fix the issue (that directory will be recreated when you start up KDE again; all your settings will be lost, but you can recover them - carefully, one by one - from the backup you just made), then I would first try sudo apt-get check (assuming you're on a Debian-based distro).
If that doesn't report any problems, then I would update my system - possibly even do a dist-upgrade without changes any sources.
If this issue still wasn't fixed, I would run sudo dpkg -l > ~/Desktop/dpkg_out.txt to get a list of installed or uninstalled packages and their state in a file, and then look through the file for problems as explained here.
Finally, if all of that failed, I would take a good hard look at my video drivers.
Good luck!

Installed an RPM file. Where to find the installed program? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about programming within the scope defined in the help center.
Improve this question
I have installed xmedcon-0.11.0-1.i686.rpm on my Fedora Linux machine. I ran the RPM file. Since I'm kind of new to Linux, I want to ask, where can I find the installed file and how can I run it?
Thanks.
From terminal use
$ rpm -ql xmedcon-0.11.0-1.i686 </code>
/etc/xmedconrc
/usr/bin/medcon
/usr/bin/xmedcon
You will see all the files installed. The main files will be above. From command line
run
$ /usr/bin/xmedcon
In case you already know the command name, you can type which medcon in a terminal and it should tell you where the executable is located.
And as full.stack.xchg said, just typing the name of the executable on a command line (or finding it in the graphical menu) will start the program.

Resources