添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I have trouble installing this library called librsync on an Amazon standard linux instance.

I tried this:

yum install librsync-devel

but I got No package librsync available (fair enough I guess!)

I also followed the install instructions, which says:

To build and test librsync from the extracted distribution do;
$ ./configure
$ make all check

I'm no linux expert, I extracted the library files and run these commands:

[ec2-user@ip-**-***-**-*** librsync]$ ./configure
-bash: ./configure: Permission denied
[ec2-user@ip-**-***-**-*** librsync]$ sudo ./configure
sudo: ./configure: command not found
[ec2-user@ip-**-***-**-*** librsync]$ sudo configure
sudo: configure: command not found

I changed permission of the configure file and run the ./configure command again. I got a long list of yes (full log here) and then this:

checking whether g++ accepts -g... no
checking dependency style of g++... none
checking how to run the C++ preprocessor... /lib/cpp
configure: error: C++ preprocessor "/lib/cpp" fails sanity check

I'm totally lost. Any idea how to install this librsync library on EC2 linux instance?

From the error, it looks like your configure script is not set to be executable. You can check with ls -l configure. You should see a line that starts with something like -rwxr-xr-x. If not, you can run chmod +x configure to add executable permission to it.

If the permissions on that file are not right, it would be good to check the rest of the files in the distribution. How did you get the file? Downloading the tarball from Sourceforge? Download the ZIP from Github? Checking out from Github? And how did you extract it? If you could fill those details in to your question, as well as the full output of ls -l, that might help us figure out what happened.

edit to add: It looks from your configure log like cpp (the C preprocessor) is looking for cc1plus, which is part of g++. You can install that with yum install gcc-c++ (remember to run as root or with sudo).

Also, in regards to your comment, I would recommend copying the .tar.gz file directly to the Linux machine, and extracting it with tar xvzf myfile.tar.gz rather than extracting it on a Windows machine and uploading it. There are enough differences in the filesystem (how permission bits work, case sensitivity), that the process of extracting files on Windows and uploading the extracted files with something like winscp can cause problems like this.

Thank you Brian, yes, I actually just found about this just before you answered my question (see edit). Yes, I got the file from sourceforge, I extracted it locally then uploaded via winscp. After bypassing the permission issue, I had few errors about C++ or something. I posted the full log here – TheDude Oct 16, 2012 at 17:24 Thank you so much Brian! That (almost) did it! I re-uploaded the tar & extracted it on the EC2 instance, I installed gcc & make and it worked (see logs here), I tried calling it, ie. librsync --help but it doesn't work (it says -bash: librsync: command not found)...I understand it's a library rather than an executable, but how can I call it anyway via SSH? – TheDude Oct 18, 2012 at 19:42 @Gdhami What are you intending to do with librsync? As you point out, it's a library, not an executable. That means you would generally use it by compiling and linking an executable to it. Do you have a program that depends on librsync? Or are you writing such a program? To link against it, you would generally call GCC like: gcc -o program program.c -lrsync. If you want something that you can call from the command line, you should just use rsync itself. – Brian Campbell Oct 18, 2012 at 19:50 @Gdhami Ah. You want the rdiff application (which should be build and installed as part of librsync). Try man rdiff or rdiff --help. There are three steps to using it; you generate a signature of the old file, you use that signature and the new file to create a delta, then you can apply that delta to a basis file (the old file, or another file that is similar enough that the delta still applies). So your command, once you've generated a delta, would be exec("rdiff patch $file_name $delta_file $final_file"). – Brian Campbell Oct 18, 2012 at 20:52 @Gdhami rdiff is built and installed as part of librsync. Did you run sudo make install? Or make install when logged in as root? If not, do so. If you did, it likely would have installed rdiff in /usr/local/bin. Is that in your path? You can check with echo $PATH, or you can try running /usr/local/bin/rdiff manually. If it's not in your path, you can add something like export PATH=/usr/local/bin:$PATH to your .profile or .bash_profile. There's probably somewhere else you will need to set it for PHP, or just use the absolute pathname when invoking it from PHP. – Brian Campbell Oct 18, 2012 at 21:55

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.