原文發布于公眾號 執無zhiwu
首先確保你安裝了ssh服務,然后拿到要訪問服務器的ip地址,如果是云服務器就是公網ip地址。
進入控制臺輸入:ssh 用戶名@公網ip地址,然后會提示輸入密碼,輸入密碼后回車,即可成功訪問。
snap是linux中的一種包管理器,跟macOS中homebrew類似,跟apt功能基本一致。
用snap安裝ruby:
snap --help,查看snap的命令
snap info ruby,查看ruby版本
name: ruby
summary: Interpreter of object-oriented scripting language Ruby
publisher: Ruby core team (rubylang?)
contact: info@ruby-lang.org
license: BSD-2-Clause OR Ruby
description: |
Ruby is an interpreted object-oriented programming language often used for web
development. It also offers many scripting features to process plain text and
serialized files, or manage system tasks. It is simple, straightforward, and
extensible.
snap-id: RjAgguCDAawLSJ3IByPe0R92xlNtrfGt
channels:
stable: 2.6.5 2019-10-04 (160) 26MB classic
candidate: ↑
beta: ↑
edge: 2.6.5 2019-10-04 (161) 26MB classic
2.6/stable: 2.6.5 2019-10-04 (160) 26MB classic
2.6/candidate: ↑
2.6/beta: ↑
2.6/edge: ↑
sudo snap install ruby --channel=2.6/stable --classic,安裝指定版本
sudo snap install ruby,安裝默認版本
軟件包安裝完在/snap目錄下
用apt安裝ruby:
sudo apt install ruby,安裝ruby
sudo apt install ruby=2.6.5,安裝指定版本ruby
sudo apt update,更新可用軟件包
apt list --upgradable,可升級軟件列表