LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 04-28-2023, 05:48 PM   #1
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
what is this crazy I don't even know what to call this one.


I have a script that I run across many platforms aka Linux Distos and FreeBSD and now when I get into Ubunutu I get this error

Code:
userx@Ubutt-Butt:~
$ xfce4-setwallpaper

/home/userx/bin/imagescripts/xfce4-setwallpaper: line 38: /home/userx/bin/mkdir: cannot execute: required file not found
/home/userx/bin/imagescripts/xfce4-setwallpaper: line 39: /home/userx/bin/mv: cannot execute: required file not found
userx@Ubutt-Butt:~
$ whereis mkdir
mkdir: /usr/bin/mkdir /home/userx/bin/mkdir /usr/share/man/man1/mkdir.1.gz /usr/share/man/man2/mkdir.2.gz
userx@Ubutt-Butt:~
$ whereis mv
mv: /usr/bin/mv /home/userx/bin/mv /usr/share/man/man1/mv.1.gz
userx@Ubutt-Butt:~
for whatever its reasons it thinks mkdir and mv are in my home dir. I never had this one before.
Code:
userx@Ubutt-Butt:~
$ uname -a
Linux Ubutt-Butt 6.2.0-1003-lowlatency #3-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr  6 10:00:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
it is Ubunutu studio the latest one that just came out, I just upgrade it to that one the other day. 24.10??? I don't know
can anyone tell me how to fix this?

Last edited by BW-userx; 04-28-2023 at 05:50 PM.
 
Old 04-28-2023, 07:22 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Might help if we actually knew the contents of the script you are running.
 
Old 04-28-2023, 09:04 PM   #3
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,146
Blog Entries: 6

Rep: Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834
What's in /home/userx/bin
Code:
ls -l /home/userx/bin
What's in your path
Code:
echo $PATH
xfce4-setwallpaper
Code:
line 38: /home/userx/bin/mkdir
Maybe something wrote /home/userx/bin instead of /usr/bin, or is it suppose to be that way.

Do you have symlinks in /home/userx/bin
 
Old 04-28-2023, 09:43 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,361
Blog Entries: 28

Rep: Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148Reputation: 6148
It's a shot in the dark, but could it be that, because you are running the script from /home/userx/bin/, it's looking for those commands in that same directory?

This prompted my shot in the dark.
 
Old 04-29-2023, 06:39 AM   #5
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,146
Blog Entries: 6

Rep: Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834
Quote:
on CentOS/RHEL 6.x (and up) and Fedora 20 (and up):

When you login, the script $HOME/.bash_profile is executed and this script adds $HOME/bin to your path.

on Ubuntu:

When you login, the script $HOME/.profile is executed and this script adds $HOME/bin to your path.
If the directory exists. Interesting, would not have known that.
 
Old 04-29-2023, 06:40 AM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by evo2 View Post
Might help if we actually knew the contents of the script you are running.
you want the entire script?

it doensn't matter anymore. this Ubunututu got me so I cannot login now, I cannot even go into a ROOT GUI login because it looks like there login manager does not work like that because #^$*#^$*@^*$@ asses figured no one should even learn how to use root so they hide it as best they can. lalalala anyways I am about to dump this distro again.
 
Old 04-29-2023, 06:45 AM   #7
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by frankbell View Post
It's a shot in the dark, but could it be that, because you are running the script from /home/userx/bin/, it's looking for those commands in that same directory?

This prompted my shot in the dark.
yeah but it was not doing that just moments before or the day before or the week before etc so I absolute path the two in the script and it was still trying to use the ones that are not there in my home bin, so I deluser . adduser, then got locked out of login and Ubunutu screwed me.

there is a systemD message on the screen but I cannot read that fast as the login manager pops up covering it. they did not even have the login manager sent to a different tty to login on, It does not even allow root login on the GUI .

Ubuntu is ok as long as it doesn't get a quirt . put that on a tee shirt and let everyone read it.
 
Old 04-29-2023, 06:49 AM   #8
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by teckk View Post
If the directory exists. Interesting, would not have known that.
just for sake of conversation, as I am no locked out of that system and have no idea how to get that massage on there screen as I'd rather be in a GUI with root so I can have scroll back on a terminal if I need it. anyways I have a bin and I have NOT mv or mkdir in it.

I removed the user, changed the users home to userx-old added me back then got locked out as in trying to login to the login manager does not accept my password. I didn't try another tty for that user But I an get in root on the cli in another tty.

I need to go an check that out, if user can login on another tty.

back: yes I can login user on a different tty

Last edited by BW-userx; 04-29-2023 at 07:03 AM.
 
Old 04-29-2023, 06:56 AM   #9
lvm_
Member
 
Registered: Jul 2020
Posts: 963

Rep: Reputation: 342Reputation: 342Reputation: 342Reputation: 342
a) '/home/userx/bin/mkdir: cannot execute: required file not found' message means that file /home/userx/bin/mkdir exists but has a bad shebang
b) and because it exists it somehow took precedence over regular /usr/bin/mv (BTW why /usr/bin? should be /bin), running 'hash -r' should fix it
 
Old 04-29-2023, 07:02 AM   #10
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by lvm_ View Post
a) '/home/userx/bin/mkdir: cannot execute: required file not found' message means that file /home/userx/bin/mkdir exists but has a bad shebang
b) and because it exists it somehow took precedence over regular /usr/bin/mv (BTW why /usr/bin? should be /bin), running 'hash -r' should fix it
shebang is #!/usr/bin/env bash

I am lockout out of that distro it has some kind of systemD F&#( error I cannot see because the login manager comes up blocking that tty so now I either have to dump the entire system or figure out wtf is going on with that now.

I can login on the tty but so what
edit
I did not put mk or mkdir in my bin so I have no idea where it got that idea either . it just started doing that out of the blue

Last edited by BW-userx; 04-29-2023 at 07:14 AM.
 
Old 04-29-2023, 07:10 AM   #11
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,146
Blog Entries: 6

Rep: Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834
#!/usr/bin/env bash
That's the $PATH isn't it?.

try: #!/usr/bin/bash

You should be able to login from startx using ./xinitrc without using a display manager.

Edit: Or is that using wayland.
 
Old 04-29-2023, 07:32 AM   #12
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by teckk View Post
#!/usr/bin/env bash
That's the $PATH isn't it?.

try: #!/usr/bin/bash

You should be able to login from startx using ./xinitrc without using a display manager.

Edit: Or is that using wayland.
Okay I just got back in under same user but a new one . so now let me see what it is going to do after I get it setup again.
thanks for your help

EDIT:

Okay this thing just screwed up again with that everything even ls is suppose to be in my home bin now and again I am locked out from login but i do have a different user on this thing and it is not giving me this grief

Last edited by BW-userx; 04-29-2023 at 08:05 AM.
 
Old 04-29-2023, 08:07 AM   #13
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by teckk View Post
What's in /home/userx/bin
Code:
ls -l /home/userx/bin
What's in your path
Code:
echo $PATH
xfce4-setwallpaper
Code:
line 38: /home/userx/bin/mkdir
Maybe something wrote /home/userx/bin instead of /usr/bin, or is it suppose to be that way.

Do you have symlinks in /home/userx/bin
from the user I can still login as to the my main user that is screwed up
Code:
blender@Ubutt-Butt:~
$ echo $PATH
/home/blender/.local/bin:/home/blender/bin/fbsd:/home/blender/bin/heidypinoscripts:/home/blender/bin/EtermScripts:/home/blender/bin/imagescripts:/home/blender/bin/userstartups:/home/blender/.local/bin:/home/blender/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/blender/bin
blender@Ubutt-Butt:~
$ su userx
Password: 
userx@Ubutt-Butt:/home/blender$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
bloody hell
Code:
/home/blender/bin/imagescripts/xfce4-setwallpaper: line 38: /home/blender/bin/mkdir: cannot execute: required file not found
/home/blender/bin/imagescripts/xfce4-setwallpaper: line 39: /home/blender/bin/mv: cannot execute: required file not found
/home/blender/bin/imagescripts/xfce4-setwallpaper: line 38: /home/blender/bin/mkdir: cannot execute: required file not found
/home/blender/bin/imagescripts/xfce4-setwallpaper: line 38: /home/blender/bin/mkdir: cannot execute: required file not found
/home/blender/bin/imagescripts/xfce4-setwallpaper: line 38: /home/blender/bin/mkdir: cannot execute: required file not found
Code:
blender@Ubutt-Butt:~
$ ls bin
bash: /home/blender/bin/ls: cannot execute: required file not found

Last edited by BW-userx; 04-29-2023 at 08:13 AM.
 
Old 04-29-2023, 08:57 AM   #14
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
A shot in the dark? You ran ld with a typo - possibly as root, possibly in the wrong place - as opposed to ls and screwed something up.

Last edited by goumba; 04-29-2023 at 08:59 AM.
 
Old 04-29-2023, 09:26 AM   #15
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,146
Blog Entries: 6

Rep: Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834
From a terminal

Fix the $PATH for user.

In a terminal
Code:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

echo $PATH

ls /bin
Code:
cat /etc/profile
#fix it
/etc/login.defs
/etc/environment
~/.pam_environment
~/.bash_profile
~/.bash_login
~/.profile
/etc/profile.d

/etc/zshenv
~/.zshenv
/etc/zprofile
~/.zprofile
/etc/zlogin
/.zlogin

Last edited by teckk; 04-29-2023 at 09:27 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What I know, looking for what I don't know I don't know Dontpanic Linux - Newbie 18 07-23-2019 07:37 PM
what the frig? sorry, I don't know what I should call this one... vdogvictor Linux - Hardware 1 09-19-2004 11:37 PM
I don't even know what to name this one! loran Linux - Newbie 43 03-05-2003 10:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 04:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration