LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Force install in /usr/local, or, alternatively, how to use a usb-stick as extra space (http://www.linuxquestions.org/questions/linux-software-2/force-install-in-usr-local-or-alternatively-how-to-use-a-usb-stick-as-extra-space-933671/)

InNomineLibertas 03-09-2012 07:46 PM

Force install in /usr/local, or, alternatively, how to use a usb-stick as extra space
 
The painful part is that my laptop has a bad HD (feebly humming "Nearer, my God, to thee...";-), and I am now typing this while using a DVD from Linux Magazine (the British one).

There are a few accoutrements to my problem, but suffice it to say, as follows:

1. I'm using a liveDVD of Centos ver. 6.2.

2. I need to install a few programs on a memory stick (capacity 8 GB).

3. I have copied the contents of /usr/local to the stick, and mounted this on top of /usr/local, with an idea to force an install to this particular part of the file system - but how do I do that ? (using rpm and/or yum)...

OR

4. How do I otherwise persuade my Centos to use the stick as a persistent area for installing further software ?

One clarifying point: No, I am not looking to install Centos permanently on anything yet - I need to do some rescue and similar things first. But no, the worst-case scenario does not involve a bankruptcy, so noone should panic at reading this (except, of course, that I recommend backups - early, often, and stored offsite...)

TIA!

PhoenixAndThor 03-09-2012 09:29 PM

CentOS isn't exactly designed to use a persistent area. Are you hoping to use a live OS and flash drive combo until your get a new hard drive?

InNomineLibertas 03-09-2012 09:37 PM

PhoenixAndThor: Yes.

(Or, at least until everything is squared away, and I can get the info to decide whether to get a HD or a new laptop.)

PhoenixAndThor 03-09-2012 10:08 PM

Well then, you're heading towards questionable territory. I have walked that path before, and there are Linux distributions that claim to be able to use another device (like a flash drive) to store your personal files and additional software. However, I've only found the storage of personal files to be reliable. Installing additional software, or package management in general, is usually poorly implemented and not suitable for everyday use. The main problems you're going to run into are dependency resolution, removing packages without breaking the OS, and finding software. Most software repositories for such distributions are small and not updated as frequently as other distributions. If you have a few extra flash drives and want to experience the headache for yourself, you could look at TinyCore, Puppy Linux, and Knoppix(click the USA/UK flag for English).

The best thing to do would be to simply trash all the data on the flash drive and run a full normal install on it(just my opinion though, always back up your data). There are certain tricks you can use to reduce the wear and tear on your flash if you want to go that route.

TKH 03-10-2012 05:22 PM

Read this post thoroughly before trying. Contains extreme instruction.

It seems that CentOS cannot install the program outside of a fixed directory automatically.
If you are desperate enough, you can try doing it manually. Therefore, you might want to try compiling it from source.
If you are lucky, you can find an instruction from Beyond Linux From Scratch to see recommended config options, and its dependencies.

Let us begin:
Prepare you target external partition:
  • Check that your target external partition has a linux partition (ext2, ext4, XFS, etc)
  • Mount your external to a directory
  • Note that this directory MUST be fix, and not be changed for whatever reason (or else the program won't work)
  • It is recommended that you mount your external on /opt/... directory

Now that the external is ready, get to the tarball:
  • Download the source tarball from internet (if you don't know where, google it)
  • Extract the tarball; and using terminal, put yourself in the extracted tarball directory (simply "cd")
  • Run ./configure on the directory. Run ./configure --help to see the options available
  • Do ./configure --prefix=<your target> and some options that you want
  • Run make
  • As root, run make install
  • Add the target directory to PATH variable, run export PATH=$PATH:<your directory>/bin

And, done!


All times are GMT -5. The time now is 02:35 AM.