手动安装应用,以Sublime为例

因为apt上没有源,所以从官网上下载的压缩包是需要手动部署到应用程序列表中的。
简单讲分为以下几个步骤:
1、解压缩、移动到环境变量中
下载下来的文件为tar.gz2格式的,解压缩以后将整个文件移动到/opt目录下。
sudo mv sublime_text_3 /opt/

2、建立环境变量的链接文件
sudo ln -s /opt/sublime_text_3/sublime_text /usr/bin/sublime
这里用到了ln命令进行链接,第一个参数为源程序的可执行路径,第二个参数为链接过去的名称。以后在命令行中可以使用简写的sublime启动程序

3、添加程序图标到应用程序列表中
参考提供的 xxx.desktop文件进行编辑,并保存到applications目录
sudo sublime /usr/share/applications/sublime.desktop

sublime.desktop文件示例如下:

[Desktop Entry]
Version=1.0
Type=Application
Name=Sublime Text
GenericName=Text Editor
Comment=Sophisticated text editor for code, markup and prose
Exec=/opt/sublime_text_3/sublime_text %F
Terminal=false
MimeType=text/plain;
Icon=sublime-text
Categories=TextEditor;Development;
StartupNotify=true
Actions=Window;Document;
[Desktop Action Window]
Name=New Window
Exec=/opt/sublime_text_3/sublime_text -n
OnlyShowIn=Unity;
[Desktop Action Document]
Name=New File
Exec=/opt/sublime_text_3/sublime_text --command new_file
OnlyShowIn=Unity;```

你可能感兴趣的:(手动安装应用,以Sublime为例)