1

I'm in a bit of an interesting situation.

In an attempt to have root access on my school's physics network computers, I ended up creating a chroot environment, using fakeroot and fakechroot. As every source I've read seems to suggest that debootstrap, a tool to install Debian in a subdirectory, requires root, I went ahead with the method listed here - this entails copying, yes, using cp, to copy terminal commands and their dependencies into this environment.

I've used this sleek trick so much that I've pretty much copied the entire operating system (Debian+a slew of physics tools) into a subdirectory, a subdirectory that pretends to be an operating system, where I get to pretend I'm sudo/God.

Surprisingly, many things work. They didn't at first, but coffee is good at killing bugs.

Unfortunately, I'm a little bit stuck. Whenever I make use of python (apt-get, et cetera), I get:

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]

Most fixes to this problem involved actually setting the PYTHONHOME and PYTHONPATH variables, which did not fix anything. The other common solution is to just build python from source, which I try, but I receive the following when I try to build anything:

configure: error: C compiler cannot create executables

The attached config.log file for this error can be found here.

Any help would be dearly appreciated. Also, if you have advice to completely avoid this situation or get debootstrap working without root, that would be great as well.


Update1: Tried to simplify things a bit - tried to compile a simple c file and got another commonly listed error:

gcc: error trying to exec 'cc1': execvp: No such file or directory

Tried whereis to locate it - turns out cc1 does not exist in my environment! I will now continue to slave away...

Update2: Created a soft link from gcc to cc1 (ln -s /usr/bin/gcc /usr/bin/cc1), which put a light bandage on the volcano - I now have unrecognized command line options when I gcc a sample file, including '-quiet', '-imultiarch x86_64-linux-gnu', and '-auxbase'.

Update3: Got compiler to work! Fixed all of the above problems by trying different compilers (i.e. gcc-4.4, gcc-4.7, gcc-ar) - the last of which game me a different error - that it could not find a required plugin. This clued me into the fact that not all of the c libraries had been copied over from the base OS. I fixed this which fixed my problem (one of many).

My new problem is an (apparent) lack of GMP, MPFR, and MPC. These are needed to rebuild gcc.

Update4: Compiled all three libraries. The next problem in the gcc build process was not being able to find crt1.o, crti.o, crtn.o, -lgcc, -lgcc_s, and -lc. This was fixed by setting --enable-multilib as a flag for the configure script.

  • 1
    Don't try to be root on your school's computer (or anyone else computer) without permission. This is a legal offense in most countries (2 years of jail in France, art 323-1 Code Pénal... ) – Basile Starynkevitch Jan 2 '16 at 11:12
  • 1
    I should hopefully be good - fakeroot and fakechroot aren't actually putting me in root control of the entire system. The environment I created with fakechroot can be thought of as something like a virtual machine - so it's completely isolated and independent from the rest of the computer. It's just a way to simplify the creation of the complex build system I want to make. Although if I go offline for a while, you should send help :P – Miles Jan 2 '16 at 11:22
  • 1
    Your softlink should be ln -s /usr/bin/gcc /usr/bin/cc – Basile Starynkevitch Jan 2 '16 at 11:22
  • 2
    Ask the people in charge for help setting up a virtual machine for your use. Less work overall, doing it above board will save you grief later on. – vonbrand Jan 2 '16 at 11:54
  • ^That's a good idea and I will look into it after the winter break. However right now I will push on in drafting an appeal to my stubbornness... Just now, by some miracle I built all three dependencies. – Miles Jan 2 '16 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.