为旧版本卸载OpenSSL

时间:2016-09-04 01:52:03

标签: openssl

我正在使用OpenSSL 1.1.0,我想回滚到之前的版本。我想卸载我目前在我的Mac上安装的版本,但Make文件中的说明真的很模糊,而且当涉及到这种东西时我是新手。我发布了下面的卸载说明。我看错了吗?这看起来并不简单。

uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev

uninstall_dev:
@echo "*** Uninstalling development files"
@ : 
@set -e; for i in $(SRCDIR)/include/openssl/*.h \
          $(BLDDIR)/include/openssl/*.h; do \
    fn=`basename $$i`; \
    echo "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
    $(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
done
-$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include/openssl
-$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include
@set -e; for l in $(INSTALL_LIBS); do \
    fn=`basename $$l`; \
    echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn"; \
    $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn; \
done
@ : 
@set -e; for s in $(INSTALL_SHLIB_INFO); do \
    s1=`echo "$$s" | cut -f1 -d";"`; \
    s2=`echo "$$s" | cut -f2 -d";"`; \
    fn1=`basename $$s1`; \
    fn2=`basename $$s2`; \
    : ; \
    echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
    $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1; \
    if [ "$$fn1" != "$$fn2" ]; then \
        echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
        $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
    fi; \
    : ; \
done
@ : 
$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
-$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
-$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)


uninstall_engines:
@echo "*** Uninstalling engines"
@set -e; for e in dummy $(INSTALL_ENGINES); do \
    if [ "$$e" = "dummy" ]; then continue; fi; \
    fn=`basename $$e`; \
    if [ "$$fn" = 'ossltest.dylib' ]; then \
        continue; \
    fi; \
    echo "$(RM) $(DESTDIR)$(ENGINESDIR)/$$fn"; \
    $(RM) $(DESTDIR)$(ENGINESDIR)/$$fn; \
done
-$(RMDIR) $(DESTDIR)$(ENGINESDIR)

uninstall_runtime:
@echo "*** Uninstalling runtime files"
@set -e; for x in dummy $(INSTALL_PROGRAMS); \
do  \
    if [ "$$x" = "dummy" ]; then continue; fi; \
    fn=`basename $$x`; \
    echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
    $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
done;
@set -e; for x in dummy $(BIN_SCRIPTS); \
do  \
    if [ "$$x" = "dummy" ]; then continue; fi; \
    fn=`basename $$x`; \
    echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
    $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
done
@ : 
-$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin

1 个答案:

答案 0 :(得分:0)

  

对于这类东西,我是新手。我发布了下面的卸载说明。我看错了吗?这看起来并不简单......

make install期间安装了三个主要组件:

  • openssl program
  • openssl标头和库
  • 手册页

make install_sw期间,安装了两个主要组件(我使用此组件,因为手册页需要很长时间才能复制并占用太多空间):

  • openssl program
  • openssl标头和库

现在,它们都依赖于--prefix--openssldir的早期配置。如果你从OpenSSL wiki跟随Compilation and Installation,那么你可能配置如下:

./Configure darwin64-x86_64-cc shared enable-ec_nistp_64_gcc_128 \
    no-ssl2 no-ssl3 no-comp --openssldir=/usr/local/ssl

随后是make install(软件+手册页)。

在这种情况下,cd进入openssl-1.1.0(您构建库的位置),然后执行sudo make uninstall。使用sudo rm -rf /usr/local/ssl跟随它,并且应该清除大多数残骸。任何剩余的工件都将被OpenSSL 1.0.2文件覆盖。

如果需要,cd进入openssl-1.1.0,然后使用与之前安装期间使用的完全相同的配置进行重新配置。然后,执行make uninstall

OpenSSL 1.1.0改变了一些Makefile行为。如果您没有使用make install_sw,那么对您来说无关紧要。另请参阅OpenSSL Issue 4601: install_sw does not honor --openssldir