国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Visual Studio連接Linux服務(wù)器編譯CMake項目,生成在Linux上運行的程序

這篇具有很好參考價值的文章主要介紹了Visual Studio連接Linux服務(wù)器編譯CMake項目,生成在Linux上運行的程序。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

本文基于的開發(fā)環(huán)境說明

  • window系統(tǒng):Windows 10 企業(yè)版 64位操作系統(tǒng)
  • Linux系統(tǒng):BigCloud Enterprise Linux 7.8 (Core)
  • Visual Studio:Microsoft Visual Studio Enterprise 2019 版本 16.10.4

安裝 Visual Studio Linux 工作負(fù)載

根據(jù)Microsoft官網(wǎng)文檔介紹,

開始之前
首先,請確保已安裝 Visual Studio Linux 工作負(fù)載,包括 CMake 組件。 它屬于 Visual Studio 安裝程序中的“使用 C++ 的 Linux 開發(fā)”工作負(fù)載。 如果不確定是否安裝了此項,請參閱在官方說明《 Visual Studio 中安裝 C++ Linux 工作負(fù)載》。

使用 Visual Studio Installer 安裝即可。
vslinux,Linux札記,linux,服務(wù)器,visual studio,c++

在Linux系統(tǒng)上安裝依賴工具

根據(jù)Microsoft官網(wǎng)文檔介紹,

此外,請確保在遠(yuǎn)程計算機上安裝了以下項:
gcc
gdb
rsync
zip
ninja-build(Visual Studio 2019 或更高版本)

可以使用 Visual Studio 2019 在遠(yuǎn)程 Linux 系統(tǒng)或 WSL 上生成和調(diào)試,CMake 將在該系統(tǒng)上調(diào)用。 應(yīng)在目標(biāo)計算機上安裝 Cmake 版本 3.14 或更高版本。

請確保目標(biāo)計算機具有最新版本的 CMake。 發(fā)行版的默認(rèn)包管理器提供的版本通常不夠新,不足以支持 Visual Studio 所需的所有功能。 Visual Studio 2019 會檢測 Linux 系統(tǒng)上是否安裝了最新版本的 CMake。 如果未找到,Visual Studio 將在編輯器窗格頂部顯示一個信息欄。 它用于從 https://github.com/Microsoft/CMake/releases 為你安裝 CMake。

上述啰嗦了一堆,其實就是讓我們在連接的遠(yuǎn)程Linux服務(wù)器上安裝gcc、gdb、rsync、zip、ninja-build、CMake等工具。特別強調(diào)CMake要用3.14以上的版本,最好是最新版本

1. 安裝gcc

首先查看是否安裝了gcc編譯器,使用命令 rpm -qa | grep gcc, 如果有安裝則跳過此步驟,如果沒有安裝則使用命令 yum install gcc 進行安裝就可以了

[root@localhost ~]# rpm -qa | grep gcc
[root@localhost ~]# yum install gcc
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
No package g++ available.
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.8.5-39.el7 will be installed
>>>>>>>>>>>>>> 中間的安裝過程省略 <<<<<<<<<<<<<<
Installed:
  gcc.x86_64 0:4.8.5-39.el7                                                                             

Dependency Installed:
  cpp.x86_64 0:4.8.5-39.el7                       glibc-devel.x86_64 0:2.17-326.el7_9                   
  glibc-headers.x86_64 0:2.17-326.el7_9           kernel-headers.x86_64 0:3.10.0-1127.19.1.el7          
  libmpc.x86_64 0:1.0.1-3.el7                     mpfr.x86_64 0:3.1.1-4.el7                             

Dependency Updated:
  glibc.x86_64 0:2.17-326.el7_9                   glibc-common.x86_64 0:2.17-326.el7_9                  

Complete!
[root@localhost ~]#

查看安裝的gcc是 4.8.5 版本,使用命令 man gcc 查看可知是支持 C++11 的。

[root@localhost ~]# gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@localhost ~]#

2. 安裝gdb

首先查看是否安裝了gdb調(diào)試工具,使用命令 rpm -qa | grep gdb, 如果有安裝則跳過此步驟,如果沒有安裝則使用命令 yum install gdb 進行安裝就可以了
這里先查看gdb版本,發(fā)現(xiàn)沒有安裝,所以經(jīng)使用安裝命令安裝gdb

[root@localhost ~]# rpm -qa | grep gdb
[root@localhost ~]# yum install gdb
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package gdb.x86_64 0:7.6.1-119.el7 will be installed
--> Finished Dependency Resolution
>>>>>>>>>>>>>> 中間的安裝過程省略 <<<<<<<<<<<<<<
Installed:
  gdb.x86_64 0:7.6.1-119.el7                                                                            

Complete!
[root@localhost ~]#

然后再次查看gdb安裝版本就有了,這里安裝的是gdb-7.6.1版本。

[root@localhost ~]# gdb --version
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-119.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
[root@localhost ~]# 

3. 安裝rsync

首先查看是否安裝了rsync工具,使用命令 rpm -qa | grep rsync, 如果有安裝則跳過此步驟,如果沒有安裝則使用命令 yum install rsync 進行安裝就可以了

[root@localhost ~]# rpm -qa | grep rsync
[root@localhost ~]# yum install rsync
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package rsync.x86_64 0:3.1.2-10.el7 will be installed
--> Finished Dependency Resolution

>>>>>>>>>>>>>> 中間的安裝過程省略 <<<<<<<<<<<<<<
Installed:
  rsync.x86_64 0:3.1.2-10.el7                                                                           

Complete!
[root@localhost ~]

這里安裝的是rsync 3.1.2版本。

[root@localhost ~]# rsync --version
rsync  version 3.1.2  protocol version 31
Copyright (C) 1996-2015 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes, prealloc

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.
[root@localhost ~]# 

4. 安裝zip

和前面一樣,查看是否安裝了 zip 工具,使用命令 rpm -qa | grep zip, 如果有安裝則跳過此步驟,如果沒有安裝則使用命令 yum install zip 進行安裝就可以了

[root@localhost ~]# rpm -qa | grep zip
unzip-6.0-21.el7.x86_64
bzip2-libs-1.0.6-13.el7.x86_64
bzip2-1.0.6-13.el7.x86_64
zip-3.0-11.el7.x86_64
gzip-1.5-10.el7.x86_64
[root@localhost ~]#  zip --version
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
This is Zip 3.0 (July 5th 2008), by Info-ZIP.
Currently maintained by E. Gordon.  Please send bug reports to
the authors using the web page at www.info-zip.org; see README for details.
>>>>>>>>>>>>>> 省略部分內(nèi)容顯示 <<<<<<<<<<<<<<
[root@localhost ~]# 

這里 zip 工具已經(jīng)安裝了 Zip 3.0 版本,就不在安裝了。

5. 安裝ninja-build

ninja-build 的安裝請參考文章《ninja在BC-Linux服務(wù)器上源碼編譯和安裝》,該文章中講述了多種安裝方式,挑選自己喜歡的方式安裝即可,此處不再累贅。這里已經(jīng)進行了安裝,安裝版本為當(dāng)前 release 最新版 1.10.2,如下:

[root@localhost ~]# ninja --version
1.10.2
[root@localhost ~]# 

6. 安裝CMake

首先查看當(dāng)前是否安裝了 cmake,以及其版本:

[root@localhost ~]# rpm -qa | grep cmake
[root@localhost ~]# 

我這里查看沒有安裝 cmake,因此先來使用 yum install cmake 來安裝,看能不能滿足要求。

[root@localhost ~]# yum install cmake
Configuration file /etc/yum/pluginconf.d/license-manager.conf not found
Unable to find configuration file for plugin license-manager
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * epel: hkg.mirror.rackspace.com
Resolving Dependencies
--> Running transaction check
---> Package cmake.x86_64 0:2.8.12.2-2.el7 will be installed

>>>>>>>>>>>>>> 省略部分內(nèi)容顯示 <<<<<<<<<<<<<<
Installed:
  cmake.x86_64 0:2.8.12.2-2.el7                                                                                

Dependency Installed:
  libarchive.x86_64 0:3.1.2-14.el7_7                                                                           

Complete!
[root@localhost ~]# cmake --version
cmake version 2.8.12.2
[root@localhost ~]# 

這里安裝的版本是 CMake 2.8.12.2,版本小于 官方要求的 3.14 版本,所以 yum 軟件倉庫 中的 cmake 無法達(dá)到要求。由于本章講述的內(nèi)容對 CMake 的版本有要求,所以準(zhǔn)備直接安裝 GitHub 上的 CMake 最新版本來用。
CMake 最新版本的安裝請參考《CMake在BC-Linux服務(wù)器上源碼編譯和安裝》進行安裝,此處不再累贅。這里已經(jīng)安裝了當(dāng)前最新版本 3.26,如下:

[root@localhost bin]# cmake3 --version
cmake version 3.26.20230303-gc465e0e

CMake suite maintained and supported by Kitware (kitware.com/cmake).
[root@localhost bin]# 

到這里依賴的工具就安裝完成了。

創(chuàng)建 CMake 項目

打開 Visual Studio,點擊創(chuàng)建新項目,進入如下頁面。
vslinux,Linux札記,linux,服務(wù)器,visual studio,c++
vslinux,Linux札記,linux,服務(wù)器,visual studio,c++
創(chuàng)建后如下圖所示
vslinux,Linux札記,linux,服務(wù)器,visual studio,c++

連接到目標(biāo)遠(yuǎn)程Linux系統(tǒng)

1. 在遠(yuǎn)程 Linux 系統(tǒng)上安裝 openssh

OpenSSH 是 SSH (Secure SHell) 協(xié)議的免費開源實現(xiàn)。SSH協(xié)議族可以用來進行遠(yuǎn)程控制, 或在計算機之間傳送文件。SSH是加密的,更安全。
Visual Studio 就是通過 SSH 和遠(yuǎn)程 Linux 系統(tǒng)進行遠(yuǎn)程控制和文件傳輸?shù)摹?/p>

[root@localhost ~]# yum install openssh-server
Last metadata expiration check: 0:11:41 ago on Sun 05 Mar 2023 09:03:07 PM EST.
Package openssh-server-8.0p1-4.el8.x86_64 is already installed.
>>>>>>>>>>>>>> 中間的安裝過程省略 <<<<<<<<<<<<<<
Upgraded:
  openssh-8.0p1-13.el8.x86_64                     openssh-clients-8.0p1-13.el8.x86_64             
  openssh-server-8.0p1-13.el8.x86_64             

Complete!
[root@localhost ~]# 

2. 啟動 openssh

啟動并查看狀態(tài)

[root@localhost bin]# systemctl start sshd
[root@localhost bin]# service sshd status
Redirecting to /bin/systemctl status sshd.service
● sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2023-03-05 21:14:55 EST; 18min ago
     Docs: man:sshd(8)
           man:sshd_config(5)
 Main PID: 14515 (sshd)
    Tasks: 1 (limit: 4773)
   Memory: 1.2M
   CGroup: /system.slice/sshd.service
           └─14515 /usr/sbin/sshd -D -oCiphers=aes256-gcm@openssh.com,chacha20-poly1305@openss>

Mar 05 21:14:55 localhost.localdomain systemd[1]: Starting OpenSSH server daemon...
Mar 05 21:14:55 localhost.localdomain sshd[14515]: Server listening on 0.0.0.0 port 22.
Mar 05 21:14:55 localhost.localdomain sshd[14515]: Server listening on :: port 22.
Mar 05 21:14:55 localhost.localdomain systemd[1]: Started OpenSSH server daemon.

由上看到,openssh服務(wù)已經(jīng)啟動,并且偵聽端口為 22。

Visual Studio配置連接

vslinux,Linux札記,linux,服務(wù)器,visual studio,c++

Visual Studio編譯配置

vslinux,Linux札記,linux,服務(wù)器,visual studio,c++
vslinux,Linux札記,linux,服務(wù)器,visual studio,c++
vslinux,Linux札記,linux,服務(wù)器,visual studio,c++

保存后 [輸出] 窗口會有如下信息:

1> 已為配置“x64-Debug (默認(rèn)值)”啟動 CMake 生成。
1> 命令行: “cmd.exe” /c “%SYSTEMROOT%\System32\chcp.com 65001 >NUL && “C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe” -G “Ninja” -DCMAKE_BUILD_TYPE:STRING=“Debug” -DCMAKE_INSTALL_PREFIX:PATH=“D:\MyProTest\MyC++\CMakeTest\out\install\x64-Debug (默認(rèn)值)” -DCMAKE_C_COMPILER:FILEPATH=“C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe” -DCMAKE_CXX_COMPILER:FILEPATH=“C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe” -DCMAKE_MAKE_PROGRAM=“C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe” “D:\MyProTest\MyC++\CMakeTest” 2>&1”
1> 工作目錄: D:\MyProTest\MyC++\CMakeTest\out\build\x64-Debug (默認(rèn)值)
1> [CMake] – Configuring done
1> [CMake] – Generating done
1> [CMake] – Build files have been written to: D:/MyProTest/MyC++/CMakeTest/out/build/x64-Debug (默認(rèn)值)
1> 已提取 CMake 變量。
1> 已提取源文件和標(biāo)頭。
1> 已提取代碼模型。
1> 已提取包含路徑。
1> CMake 生成完畢。

說明配置OK。

編譯代碼

vslinux,Linux札記,linux,服務(wù)器,visual studio,c++
按F6,使用 Linux-gcc-Debug 配置進行編譯代碼,出現(xiàn)一個錯誤:找不到C++編譯器。因此我們需要安裝一個C++編譯器。

如果錯誤是 No CMAKE_CXX_COMPILER could be found.,也是因為沒有安裝C++編譯器導(dǎo)致的。

[root@localhost vspro]# yum install gcc-c++
Last metadata expiration check: 1:10:23 ago on Sun 05 Mar 2023 09:03:07 PM EST.
Dependencies resolved.
                                           
>>>>>>>>>>>>>> 省略部分內(nèi)容顯示 <<<<<<<<<<<<<<
Installed:
  gcc-c++-8.3.1-5.0.1.an8.x86_64             libstdc++-devel-8.3.1-5.0.1.an8.x86_64            

Complete!
[root@localhost vspro]# 

再次編譯代碼:
vslinux,Linux札記,linux,服務(wù)器,visual studio,c++

在遠(yuǎn)程Linux機器上驗證

上面提示生成了一個可執(zhí)行文件CMakeTest文件,所以可以在遠(yuǎn)程Linux上看下在配置的路徑下是否有這個文件。上面在設(shè)置生成路徑的時候路徑為:/home/vspro/,所以我們在這個目錄下搜索。

[root@localhost Linux-GCC-Debug]# find /home/vspro/ -name CMakeTest 
/home/vspro/.vs/CMakeTest
/home/vspro/.vs/CMakeTest/1597f888-7125-4f93-814d-8e7c3dacbecc/out/build/Linux-GCC-Debug/CMakeTest
[root@localhost Linux-GCC-Debug]# cd /home/vspro/.vs/CMakeTest/1597f888-7125-4f93-814d-8e7c3dacbecc/out/build/Linux-GCC-Debug/
[root@localhost Linux-GCC-Debug]# ls -l
total 56
-rw-r--r--. 1 root root 16885 Mar  5 22:16 build.ninja
-rw-r--r--. 1 root root 14290 Mar  5 22:16 CMakeCache.txt
drwxr-xr-x. 6 root root   188 Mar  5 22:16 CMakeFiles
-rw-r--r--. 1 root root  1797 Mar  5 22:16 cmake_install.cmake
-rwxr-xr-x. 1 root root 13408 Mar  5 22:26 CMakeTest
[root@localhost Linux-GCC-Debug]# 

檢查發(fā)現(xiàn)確實有一個 CMakeTest 的可執(zhí)行文件。
執(zhí)行驗證如下:

[root@localhost Linux-GCC-Debug]# ./CMakeTest 
Hello CMake.
[root@localhost Linux-GCC-Debug]# 

執(zhí)行文件后,打印出了代碼中編寫的 Hello CMake. 內(nèi)容。文章來源地址http://www.zghlxwxcb.cn/news/detail-644901.html


好了,Visual Studio連接Linux服務(wù)器編譯CMake項目 的分享完畢,希望幫到你,謝謝閱覽。

到了這里,關(guān)于Visual Studio連接Linux服務(wù)器編譯CMake項目,生成在Linux上運行的程序的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • visual studio 編譯cmake項目

    當(dāng)編譯出現(xiàn)問題 message(FATAL_ERROR \\\"The C compilern ?\\\"${CMAKE_C_COMPILER}\\\"n\\\" ? ? ? \\\"is not able to compile a simple test program.nIt fails \\\" ? ? ? \\\"with the following output:n ?${_output}nn\\\" ? ? ? \\\"CMake will not be able to correctly generate this project.\\\") 控制臺提示如下: 1 已為默認(rèn)配置“x64-Debug”啟動 CMake 生成

    2024年02月06日
    瀏覽(30)
  • C++服務(wù)器框架開發(fā)11——編譯調(diào)試1/cmake學(xué)習(xí)

    C++服務(wù)器框架開發(fā)11——編譯調(diào)試1/cmake學(xué)習(xí)

    該專欄記錄了在學(xué)習(xí)一個開發(fā)項目的過程中遇到的疑惑和問題。 其教學(xué)視頻見:[C++高級教程]從零開始開發(fā)服務(wù)器框架(sylar) 上一篇:C++服務(wù)器框架開發(fā)10——日志系統(tǒng)1~9代碼 學(xué)習(xí)到第6個視頻的00:59,由于不了解編譯,這次先學(xué)習(xí)下cmake。下圖是CMakeLists.txt中的內(nèi)容。 參考自文

    2024年02月16日
    瀏覽(34)
  • vscode(visual studio code) 免密登陸服務(wù)器

    vscode(visual studio code) 免密登陸服務(wù)器

    1.生成密鑰 首先,在本地,打開命令輸入框: Win+R–彈出輸入框,輸入cmd,打開命令框。 然后,在命令框,輸入 按兩次回車鍵,問你是否重寫,選擇y。 接著,輸入兩次回車,即輸入空白密碼,,沒有密碼。 最后,便可以看到,在本地的目錄下,生成了公鑰和私鑰。 選擇畫紅

    2024年01月16日
    瀏覽(23)
  • Visual Studio 2022 取消 Microsoft符號服務(wù)器的方法

    Visual Studio 2022 取消 Microsoft符號服務(wù)器的方法

    最近使用 Visual Studio 2022 調(diào)試時,發(fā)現(xiàn)一直在加載某些DLL文件,造成調(diào)試卡住,等了很久都不正常 點擊取消 符號服務(wù)器的加載,馬上就能正常的進入調(diào)試,好像這個對調(diào)試影響不大 但是每次調(diào)試,都會加載這個:【Microsoft符號服務(wù)器】 菜單欄【工具】-- 【選項】 在搜索欄里

    2024年02月13日
    瀏覽(24)
  • Visual Studio使用Web Deploy發(fā)布.NET Web應(yīng)用到指定服務(wù)器的IIS中

    Visual Studio使用Web Deploy發(fā)布.NET Web應(yīng)用到指定服務(wù)器的IIS中

    今天要講的是在Window 2008 R2版本的服務(wù)器下如何配置Web Deploy并使用Visual Studio進行.NET Web項目發(fā)布部署。 Web Deploy其實主要是為了解決Web應(yīng)用程序和Web站點到IIS服務(wù)器的部署問題,管理員可以使用Web Deploy同步IIS服務(wù)器或遷移到較新版本的IIS。Web Deploy Tool還使管理員和委派用戶能

    2024年01月25日
    瀏覽(23)
  • Goland連接服務(wù)器/虛擬機遠(yuǎn)程編譯開發(fā)

    Goland連接服務(wù)器/虛擬機遠(yuǎn)程編譯開發(fā)

    SSH用于與遠(yuǎn)程服務(wù)器建立連接 Settings - Tools - SSH Configurations 添加新的ssh連接,Host為ip地址,Username為用戶名,認(rèn)證方式這里選擇密碼驗證 全部填完后可以點擊Test Connection測試連接是否成功 Deployment用于構(gòu)建本地與遠(yuǎn)程服務(wù)器的路徑映射 Settings - Build,Execution,Deployment - Deployment 添

    2024年02月06日
    瀏覽(21)
  • SQL Server Management Studio(SSMS)連接服務(wù)器失敗

    SQL Server Management Studio(SSMS)連接服務(wù)器失敗

    情況如下圖所示: step1:打開 SQL Server配置管理器 step2:啟動 SQL SERVER 至此問題就解決了~ 參考博客 SQL Server Management Studio(SSMS)無法連接到服務(wù)器,及解決方案_不支持通過ssms的專用管理員連接-CSDN博客 文章瀏覽閱讀1.5w次,點贊13次,收藏48次。很多初次使用SSMS的小伙伴,由

    2024年04月27日
    瀏覽(32)
  • Linux環(huán)境編譯服務(wù)器中修改python版本方式

    Linux環(huán)境編譯服務(wù)器中修改python版本方式

    一、系統(tǒng)級修改 1、用whereis python查看服務(wù)器中存在的python 版本 2、刪除原有的python版本環(huán)境 3、切換python 版本 4、查看python 版本 二、用戶級修改 1、查看home/username目錄下有沒有以下兩個隱藏文件 如果沒有上面兩個文件,從?/etc/skel/目錄拷貝.bashrc、.profile兩個文件到home/user

    2024年02月09日
    瀏覽(97)
  • linux服務(wù)器連接github

    使用 ssh-keygen 生成密鑰 -t 表示生成的密鑰的類型,通常生成 rsa 類型的秘鑰 -b 表示生成的密鑰的長度,通常使用 2048 或 4096 -f 表示指定密鑰對文件生成的位置,Linux下通常生成到``/.ssh/my_key , my_key`表示秘鑰對文件的名字,可以根據(jù)情況自行修改 例如,我要創(chuàng)建一個連接git

    2024年02月12日
    瀏覽(89)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包