我尝试使用 this 在我的机器上安装 mongodb指导。
但是我遇到了this问题。此链接还包含一个补丁。补丁文件是init.d.patch
我试过:
root@DevUbuntu12:/etc# sudo patch -p1 < /home/hadoop/Downloads/init.d.patch
但出现错误:
patch: **** File init.d is not a regular file -- can't patch
我该如何应用这个补丁?
最佳答案
我建议安装“numactl”而不是打补丁。该补丁是针对源代码树而不是已安装的版本制作的,因此文件都是错误的。您仍然可以使用补丁,但运行:
cd /etc/init.d
sudo patch -p2 < /tmp/init.d.patch
然后它会警告您不知道该名称并让您自己输入。输入:
mongodb
我的 session 看起来像:
derick@whisky:~ $ cd /etc
derick@whisky:/etc $ cd init.d/
derick@whisky:/etc/init.d $ sudo patch -p2 < /tmp/init.d2.patch
can't find file to patch at input line 7
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git debian/init.d debian/init.d
|old mode 100644
|new mode 100755
|index 7e5169d..4577291
|--- debian/init.d
|+++ debian/init.d
--------------------------
File to patch: mongodb
patching file mongodb
derick@whisky:/etc/init.d $
关于linux - 如何在 init.d 上打补丁?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17605000/