原文发布于公众号 执无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,可升级软件列表