Linux git clone 报错:git-upload-pack: command not found

本文介绍了解决使用git clone命令从特定服务器拉取代码时遇到的git-upload-pack命令未找到的问题。通过创建软链接或者指定正确的路径,成功解决了这一问题。

      用git clone 获取服务器上的代码

[root@localhost code]$ git clone root@192.168.57.61:/root/code.git


     报错如下:

bash: git-upload-pack: command not found
fatal: The remote end hung up unexpectedly

    什么原因呢?原来代码服务器【192.168.57.61】上的git安装路径是/usr/local/git,不是默认路径,根据提示,在git服务器192.168.57.61上, 建立链接文件:

[root@localhost code]# ln -s /usr/local/git/bin/git-upload-pack /usr/bin/git-upload-pack

   再次,执行git clone ,果真可以了。

    当然,如果无法修改git代码服务器上配置,可以在clone时,添加--upload-pack选项来指定git服务器上的git-upload-pack 路径,达到上面相同的目的,如下所示:

[root@localhost code]$ git clone --upload-pack "/usr/local/git/bin/git-upload-pack" root@192.168.57.61:/root/code.git


   当然,也许你会遇到git-receive-pack 之类的错误,很有可能和这个原理是一样的,请采用类似的操作即可!

 


 

 

linux@ubuntu:~/CODE/aixam$ GIT_TRACE=1 GIT_CURL_VERBOSE=1 git clone http://tyw-server.synology.me:12345/qt_group/aixam 18:42:28.997270 git.c:344 trace: built-in: git clone http://tyw-server.synology.me:12345/qt_group/aixam 正克隆到 'aixam'... 18:42:29.004126 run-command.c:646 trace: run_command: git-remote-http origin http://tyw-server.synology.me:12345/qt_group/aixam * Couldn't find host tyw-server.synology.me in the .netrc file; using defaults * Trying 123.166.98.109... * TCP_NODELAY set * Connected to tyw-server.synology.me (123.166.98.109) port 12345 (#0) > GET /qt_group/aixam/info/refs?service=git-upload-pack HTTP/1.1 Host: tyw-server.synology.me:12345 User-Agent: git/2.17.1 Accept: */* Accept-Encoding: gzip Accept-Language: zh-CN, en-AU;q=0.9, en-CA;q=0.8, en-GB;q=0.7, en;q=0.6, *;q=0.5 Pragma: no-cache * HTTP 1.0, assume close after body < HTTP/1.0 302 Moved Temporarily < Location: http://1.1.1.3:80/sinstall/sinstall.htm?switch=0&url=tyw-server.synology.me:12345/qt_group/aixam/info/refs?service=git-upload-pack < Content-Type: text/html; < Content-Length: 0 < * Closing connection 0 * Clear auth, redirects to port from 12345 to 80* Issue another request to this URL: 'http://1.1.1.3:80/sinstall/sinstall.htm?switch=0&url=tyw-server.synology.me:12345/qt_group/aixam/info/refs?service=git-upload-pack' * Couldn't find host 1.1.1.3 in the .netrc file; using defaults * Trying 1.1.1.3... * TCP_NODELAY set * Connected to 1.1.1.3 (1.1.1.3) port 80 (#1) > GET /sinstall/sinstall.htm?switch=0&url=tyw-server.synology.me:12345/qt_group/aixam/info/refs?service=git-upload-pack HTTP/1.0 Host: 1.1.1.3 User-Agent: git/2.17.1 Accept: */* Accept-Encoding: gzip Accept-Language: zh-CN, en-AU;q=0.9, en-CA;q=0.8, en-GB;q=0.7, en;q=0.6, *;q=0.5 Pragma: no-cache < HTTP/1.1 200 OK < Date: Tue, 22 Jul 2025 08:39:50 GMT < Content-Type: text/html < Content-Length: 22502 < Last-Modified: Tue, 19 Sep 2023 06:42:19 GMT < Connection: close < ETag: "650942cb-57e6" < Expires: Wed, 23 Jul 2025 08:39:50 GMT < Cache-Control: max-age=86400 < X-Frame-Options: SAMEORIGIN < X-XSS-Protection: 1; mode=block; < Accept-Ranges: bytes < * Closing connection 1 warning: 重定向到 http://1.1.1.3:80/sinstall/sinstall.htm?switch=0&url=tyw-server.synology.me:12345/qt_group/aixam/ fatal: http://1.1.1.3:80/sinstall/sinstall.htm?switch=0&url=tyw-server.synology.me:12345/qt_group/aixam/info/refs not valid: is this a git repository? linux@ubuntu:~/CODE/aixam$
07-23
[root@yfw ~]# cd /opt/openfire [root@yfw openfire]# mvn help:effective-pom --quiet | grep "Project" -bash: mvn: command not found [root@yfw openfire]# cd /path/to/openfire-restAPI-plugin -bash: cd: /path/to/openfire-restAPI-plugin: No such file or directory [root@yfw openfire]# [root@yfw openfire]# # 强制恢复为原始状态 [root@yfw openfire]# git checkout HEAD -- pom.xml fatal: not a git repository (or any of the parent directories): .git [root@yfw openfire]# sed -i 's/<version>4\.7\.0<\/version>/<version>4.9.2<\/version>/g' pom.xml sed: can't read pom.xml: No such file or directory [root@yfw openfire]# # 安装 EPEL 源(如果尚未安装) [root@yfw openfire]# yum install -y epel-release Failed to set locale, defaulting to C.UTF-8 Last metadata expiration check: 3:34:16 ago on Wed Oct 1 16:52:10 2025. Package epel-release-8-22.el8.noarch is already installed. Dependencies resolved. Nothing to do. Complete! [root@yfw openfire]# [root@yfw openfire]# # 安装 Java 8 和 Git [root@yfw openfire]# yum install -y java-1.8.0-openjdk-devel git wget Failed to set locale, defaulting to C.UTF-8 Last metadata expiration check: 3:34:17 ago on Wed Oct 1 16:52:10 2025. Package git-2.27.0-1.el8.x86_64 is already installed. Package wget-1.19.5-10.el8.x86_64 is already installed. Dependencies resolved. ========================================================================================================== Package Architecture Version Repository Size ========================================================================================================== Installing: java-1.8.0-openjdk-devel x86_64 1:1.8.0.312.b07-2.el8_5 AppStream 9.8 M Transaction Summary ========================================================================================================== Install 1 Package Total download size: 9.8 M Installed size: 41 M Downloading Packages: java-1.8.0-openjdk-devel-1.8.0.312.b07-2.el8_5.x86_64.rpm 39 MB/s | 9.8 MB 00:00 ---------------------------------------------------------------------------------------------------------- Total 39 MB/s | 9.8 MB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : java-1.8.0-openjdk-devel-1:1.8.0.312.b07-2.el8_5.x86_64 1/1 Running scriptlet: java-1.8.0-openjdk-devel-1:1.8.0.312.b07-2.el8_5.x86_64 1/1 failed to link /usr/bin/appletviewer -> /etc/alternatives/appletviewer: Operation not permitted failed to link /usr/bin/clhsdb -> /etc/alternatives/clhsdb: Operation not permitted failed to link /usr/bin/extcheck -> /etc/alternatives/extcheck: Operation not permitted failed to link /usr/bin/hsdb -> /etc/alternatives/hsdb: Operation not permitted failed to link /usr/bin/idlj -> /etc/alternatives/idlj: Operation not permitted failed to remove link /usr/bin/jaotc: Operation not permitted failed to link /usr/bin/javah -> /etc/alternatives/javah: Operation not permitted failed to remove link /usr/bin/jdeprscan: Operation not permitted failed to link /usr/bin/jhat -> /etc/alternatives/jhat: Operation not permitted failed to remove link /usr/bin/jhsdb: Operation not permitted failed to remove link /usr/bin/jimage: Operation not permitted failed to remove link /usr/bin/jlink: Operation not permitted failed to remove link /usr/bin/jmod: Operation not permitted failed to link /usr/bin/jsadebugd -> /etc/alternatives/jsadebugd: Operation not permitted failed to remove link /usr/bin/jshell: Operation not permitted failed to link /usr/bin/native2ascii -> /etc/alternatives/native2ascii: Operation not permitted failed to link /usr/bin/schemagen -> /etc/alternatives/schemagen: Operation not permitted failed to link /usr/bin/wsgen -> /etc/alternatives/wsgen: Operation not permitted failed to link /usr/bin/wsimport -> /etc/alternatives/wsimport: Operation not permitted failed to link /usr/bin/xjc -> /etc/alternatives/xjc: Operation not permitted Verifying : java-1.8.0-openjdk-devel-1:1.8.0.312.b07-2.el8_5.x86_64 1/1 Installed: java-1.8.0-openjdk-devel-1:1.8.0.312.b07-2.el8_5.x86_64 Complete! [root@yfw openfire]# [root@yfw openfire]# # 安装 Maven [root@yfw openfire]# yum install -y maven Failed to set locale, defaulting to C.UTF-8 Last metadata expiration check: 3:34:22 ago on Wed Oct 1 16:52:10 2025. Dependencies resolved. ========================================================================================================== Package Arch Version Repo Size ========================================================================================================== Installing: maven noarch 1:3.5.4-5.module_el8.0.0+39+6a9b6e22 AppStream 27 k Installing dependencies: aopalliance noarch 1.0-17.module_el8.0.0+39+6a9b6e22 AppStream 17 k apache-commons-cli noarch 1.4-4.module_el8.0.0+39+6a9b6e22 AppStream 74 k apache-commons-codec noarch 1.11-3.module_el8.0.0+39+6a9b6e22 AppStream 288 k apache-commons-io noarch 1:2.6-3.module_el8.0.0+39+6a9b6e22 AppStream 224 k apache-commons-lang3 noarch 3.7-3.module_el8.0.0+39+6a9b6e22 AppStream 483 k apache-commons-logging noarch 1.2-13.module_el8.0.0+39+6a9b6e22 AppStream 85 k atinject noarch 1-28.20100611svn86.module_el8.0.0+39+6a9b6e22 AppStream 20 k cdi-api noarch 1.2-8.module_el8.0.0+39+6a9b6e22 AppStream 70 k geronimo-annotation noarch 1.0-23.module_el8.0.0+39+6a9b6e22 AppStream 25 k glassfish-el-api noarch 3.0.1-0.7.b08.module_el8.0.0+39+6a9b6e22 AppStream 105 k google-guice noarch 4.1-11.module_el8.0.0+39+6a9b6e22 AppStream 471 k guava20 noarch 20.0-8.module_el8.0.0+39+6a9b6e22 AppStream 2.1 M hawtjni-runtime noarch 1.16-2.module_el8.0.0+39+6a9b6e22 AppStream 43 k httpcomponents-client noarch 4.5.5-4.module_el8.0.0+39+6a9b6e22 AppStream 718 k httpcomponents-core noarch 4.4.10-3.module_el8.0.0+39+6a9b6e22 AppStream 638 k jansi noarch 1.17.1-1.module_el8.0.0+82+8ee6c375 AppStream 79 k jansi-native x86_64 1.7-7.module_el8.0.0+39+6a9b6e22 AppStream 75 k javapackages-tools noarch 5.3.0-1.module_el8.0.0+11+5b8c10bd AppStream 44 k jboss-interceptors-1.2-api noarch 1.0.0-8.module_el8.0.0+39+6a9b6e22 AppStream 33 k jcl-over-slf4j noarch 1.7.25-4.module_el8.0.0+39+6a9b6e22 AppStream 32 k jsoup noarch 1.11.3-3.module_el8.0.0+39+6a9b6e22 AppStream 386 k maven-lib noarch 1:3.5.4-5.module_el8.0.0+39+6a9b6e22 AppStream 1.4 M maven-resolver-api noarch 1:1.1.1-2.module_el8.0.0+39+6a9b6e22 AppStream 138 k maven-resolver-connector-basic noarch 1:1.1.1-2.module_el8.0.0+39+6a9b6e22 AppStream 51 k maven-resolver-impl noarch 1:1.1.1-2.module_el8.0.0+39+6a9b6e22 AppStream 177 k maven-resolver-spi noarch 1:1.1.1-2.module_el8.0.0+39+6a9b6e22 AppStream 40 k maven-resolver-transport-wagon noarch 1:1.1.1-2.module_el8.0.0+39+6a9b6e22 AppStream 39 k maven-resolver-util noarch 1:1.1.1-2.module_el8.0.0+39+6a9b6e22 AppStream 148 k maven-shared-utils noarch 3.2.1-0.1.module_el8.0.0+39+6a9b6e22 AppStream 165 k maven-wagon-file noarch 3.1.0-1.module_el8.0.0+39+6a9b6e22 AppStream 26 k maven-wagon-http noarch 3.1.0-1.module_el8.0.0+39+6a9b6e22 AppStream 27 k maven-wagon-http-shared noarch 3.1.0-1.module_el8.0.0+39+6a9b6e22 AppStream 49 k maven-wagon-provider-api noarch 3.1.0-1.module_el8.0.0+39+6a9b6e22 AppStream 63 k plexus-cipher noarch 1.7-14.module_el8.0.0+39+6a9b6e22 AppStream 29 k plexus-classworlds noarch 2.5.2-9.module_el8.0.0+39+6a9b6e22 AppStream 65 k plexus-containers-component-annotations noarch 1.7.1-8.module_el8.0.0+39+6a9b6e22 AppStream 24 k plexus-interpolation noarch 1.22-9.module_el8.0.0+39+6a9b6e22 AppStream 79 k plexus-sec-dispatcher noarch 1.4-26.module_el8.0.0+39+6a9b6e22 AppStream 37 k plexus-utils noarch 3.1.0-3.module_el8.0.0+39+6a9b6e22 AppStream 259 k publicsuffix-list noarch 20180723-1.el8 base 79 k sisu-inject noarch 1:0.3.3-6.module_el8.0.0+39+6a9b6e22 AppStream 339 k sisu-plexus noarch 1:0.3.3-6.module_el8.0.0+39+6a9b6e22 AppStream 180 k slf4j noarch 1.7.25-4.module_el8.0.0+39+6a9b6e22 AppStream 77 k Enabling module streams: maven 3.5 scala 2.10 Transaction Summary ========================================================================================================== Install 44 Packages Total download size: 9.4 M Installed size: 12 M Downloading Packages: (1/44): apache-commons-cli-1.4-4.module_el8.0.0+39+6a9b6e22.noarch.rpm 2.0 MB/s | 74 kB 00:00 (2/44): aopalliance-1.0-17.module_el8.0.0+39+6a9b6e22.noarch.rpm 435 kB/s | 17 kB 00:00 (3/44): publicsuffix-list-20180723-1.el8.noarch.rpm 1.8 MB/s | 79 kB 00:00 (4/44): apache-commons-io-2.6-3.module_el8.0.0+39+6a9b6e22.noarch.rpm 6.4 MB/s | 224 kB 00:00 (5/44): apache-commons-codec-1.11-3.module_el8.0.0+39+6a9b6e22.noarch.rpm 6.5 MB/s | 288 kB 00:00 (6/44): apache-commons-lang3-3.7-3.module_el8.0.0+39+6a9b6e22.noarch.rpm 9.5 MB/s | 483 kB 00:00 (7/44): apache-commons-logging-1.2-13.module_el8.0.0+39+6a9b6e22.noarch.r 3.4 MB/s | 85 kB 00:00 (8/44): atinject-1-28.20100611svn86.module_el8.0.0+39+6a9b6e22.noarch.rpm 939 kB/s | 20 kB 00:00 (9/44): cdi-api-1.2-8.module_el8.0.0+39+6a9b6e22.noarch.rpm 3.5 MB/s | 70 kB 00:00 (10/44): geronimo-annotation-1.0-23.module_el8.0.0+39+6a9b6e22.noarch.rpm 1.3 MB/s | 25 kB 00:00 (11/44): glassfish-el-api-3.0.1-0.7.b08.module_el8.0.0+39+6a9b6e22.noarch 4.2 MB/s | 105 kB 00:00 (12/44): hawtjni-runtime-1.16-2.module_el8.0.0+39+6a9b6e22.noarch.rpm 2.1 MB/s | 43 kB 00:00 (13/44): google-guice-4.1-11.module_el8.0.0+39+6a9b6e22.noarch.rpm 11 MB/s | 471 kB 00:00 (14/44): guava20-20.0-8.module_el8.0.0+39+6a9b6e22.noarch.rpm 29 MB/s | 2.1 MB 00:00 (15/44): httpcomponents-client-4.5.5-4.module_el8.0.0+39+6a9b6e22.noarch. 12 MB/s | 718 kB 00:00 (16/44): jansi-1.17.1-1.module_el8.0.0+82+8ee6c375.noarch.rpm 3.1 MB/s | 79 kB 00:00 (17/44): httpcomponents-core-4.4.10-3.module_el8.0.0+39+6a9b6e22.noarch.r 9.4 MB/s | 638 kB 00:00 (18/44): jansi-native-1.7-7.module_el8.0.0+39+6a9b6e22.x86_64.rpm 3.2 MB/s | 75 kB 00:00 (19/44): javapackages-tools-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch.rpm 2.2 MB/s | 44 kB 00:00 (20/44): jboss-interceptors-1.2-api-1.0.0-8.module_el8.0.0+39+6a9b6e22.no 1.8 MB/s | 33 kB 00:00 (21/44): jcl-over-slf4j-1.7.25-4.module_el8.0.0+39+6a9b6e22.noarch.rpm 1.5 MB/s | 32 kB 00:00 (22/44): maven-3.5.4-5.module_el8.0.0+39+6a9b6e22.noarch.rpm 1.4 MB/s | 27 kB 00:00 (23/44): jsoup-1.11.3-3.module_el8.0.0+39+6a9b6e22.noarch.rpm 11 MB/s | 386 kB 00:00 (24/44): maven-resolver-api-1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch.rpm 5.3 MB/s | 138 kB 00:00 (25/44): maven-resolver-connector-basic-1.1.1-2.module_el8.0.0+39+6a9b6e2 2.3 MB/s | 51 kB 00:00 (26/44): maven-resolver-impl-1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch.rp 7.7 MB/s | 177 kB 00:00 (27/44): maven-resolver-spi-1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch.rpm 1.9 MB/s | 40 kB 00:00 (28/44): maven-lib-3.5.4-5.module_el8.0.0+39+6a9b6e22.noarch.rpm 19 MB/s | 1.4 MB 00:00 (29/44): maven-resolver-transport-wagon-1.1.1-2.module_el8.0.0+39+6a9b6e2 2.0 MB/s | 39 kB 00:00 (30/44): maven-resolver-util-1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch.rp 5.5 MB/s | 148 kB 00:00 (31/44): maven-wagon-file-3.1.0-1.module_el8.0.0+39+6a9b6e22.noarch.rpm 1.5 MB/s | 26 kB 00:00 (32/44): maven-shared-utils-3.2.1-0.1.module_el8.0.0+39+6a9b6e22.noarch.r 5.9 MB/s | 165 kB 00:00 (33/44): maven-wagon-http-3.1.0-1.module_el8.0.0+39+6a9b6e22.noarch.rpm 1.3 MB/s | 27 kB 00:00 (34/44): maven-wagon-http-shared-3.1.0-1.module_el8.0.0+39+6a9b6e22.noarc 2.6 MB/s | 49 kB 00:00 (35/44): maven-wagon-provider-api-3.1.0-1.module_el8.0.0+39+6a9b6e22.noar 2.7 MB/s | 63 kB 00:00 (36/44): plexus-cipher-1.7-14.module_el8.0.0+39+6a9b6e22.noarch.rpm 1.4 MB/s | 29 kB 00:00 (37/44): plexus-classworlds-2.5.2-9.module_el8.0.0+39+6a9b6e22.noarch.rpm 3.1 MB/s | 65 kB 00:00 (38/44): plexus-containers-component-annotations-1.7.1-8.module_el8.0.0+3 1.1 MB/s | 24 kB 00:00 (39/44): plexus-sec-dispatcher-1.4-26.module_el8.0.0+39+6a9b6e22.noarch.r 2.3 MB/s | 37 kB 00:00 (40/44): plexus-interpolation-1.22-9.module_el8.0.0+39+6a9b6e22.noarch.rp 3.1 MB/s | 79 kB 00:00 (41/44): plexus-utils-3.1.0-3.module_el8.0.0+39+6a9b6e22.noarch.rpm 8.3 MB/s | 259 kB 00:00 (42/44): sisu-inject-0.3.3-6.module_el8.0.0+39+6a9b6e22.noarch.rpm 9.9 MB/s | 339 kB 00:00 (43/44): sisu-plexus-0.3.3-6.module_el8.0.0+39+6a9b6e22.noarch.rpm 5.2 MB/s | 180 kB 00:00 (44/44): slf4j-1.7.25-4.module_el8.0.0+39+6a9b6e22.noarch.rpm 3.1 MB/s | 77 kB 00:00 ---------------------------------------------------------------------------------------------------------- Total 21 MB/s | 9.4 MB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : plexus-utils-3.1.0-3.module_el8.0.0+39+6a9b6e22.noarch 1/44 Installing : maven-resolver-api-1:1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch 2/44 Installing : maven-wagon-provider-api-3.1.0-1.module_el8.0.0+39+6a9b6e22.noarch 3/44 Installing : maven-resolver-spi-1:1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch 4/44 Installing : maven-resolver-util-1:1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch 5/44 Installing : slf4j-1.7.25-4.module_el8.0.0+39+6a9b6e22.noarch 6/44 Installing : httpcomponents-core-4.4.10-3.module_el8.0.0+39+6a9b6e22.noarch 7/44 Installing : atinject-1-28.20100611svn86.module_el8.0.0+39+6a9b6e22.noarch 8/44 Installing : plexus-containers-component-annotations-1.7.1-8.module_el8.0.0+39+6a9b6e22.n 9/44 Installing : plexus-classworlds-2.5.2-9.module_el8.0.0+39+6a9b6e22.noarch 10/44 Installing : plexus-cipher-1.7-14.module_el8.0.0+39+6a9b6e22.noarch 11/44 Installing : hawtjni-runtime-1.16-2.module_el8.0.0+39+6a9b6e22.noarch 12/44 Installing : guava20-20.0-8.module_el8.0.0+39+6a9b6e22.noarch 13/44 Installing : apache-commons-io-1:2.6-3.module_el8.0.0+39+6a9b6e22.noarch 14/44 Installing : maven-shared-utils-3.2.1-0.1.module_el8.0.0+39+6a9b6e22.noarch 15/44 Installing : jansi-native-1.7-7.module_el8.0.0+39+6a9b6e22.x86_64 16/44 Installing : plexus-sec-dispatcher-1.4-26.module_el8.0.0+39+6a9b6e22.noarch 17/44 Installing : jcl-over-slf4j-1.7.25-4.module_el8.0.0+39+6a9b6e22.noarch 18/44 Installing : maven-resolver-impl-1:1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch 19/44 Installing : plexus-interpolation-1.22-9.module_el8.0.0+39+6a9b6e22.noarch 20/44 Installing : geronimo-annotation-1.0-23.module_el8.0.0+39+6a9b6e22.noarch 21/44 Installing : apache-commons-logging-1.2-13.module_el8.0.0+39+6a9b6e22.noarch 22/44 Installing : apache-commons-lang3-3.7-3.module_el8.0.0+39+6a9b6e22.noarch 23/44 Installing : apache-commons-codec-1.11-3.module_el8.0.0+39+6a9b6e22.noarch 24/44 Installing : apache-commons-cli-1.4-4.module_el8.0.0+39+6a9b6e22.noarch 25/44 Installing : aopalliance-1.0-17.module_el8.0.0+39+6a9b6e22.noarch 26/44 Installing : google-guice-4.1-11.module_el8.0.0+39+6a9b6e22.noarch 27/44 Installing : jansi-1.17.1-1.module_el8.0.0+82+8ee6c375.noarch 28/44 Installing : maven-resolver-connector-basic-1:1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch 29/44 Installing : maven-resolver-transport-wagon-1:1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch 30/44 Installing : maven-wagon-file-3.1.0-1.module_el8.0.0+39+6a9b6e22.noarch 31/44 Installing : jsoup-1.11.3-3.module_el8.0.0+39+6a9b6e22.noarch 32/44 Installing : jboss-interceptors-1.2-api-1.0.0-8.module_el8.0.0+39+6a9b6e22.noarch 33/44 Installing : javapackages-tools-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch 34/44 Error unpacking rpm package javapackages-tools-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch Installing : glassfish-el-api-3.0.1-0.7.b08.module_el8.0.0+39+6a9b6e22.noarch 35/44 error: unpacking of archive failed on file /usr/bin/build-classpath;68dd1dfa: cpio: open error: javapackages-tools-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch: install failed Installing : cdi-api-1.2-8.module_el8.0.0+39+6a9b6e22.noarch 36/44 Installing : sisu-inject-1:0.3.3-6.module_el8.0.0+39+6a9b6e22.noarch 37/44 Installing : sisu-plexus-1:0.3.3-6.module_el8.0.0+39+6a9b6e22.noarch 38/44 Installing : maven-lib-1:3.5.4-5.module_el8.0.0+39+6a9b6e22.noarch 39/44 Installing : publicsuffix-list-20180723-1.el8.noarch 40/44 Installing : httpcomponents-client-4.5.5-4.module_el8.0.0+39+6a9b6e22.noarch 41/44 Installing : maven-wagon-http-shared-3.1.0-1.module_el8.0.0+39+6a9b6e22.noarch 42/44 Installing : maven-wagon-http-3.1.0-1.module_el8.0.0+39+6a9b6e22.noarch 43/44 Installing : maven-1:3.5.4-5.module_el8.0.0+39+6a9b6e22.noarch 44/44 Running scriptlet: maven-1:3.5.4-5.module_el8.0.0+39+6a9b6e22.noarch 44/44 failed to link /usr/bin/mvn -> /etc/alternatives/mvn: Operation not permitted failed to link /usr/bin/mvnDebug -> /etc/alternatives/mvnDebug: Operation not permitted warning: %post(maven-1:3.5.4-5.module_el8.0.0+39+6a9b6e22.noarch) scriptlet failed, exit status 2 Error in POSTIN scriptlet in rpm package maven Verifying : publicsuffix-list-20180723-1.el8.noarch 1/44 Verifying : aopalliance-1.0-17.module_el8.0.0+39+6a9b6e22.noarch 2/44 Verifying : apache-commons-cli-1.4-4.module_el8.0.0+39+6a9b6e22.noarch 3/44 Verifying : apache-commons-codec-1.11-3.module_el8.0.0+39+6a9b6e22.noarch 4/44 Verifying : apache-commons-io-1:2.6-3.module_el8.0.0+39+6a9b6e22.noarch 5/44 Verifying : apache-commons-lang3-3.7-3.module_el8.0.0+39+6a9b6e22.noarch 6/44 Verifying : apache-commons-logging-1.2-13.module_el8.0.0+39+6a9b6e22.noarch 7/44 Verifying : atinject-1-28.20100611svn86.module_el8.0.0+39+6a9b6e22.noarch 8/44 Verifying : cdi-api-1.2-8.module_el8.0.0+39+6a9b6e22.noarch 9/44 Verifying : geronimo-annotation-1.0-23.module_el8.0.0+39+6a9b6e22.noarch 10/44 Verifying : glassfish-el-api-3.0.1-0.7.b08.module_el8.0.0+39+6a9b6e22.noarch 11/44 Verifying : google-guice-4.1-11.module_el8.0.0+39+6a9b6e22.noarch 12/44 Verifying : guava20-20.0-8.module_el8.0.0+39+6a9b6e22.noarch 13/44 Verifying : hawtjni-runtime-1.16-2.module_el8.0.0+39+6a9b6e22.noarch 14/44 Verifying : httpcomponents-client-4.5.5-4.module_el8.0.0+39+6a9b6e22.noarch 15/44 Verifying : httpcomponents-core-4.4.10-3.module_el8.0.0+39+6a9b6e22.noarch 16/44 Verifying : jansi-1.17.1-1.module_el8.0.0+82+8ee6c375.noarch 17/44 Verifying : jansi-native-1.7-7.module_el8.0.0+39+6a9b6e22.x86_64 18/44 Verifying : javapackages-tools-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch 19/44 Verifying : jboss-interceptors-1.2-api-1.0.0-8.module_el8.0.0+39+6a9b6e22.noarch 20/44 Verifying : jcl-over-slf4j-1.7.25-4.module_el8.0.0+39+6a9b6e22.noarch 21/44 Verifying : jsoup-1.11.3-3.module_el8.0.0+39+6a9b6e22.noarch 22/44 Verifying : maven-1:3.5.4-5.module_el8.0.0+39+6a9b6e22.noarch 23/44 Verifying : maven-lib-1:3.5.4-5.module_el8.0.0+39+6a9b6e22.noarch 24/44 Verifying : maven-resolver-api-1:1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch 25/44 Verifying : maven-resolver-connector-basic-1:1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch 26/44 Verifying : maven-resolver-impl-1:1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch 27/44 Verifying : maven-resolver-spi-1:1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch 28/44 Verifying : maven-resolver-transport-wagon-1:1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch 29/44 Verifying : maven-resolver-util-1:1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch 30/44 Verifying : maven-shared-utils-3.2.1-0.1.module_el8.0.0+39+6a9b6e22.noarch 31/44 Verifying : maven-wagon-file-3.1.0-1.module_el8.0.0+39+6a9b6e22.noarch 32/44 Verifying : maven-wagon-http-3.1.0-1.module_el8.0.0+39+6a9b6e22.noarch 33/44 Verifying : maven-wagon-http-shared-3.1.0-1.module_el8.0.0+39+6a9b6e22.noarch 34/44 Verifying : maven-wagon-provider-api-3.1.0-1.module_el8.0.0+39+6a9b6e22.noarch 35/44 Verifying : plexus-cipher-1.7-14.module_el8.0.0+39+6a9b6e22.noarch 36/44 Verifying : plexus-classworlds-2.5.2-9.module_el8.0.0+39+6a9b6e22.noarch 37/44 Verifying : plexus-containers-component-annotations-1.7.1-8.module_el8.0.0+39+6a9b6e22.n 38/44 Verifying : plexus-interpolation-1.22-9.module_el8.0.0+39+6a9b6e22.noarch 39/44 Verifying : plexus-sec-dispatcher-1.4-26.module_el8.0.0+39+6a9b6e22.noarch 40/44 Verifying : plexus-utils-3.1.0-3.module_el8.0.0+39+6a9b6e22.noarch 41/44 Verifying : sisu-inject-1:0.3.3-6.module_el8.0.0+39+6a9b6e22.noarch 42/44 Verifying : sisu-plexus-1:0.3.3-6.module_el8.0.0+39+6a9b6e22.noarch 43/44 Verifying : slf4j-1.7.25-4.module_el8.0.0+39+6a9b6e22.noarch 44/44 Installed: aopalliance-1.0-17.module_el8.0.0+39+6a9b6e22.noarch apache-commons-cli-1.4-4.module_el8.0.0+39+6a9b6e22.noarch apache-commons-codec-1.11-3.module_el8.0.0+39+6a9b6e22.noarch apache-commons-io-1:2.6-3.module_el8.0.0+39+6a9b6e22.noarch apache-commons-lang3-3.7-3.module_el8.0.0+39+6a9b6e22.noarch apache-commons-logging-1.2-13.module_el8.0.0+39+6a9b6e22.noarch atinject-1-28.20100611svn86.module_el8.0.0+39+6a9b6e22.noarch cdi-api-1.2-8.module_el8.0.0+39+6a9b6e22.noarch geronimo-annotation-1.0-23.module_el8.0.0+39+6a9b6e22.noarch glassfish-el-api-3.0.1-0.7.b08.module_el8.0.0+39+6a9b6e22.noarch google-guice-4.1-11.module_el8.0.0+39+6a9b6e22.noarch guava20-20.0-8.module_el8.0.0+39+6a9b6e22.noarch hawtjni-runtime-1.16-2.module_el8.0.0+39+6a9b6e22.noarch httpcomponents-client-4.5.5-4.module_el8.0.0+39+6a9b6e22.noarch httpcomponents-core-4.4.10-3.module_el8.0.0+39+6a9b6e22.noarch jansi-1.17.1-1.module_el8.0.0+82+8ee6c375.noarch jansi-native-1.7-7.module_el8.0.0+39+6a9b6e22.x86_64 jboss-interceptors-1.2-api-1.0.0-8.module_el8.0.0+39+6a9b6e22.noarch jcl-over-slf4j-1.7.25-4.module_el8.0.0+39+6a9b6e22.noarch jsoup-1.11.3-3.module_el8.0.0+39+6a9b6e22.noarch maven-1:3.5.4-5.module_el8.0.0+39+6a9b6e22.noarch maven-lib-1:3.5.4-5.module_el8.0.0+39+6a9b6e22.noarch maven-resolver-api-1:1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch maven-resolver-connector-basic-1:1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch maven-resolver-impl-1:1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch maven-resolver-spi-1:1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch maven-resolver-transport-wagon-1:1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch maven-resolver-util-1:1.1.1-2.module_el8.0.0+39+6a9b6e22.noarch maven-shared-utils-3.2.1-0.1.module_el8.0.0+39+6a9b6e22.noarch maven-wagon-file-3.1.0-1.module_el8.0.0+39+6a9b6e22.noarch maven-wagon-http-3.1.0-1.module_el8.0.0+39+6a9b6e22.noarch maven-wagon-http-shared-3.1.0-1.module_el8.0.0+39+6a9b6e22.noarch maven-wagon-provider-api-3.1.0-1.module_el8.0.0+39+6a9b6e22.noarch plexus-cipher-1.7-14.module_el8.0.0+39+6a9b6e22.noarch plexus-classworlds-2.5.2-9.module_el8.0.0+39+6a9b6e22.noarch plexus-containers-component-annotations-1.7.1-8.module_el8.0.0+39+6a9b6e22.noarch plexus-interpolation-1.22-9.module_el8.0.0+39+6a9b6e22.noarch plexus-sec-dispatcher-1.4-26.module_el8.0.0+39+6a9b6e22.noarch plexus-utils-3.1.0-3.module_el8.0.0+39+6a9b6e22.noarch publicsuffix-list-20180723-1.el8.noarch sisu-inject-1:0.3.3-6.module_el8.0.0+39+6a9b6e22.noarch sisu-plexus-1:0.3.3-6.module_el8.0.0+39+6a9b6e22.noarch slf4j-1.7.25-4.module_el8.0.0+39+6a9b6e22.noarch Failed: javapackages-tools-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch Error: Transaction failed [root@yfw openfire]# [root@yfw openfire]# # 验证安装 [root@yfw openfire]# java -version openjdk version "1.8.0_312" OpenJDK Runtime Environment (build 1.8.0_312-b07) OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode) [root@yfw openfire]# mvn -v -bash: mvn: command not found [root@yfw openfire]# git --version git version 2.27.0 [root@yfw openfire]# cd ~ [root@yfw ~]# mkdir -p openfire-plugins [root@yfw ~]# cd openfire-plugins [root@yfw openfire-plugins]# [root@yfw openfire-plugins]# # 克隆 Openfire REST API 插件项目 [root@yfw openfire-plugins]# git clone https://github.com/igniterealtime/openfire-restAPI-plugin.git Cloning into 'openfire-restAPI-plugin'... remote: Enumerating objects: 2510, done. remote: Counting objects: 100% (556/556), done. remote: Compressing objects: 100% (197/197), done. remote: Total 2510 (delta 432), reused 367 (delta 354), pack-reused 1954 (from 3) Receiving objects: 100% (2510/2510), 7.43 MiB | 4.13 MiB/s, done. Resolving deltas: 100% (1182/1182), done. [root@yfw openfire-plugins]# cd openfire-restAPI-plugin [root@yfw openfire-restAPI-plugin]# [root@yfw openfire-restAPI-plugin]# # 切换到 v1.8.0 版本(稳定版) [root@yfw openfire-restAPI-plugin]# git checkout 1.8.0 Note: switching to '1.8.0'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example: git switch -c <new-branch-name> Or undo this operation with: git switch - Turn off this advice by setting config variable advice.detachedHead to false HEAD is now at 5bd7bca Denote release 1.8.0 [root@yfw openfire-restAPI-plugin]# # 修改 parent.version 为 4.9.2 [root@yfw openfire-restAPI-plugin]# sed -i 's/<version>4\.7\.0<\/version>/<version>4.9.2<\/version>/g' pom.xml [root@yfw openfire-restAPI-plugin]# grep "<version>4.9.2</version>" pom.xml <version>4.9.2</version> [root@yfw openfire-restAPI-plugin]# # 下载 install-sdk.sh 脚本 [root@yfw openfire-restAPI-plugin]# curl -O https://raw.githubusercontent.com/igniterealtime/Openfire/main/build/install-sdk.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 14 100 14 0 0 36 0 --:--:-- --:--:-- --:--:-- 36 [root@yfw openfire-restAPI-plugin]# [root@yfw openfire-restAPI-plugin]# # 添加执行权限 [root@yfw openfire-restAPI-plugin]# chmod +x install-sdk.sh [root@yfw openfire-restAPI-plugin]# [root@yfw openfire-restAPI-plugin]# # 安装 Openfire 4.9.2 的 SDK [root@yfw openfire-restAPI-plugin]# ./install-sdk.sh 4.9.2 ./install-sdk.sh: line 1: 404:: command not found [root@yfw openfire-restAPI-plugin]#
10-02
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值