OK so where is the "help me" area?

Forum: Apps
Topic: OK so where is the "help me" area?
started by: brymway

Posted by brymway on Mar. 05 2008,02:59
I am new to Linux.  Aside from the books and magazines and hours online, I am completely green.  But I do know enough that this is the distro for me.  But it seems that in order to understand the "Dillo" instructions and the wiki's you need to know something.  I don't.  I need someone to hold my hand.  Is that someone here on this forum or is there somewhere else I should be posting?  

1st Question.  I download Python 2.5.  I don't know where is goes but I do know that I managed to save it by itself on my sda1.  I can't access it via "python" in a terminal window but I see it.  How do I get it into a file like the /opt/filetool.lst so that it is there when I type "python" in the terminal window?

wow...it's pretty nice in here

Posted by mikshaw on Mar. 05 2008,03:25
How you use it would depend entirely on where you got it. In most cases if you download the software from the developer's site (python.org for example), there's a good chance that it won't work for you without doing some things I'm pretty sure you have yet to learn.

If you got it from a MyDSL repository use the command "mydsl-load /path/to/filename" to install, and after that it would depend on the type of myDSL extension whether or not it will work simply by typing "python". If it's a *.dsl or *.unc it will probably work that way. If it's *.tar.gz or *.uci, you will probably need to use a full path to the program, which is always going to be somewhere in /opt.
For example, /opt/python-2.5/bin/python

Posted by brymway on Mar. 05 2008,04:08
So after typing that cmd in a dlsbox, (I typed exactly what you said using the 'path' /opt/python-2.5/python) the program should be saved in my file that will boot up each time I boot up?
Posted by stupid_idiot on Mar. 05 2008,05:14
Currently, 'python-2.5.uci' places executables in '/opt/py-25/bin'.
If you want to run something in there, you would type
To avoid typing in that long path, you can do:
Code Sample
export PATH=$PATH:/opt/py-25/bin
This will append '/opt/py-25/bin' to your $PATH, so you can just type in 'someprogram'.
(To check your $PATH, you can do:
Code Sample
echo $PATH
Or you could do:
Code Sample
This will list all your environment variables including $PATH.)

If you install any custom Python software, such as < BitTorrent >, the libraries that come with BitTorrent will be installed to '/opt/py-25/site-packages'.
Meanwhile, the executables, e.g. bittorrent.py or btdownloadcurses.py will be installed to '/opt/py-25/bin'.
(In actual fact, Python installs to '/opt/python-2.5/lib/python/site-packages' and '/opt/python-2.5/bin', but those directories are symlinked to '/opt/py-25/site-packages' and '/opt/py-25/bin' respectively.
So, e.g. when Python installs files to '/opt/python-2.5/bin', they end up in '/opt/py-25/bin'.
Because '/opt/python-2.5/bin' is symlinked to '/opt/py-25/bin', you can also run /opt/py-25/someprogram by typing in /opt/python-2.5/bin/someprogram.
'/opt/py-25' is used as '/opt/python-2.5' is not writeable, because 'python-2.5.uci' is mounted there read-only.)
If you have a file 'foo' that is a symlink, and you want to see what it points to, you can do:
Code Sample
ls -l foo
Code Sample
file foo

Re: Backup/restore
1. Add the folder '/opt/py-25' to your '/home/dsl/.filetool.lst'
2. Run DSL's Backup/Restore tool (this can also be performed during shutdown/reboot) and choose to backup. Your '/opt/py-25' directory will be restored on the next reboot. Of course, you will need to load 'python-2.5.uci' again to run Python.

Posted by brymway on Mar. 05 2008,06:24
I don't mean to be funny Mr. _idiot but I have no idea what any of that means. Run something in where?  I looked for py-25.   'whereis py-25'.  No such file.  When I search for Python it's in usr/local/bin/python2.5. I don't know what append to my $PATH means.  I don't want to be a burden.  I just can't figure this stuff out.  I have looked but can't find a 'newbies' area.  I don't want to post where I'm not supposed to. I've looked for answers, bought the book, spent the weekend with a gal named 'wiki', now my wife is pissed and I'm still lost.
Posted by stupid_idiot on Mar. 05 2008,14:05
There are 3 different Python-2.5 extensions in MyDSL:

I realize you must be using python2.5.unc.
I made the stupid assumption that you were using python-2.5.uci.
Therefore, please disregard everything I posted before.
I am very sorry for wasting your time completely.

python2.5.unc was configured with '/usr/local' as the top-level directory.
The Python executable is in 'bin/', under '/usr/local/' - i.e. '/usr/local/bin/python2.5', as you said.

The other extensions testing/python-2.5.uci and testing/python2.5.uci were configured to use the top-level directories '/opt/python-2.5' and '/opt/python2.5' respectively.
Hence, the weird locations and instructions in my previous post.

Some essential background information:
The < shell > runs commands you type by looking for files with the same name in a list of system directories.
This list is found in the environment variable $PATH.
(The "$" symbol that comes before a word is used to refer to an environment variable.)
$PATH is a list of directories appended one after another, delimited with parentheses - ":".
You can see what is in $PATH by running:
Code Sample
echo $PATH
Or, to list all existing environment variables:
Code Sample
In our case, a file named python must exist in any of the directories in $PATH for the typed command "python" to work.
Normally, /usr/local/bin/python exists as a symbolic link (a.k.a. symlink) to /usr/local/bin/python2.5.
If /usr/local/bin/python exists, the command "python" would work - because '/usr/local/bin' is in the shell's default $PATH.
If "python" does not work, we can assume that /usr/local/bin/python is missing.

The standard way to fix this is to create a symlink named python, that links/points to the actual Python executable file - in our case, /usr/local/bin/python2.5.
To do that:
Code Sample
ln -s python2.5 /usr/local/bin/python
Code Sample
cd /usr/local/bin
ln -s python2.5 python
After doing so, Python should run when you type in "python".
(Of course, we could also copy the actual file, /usr/local/bin/python-2.5 to /usr/local/bin/python. This would also work, but is a waste of disk space. Creating a symbolic link serves the same purpose while conserving disk space.)

Re: Backup/restore
How do I get it into a file like the /opt/filetool.lst so that it is there when I type "python" in the terminal window?
Do you mean that you want Python to be loaded and ready for use whenever you boot DSL?
If so, please do the following:
1. Create a directory on your pendrive called mydsl:
Code Sample
mkdir /mnt/sda1/mydsl
Then, place 'python2.5.unc' (the file that you downloaded from MyDSL) inside '/mnt/sda1/mydsl/'.
On booting DSL, all extensions found in this folder will be automatically loaded.
2. However, since your attempt to run "python" failed, I guess python2.5.unc does not come with the file /usr/local/bin/python. This could have been an oversight on the part of whomever made the extension. To make the "python" command work immediately on boot-up, the file /usr/local/bin/python needs to be created everytime DSL boots.
Note: python2.5.unc DOES come with /usr/local/bin/python. There is NO NEED to backup this file!! Repeat: There is NO NEED to backup this file!! Please see the next post.
One way to do this, would be to first create /usr/local/bin/python as shown a few paragraphs above, and then save it into DSL's backup file (named user.tar.gz - can be saved in any drive partition, e.g. pendrive).
To do so, you would first need to edit the textfile /home/dsl/.filetool.lst, and add in /usr/local/bin/python.
Then, run DSL's Backup/Restore tool (from the desktop menu); enter a device name (e.g. sda1 - your pendrive), and then click Backup. A backup file named user.tar.gz will be created in /mnt/sda1/.
(DSL will also automatically make such a backup file during shutdown/reboot.
Do note that if you haven't specified which device - e.g. sda1 - to use for backup, DSL will abort the shutdown and ask that you specify a device.)
Or, you can choose not to backup - just manually create the symlink /usr/local/bin/python everytime you boot DSL.

Note: python2.5.unc DOES come with /usr/local/bin/python. There is NO NEED to backup this file!! Repeat: There is NO NEED to backup this file!! Please see the next post.

Hope this helps, and please feel free to ask if you are unsure about anything.

Posted by stupid_idiot on Mar. 06 2008,01:08
Re: Follow-up to above post
Hi Brymway:
Just tested all existing Python 2.5 extensions, namely:

All of the 3 extensions above already contain a python symlink.

There is no need to manually create any symlinks as I mentioned in my above post. I apologize thoroughly for making you go through all the trouble.

python-2.5.uci comes with /opt/bin/python, which points to /opt/bin/python2.5.

python2.5.uci comes with /usr/bin/python, which points to /opt/py25/bin/python, which is in turn a < hard link > to /opt/bin/python2.5.
(A hard link is an identical copy of a file, but takes up no disk space - A hard link appears to be an actual file, but it actually references the file contents of the original file.)

python2.5.unc comes with /usr/local/bin/python, which points to /usr/local/bin/python2.5.

Yet if, as you said, the python command does not work, then I surmise that it may have been deleted by accident. Whatever the case, you can restore the python command either by manually creating a symlink, or by reloading the MyDSL extension.

This can be done by doing:
Code Sample
(This will unload the extension:)
mydsl-load [path_to_extension_file]
(And a second time, to reload it:)
mydsl-load [path_to_extension_file]
This does the same thing as using the MyDSL Extension Browser:
Desktop menu -> MyDSL -> MyDSL Extension Browser -> Load Local

My apologies, for causing all this confusion.

Posted by brymway on Mar. 06 2008,03:48
Actually throughout all that, I am starting to understand a little more.   Thanks for your thoroughness.  Now my status.  I click on MyDsl folder on the desktop.  I then click on the mydsl little package icon with the down arrow.  Then I click on unc.  Then I scroll down and click on Python2.5 unc and download it.  Once it downloads, I see three icons in the MyDSL folder on the desktop.  One says Python 2.5.unc, another says python2.5.unc.info and the last says python2.5.unc.md5.txt.  Once it is there, I can open an Xshell and type the word python and the program python is activated inside of the Xshell.  As long as I don't shut down or reboot, it remains like that.  But when I reboot, and come back the next day, Python is gone.  Before I shut down, I click the DSLPanel and then click backup, which, I assume, backs up my bookmarks, desktop backgrounds, and settings.  I can't remember doing anything special other than putting a usb in the slot and addressing 'sda1' when it prompted me to.  I've downloaded desktop themes and backgrounds, and they save automatically but Python never has.  All nine times I've downloaded it.
    So when you say that it comes with a /usr/local/bin/python, I see no proof or as you said, it may be getting deleted by accident.  
    I haven't downloaded Python today since I've started up DSL.  
I can open an Xshell and type in 'cd /usr/bin'.  Then 'ls-a' and don't see anything that remotely says Python.  I type in 'cd /usr/bin/python', no such file.  So I don't think it's saving the program.  I have managed to save Python, it's info and it's txt in /mnt/sda1.  Those three, plus something called mydsl and something called backup.tar.gz.
    So if I understand you right, I need to somehow make a syslink to type, telling the system to activate python inside the XShell I'm in.  But I suppose it would be better if the three python files were in the 'mydsl' file instead.

Posted by ^thehatsrule^ on Mar. 06 2008,04:37
You'll need to copy the extension from the temporary location to a permanent place, such as on your usb storage.  Then depending on your setup, you may set up auto-loading for your extension(s) or just load them manually.
Posted by stupid_idiot on Mar. 06 2008,09:41
Re: Backup/restore
backup/restore of individual files is different from autoloading of extension files.

Regarding the former, you must edit the text file /home/dsl/.filetool.lst and add files/directories that you want to backup to that text file.

Regarding the latter, you should create a directory named mydsl/ on your backup device (in your case sda1), and then put those extensions that you wish to be autoloaded at startup into that directory.

Since you want python2.5.unc to be loaded at startup, you should do the latter. You do not need to use the Backup/Restore tool at all.

So if I understand you right, I need to somehow make a syslink to type, telling the system to activate python inside the XShell I'm in.  But I suppose it would be better if the three python files were in the 'mydsl' file instead.
Yes, but you don't need to make any symlink ('symbolic link') - python2.5.unc already provides it. The only thing you need to do is put python2.5.unc in /mnt/sda1/mydsl/.
(The files python2.5.unc.info and python2.5.unc.md5.txt can be discarded at your leisure. The '.info' file is a readme. The '.md5.txt' file is a text file containing the < MD5 > hash of the actual extension file, i.e. python2.5.unc. It is only used to manually check the extension file for corruption. Other than that, it is not needed at all.
To check whether a file is corrupted:
Code Sample
(Generate MD5 hash of 'python2.5.unc' and display it on-screen:)
md5sum python2.5.unc
(Output the contents of 'python2.5.unc.md5.txt' to the screen:)
cat python2.5.unc.md5.txt

If the two strings are the same, your file is clean.
If they are different, your file is corrupted.
Code Sample
md5sum -c python2.5.unc
('python2.5.unc.md5.txt' must be present.)

Posted by brymway on Mar. 07 2008,05:23
OK so I booted up DSL, downloaded Python, then using the xshell I looked in /mnt/sda1/mydsl.  All the Python files were in there.  I then checked /usr/local/bin.  The Python files were in there as well.  What gives?  I tried
Code Sample
mv python /mnt/sda1/mydsl
from the /usr/local/bin directory.  I haven't the permission to do that.  I did it inside root, then with sudo first and then with sudo su first.  Nothing.  

I think I need to switch screen names with you.  It fits me better.

Posted by curaga on Mar. 07 2008,08:47
You tried to move the actual python binary, not the extension. As the extension is already in your mydsl folder, it will auto-load on boot.
Posted by stupid_idiot on Mar. 07 2008,12:17
/usr/local/bin/python is the Python executable file (a.k.a. a < binary file >). In Windows, it might be named python.exe.
An installation of Python consists of many files and directories, not just the executable itself. For example, the /usr/local/lib/python/ directory, which contains many text files defining misc. functions (system functions, file operations, networking, etc) in Python. All those files must be present for all of Python's features to work. Without those files in /usr/local/lib/python/ in place, you will still be able to run python (a.k.a. the Python < interpreter >), but many important functions will not work.

On the other hand, an 'extension' (e.g. python2.5.unc) is a 'software package'. It contains all the many different files Python needs to run; including, but not limited to, /usr/local/bin/python.

Definitions of package:
- a collection of things wrapped or boxed together
- a wrapped container
- box: put into a box; "box the gift, please"
- (Computing) A package is a compressed file in a distribution specific format. It contains the files for a particular program you want to install.
< http://www.google.com/search?q=define:package >)
So, an 'extension' could be thought of as an 'add-on package'.
As far as I know, only DSL users refer to packages as "extensions" - other Linux distributions call their packages "packages".

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.