如何在Linux中安装Atom文本编辑器

时间:2020-03-05 15:27:47  来源:igfitidea点击:

Linux有一些流行的文本编辑器,列表中的一个是atom。
Atom是一个高级开源文本和基于电子的源代码编辑器,并由GitHub开发。

Atom是一个多平台编辑工具,适用于OS X,Windows或者Linux。
这将是程序员的最佳工具,因为它支持智能自动完成,文件系统浏览器和将拆分原子接口分成多个窗格。
查找/替换文件或者所有项目是此工具的另一个很好的功能。

在本文中,将介绍如何在Ubuntu 18.04,CentOS 7和Arch Linux上安装Atom。

1)下载atom

atom可以被下载为包或者来自源。
实际上,最新的稳定版本是1.27.0,Beta版本是1.28.0,我们可以查找适合我们直接到GitHub站点的版本

在Ubuntu 18.04上,我们可以如下下载:

#  wget https://github.com/atom/atom/releases/download/v1.27.0/atom-amd64.deb
--2016-05-16 02:05:48-- https://github.com/atom/atom/releases/download/v1.27.0/atom-amd64.deb
Resolving github.com (github.com)... 192.30.253.112, 192.30.253.113
Connecting to github.com (github.com)|192.30.253.112|:443... connected.
HTTP request sent, awaiting response... 302 Found

在CentOS 7上如下

# wget https://github.com/atom/atom/releases/download/v1.27.0/atom.x86_64.rpm
--2016-05-16 02:09:07-- https://github.com/atom/atom/releases/download/v1.27.0/atom.x86_64.rpm
Resolving github.com (github.com)... 192.30.253.113, 192.30.253.112
Connecting to github.com (github.com)|192.30.253.113|:443... connected.
HTTP request sent, awaiting response... 302 Found

2)安装atom

现在我们已经下载了原子,我们可以安装它

a)在Arch Linux 2016上

在Arch Linux 2016上,Atom可以通过Pacman命令直接下载

# pacman -Sy atom
:: Synchronizing package databases...
 archlinuxfr is up to date
 core is up to date
 extra is up to date
 community is up to date
resolving dependencies...
....
....
:: Proceed with installation? [Y/n] y

b)在Ubuntu 18.04上

从DEB包安装

转到下载DEB包的文件夹,然后使用DPKG命令

# dpkg -i atom-amd64.deb 
(Reading database ... 134620 files and directories currently installed.)
Preparing to unpack atom-amd64.deb ...
Unpacking atom (1.27.0) over (1.27.0) ...
Setting up atom (1.27.0) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3) ...
Processing triggers for mime-support (3.60ubuntu1) ...

从Snap

我们还可以通过ubuntu 18.04上的Snap来安装Atom。
首先,我们需要安装Snapd软件包

# apt install snapd
Reading package lists... Done
Building dependency tree 
Reading state information... Done
The following packages were automatically installed and are no longer required:
 gconf-service gconf-service-backend gconf2 gconf2-common libgconf-2-4
 libpython-stdlib python python-minimal python2.7 python2.7-minimal

现在,我们可以通过Snap安装Atom。
我们应该注意到在编写本文时捕捉Atom的可用版本,是1.26.1

# snap install --classic atom
Download snap "atom" (150) from channel "stable"     88%  175kB/s 1m41s
atom 1.26.1 from 'snapcrafters' installed

c)在CentOS 7上

在CentOS 7 Atom需要一些要安装的依赖项,我们需要使用yum命令安装.rpm包之前下载

# yum install atom.x86_64.rpm 
Loaded plugins: fastestmirror
Examining atom.x86_64.rpm: atom-1.27.0-0.1.x86_64
Marking atom.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package atom.x86_64 0:1.27.0-0.1 will be installed
--> Processing Dependency: lsb-core-noarch for package: atom-1.27.0-0.1.x86_64
...
...
Total size: 506 M
Total download size: 3.1 M
Installed size: 511 M
Is this ok [y/d/N]: y

3)启动atom

现在安装了Atom,我们可以启动它

现在,我们可以选择原子并开始使用它

现在我们已安装Atom,我们可以尝试此工具提供的每个功能。