Why cant I execute certain files?
Apologies if this is a silly question, I have done a LOT of searching and fiddling around but cannot find an answer.
Basically I have installed lynx but cannot run it. Please see my latest attempt: /opt/bin # ls -l lynx -rwxr-xr-x 1 root root 1140456 Jan 20 2008 lynx /opt/bin # ./lynx /bin/sh: ./lynx: not found As you can see I can see the lynx file and it looks like I have execute permissions (to my newb eyes), but when I try to run it I get "not found". Thanks in advance for any comments whatsoever, even insults would be welcome at the moment :) Machine: Freecom Network Drive Pro Distro: OpenFSG |
There's no need for ./ and you don't need to be in /opt/bin just type lynx when you start a terminal session.
|
Thanks for the reply, but just tried your suggestion and got the same problem:
/opt/bin $ lynx -sh: lynx: not found |
Based on your command-line output you are logged in as root and have lynx installed in /opt/bin and your lynx is owned by root. All in all it should work.
I had once problems accessing web files by the Apache browser due to some SELinux settings on the directory containing those files, which was solved by copying the files to a new directory and replacing the old directory with the new one. It was a weird solution to a weird problem. In your case it seems easier to install lynx properly in /usr/bin uing some package manager. |
Try executing it from your /home/username directory. Type ~ then press enter, now type lynx. If that doesn't work try /opt/bin/lynx. If both ways fail, it is most likely because /opt/bin is not in your path. Type env and look for a line like this: PATH=/opt/bin.
|
Tried your suggestions.
/home/.users $ ~ -sh: /home/.users/admin: Permission denied Even though /home/.users $ cd /home/.users/admin ~ $ works fine. Also tried suggestion from {BBI}}NEXUS{BBI} to copy to /opt/bin but get the same problem. I reckon a hammer or an axe might be required soon... |
Quote:
So typing just ~ is like typing /home/.users/admin which also isn't a command. So you get "Permission denied " cd is a command. It means change directory to .... so you can cd ~ or cd /home/.users/admin lynx doesn't work because as {BBI}Nexus{BBI} said, /opt/bin/ is not in root's path (and you were trying as the root user) Please read {BBI}Nexus{BBI}'s post #5 again, and try /opt/bin/lynx |
Apologies I misquoted, I meant to say that I had tried salter's suggestion. I have also tried {BBI}Nexus{BBI} too:
/ # /opt/bin/lynx /bin/sh: /opt/bin/lynx: not found |
Just out of curiosity, what is the output of the following two commands?
Code:
file /opt/bin/lynx |
OK
What's the output of Code:
ls -l /opt/bin/lynx (That's "minus Ell" not "minus one") |
Code:
/ # file /opt/bin/lynx Code:
/ # ls -al /opt/bin |
Quote:
In your listing of /opt/bin/ lynx is there, and is executable by all. So it should work. But it doesn't. What, please is the output of env ? Is your filesystem corrupted? have you tried running fsck ? |
Yes, file is missing, cant install it either (get an error). This is an unusual distro.
Code:
/opt/bin # env Code:
/opt/bin # fsck -N |
Oh bllx! Just gave out my ip address. Dont look :)
|
Quote:
|
Ah! Didnt see the "edit" button. Doh!
|
IP is gone. No harm done.
The output from env is a little sparse compared to mine. To note: /opt/bin is not in your PATH Your SHELL is /bin/sh but what is that linked to? Mine is /bin/bash Quote:
But when I try it: Code:
tred@vaio:~$ fsck -N shutdown -rF now or maybe shutdown -rf now to reboot and check (and repair) the filesystems as linux comes up. Then check your kernel logs. Otherwise, you'll have to unmount the filesystem, and then check it. Quote:
Quote:
|
Code:
/ # shutdown -? |
Ah!
Now I am beginning to understand your frustrations. We assumed (always a bad thing to do) that you were running some "mainstream" distro. The linux installed on your device will be a minimal install to save on space (& cost). It will not come with any development tools (C compiler, kernel source-code etc.) and many basic things like file will have been omitted, because they are not needed for the device to function (probably very well, as long as you do not break it). In short, you are setting yourself a very hard task if you are new to linux, and want to play with it (IMHO the best way to learn linux is to play with it until you break it, then start again: like a bicycle - at first you keep falling off, but soon you wonder why everybody can't just ride one, the same as you can - it's EASY!). You may well break the fuctionality of your device if you play with it without knowing what you are doing. Please take care, especially if you are working as root, which you have been doing. I do not know where you found your lynx executable, but maybe it was not compiled for your ARM system: linux isn't windows - you can't just drop in an exe file and expect it to work. This is one of the many advantages of linux. (Drop in a virus: it doesn't work. Nothing happens). If you'd like to learn linux to the level that you can hack linux-powered devices, start with a mainstream distro, and dual-boot with that "other" OS, until you earn your wings. Start here http://distrowatch.com/ and pick any distro in the top ten. Maybe try them all. I am currently recommending kubuntu 8.04 but make your own choice, and play as you wish. Search-engine (or search this board) for dual boot linux to see what I am talking about. I'm sure you'll have a lot of fun, and learn to appreciate all linux has to offer. Then you can play with hacking linux-powered devices. That's fun too: My jailbroken iTouch! Whooo Hooo! I rarely listen to music, but hacking it was fun. Explore a mainstream distro. Try others. Have fun. Good luck. |
Quote:
Welcome to the world of the Penguin. :D |
Code:
mount | grep noexec |
Thanks for all your advice guys, I still cant get it to work but I have learnt some stuff and the advice to start simple and build up is certainly useful. I am going to setup what I need on a Debian VM to practice, then reimplement on a freshly wiped Network Drive Pro once I have the prerequisite skills. No pain no gain :)
FYI: mount | grep noexec returned nothing, however Code:
/ # mount Cheers, Paul |
All times are GMT -5. The time now is 06:09 AM. |