Force install in /usr/local, or, alternatively, how to use a usb-stick as extra space
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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...)
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.