![在centos 7上安装rdiff备份](https://linux22.com/image/140332/%E5%9C%A8centos%207%E4%B8%8A%E5%AE%89%E8%A3%85rdiff%E5%A4%87%E4%BB%BD.png)
我在 Centos 7 上安装 rdiff 备份时遇到问题。每次谷歌搜索都告诉我要得到这个https://dl.fedoraproject.org/pub/epel/7/x86_64/r/rdiff-backup-1.2.8-11.el7.x86_64.rpm
单程或者另一个但它产生了 404。所以我尝试安装开发工具并从源代码构建它。
python --version
Python 2.7.5
python setup.py install
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/backup.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/robust.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/iterfile.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/user_group.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/lazy.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/increment.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/log.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/FilenameMapping.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/fs_abilities.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/regress.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/statistics.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/rpath.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/manage.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/metadata.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/TempFile.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/Rdiff.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/restore.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/static.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/Main.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/Time.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/hash.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/eas_acls.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/rorpiter.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/Hardlink.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/Globals.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/SetConnections.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/selection.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/Security.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/connection.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/__init__.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/librsync.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/win_acls.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/compare.py -> build/lib.linux-x86_64-2.7/rdiff_backup
copying rdiff_backup/longname.py -> build/lib.linux-x86_64-2.7/rdiff_backup
running build_ext
building 'rdiff_backup.C' extension
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c cmodule.c -o build/temp.linux-x86_64-2.7/cmodule.o
cmodule.c:24:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
构建失败。不知道这是否与 2009 年有关或其他什么有关,但这真烦人。几个月前,这在我的旧盒子上起作用了。
答案1
至少链接是错误的,但是https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/r/rdiff-backup-1.2.8-13.el7.x86_64.rpm确实存在。
但坦率地说,您通常不需要通过绕过存储库机制来安装软件包(这意味着您不会获得软件包的更新);特别是在这种情况下,第三方存储库是 EPEL,它是最成熟且值得信赖的。事实上,现在启用 EPEL 所需的存储库数据甚至已作为 CentOS 的一部分提供。
所以我建议你做的是
sudo yum install epel-release
sudo yum install rdiff-backup
(除非您迫切需要比 EPEL 上提供的版本更新的 rdiff-backup 版本 - 与所有 RH/CentOS 一样,我们喜欢从稳定到古老的版本。)