Ubuntu 16.04下tar.bz2格式软件安装方法(含Sublime Text)
Hey there! Let's break down how to install software packaged as .tar.bz2 on Ubuntu 16.04, with a step-by-step guide specifically for Sublime Text since that's your priority.
General Workflow for
.tar.bz2 Files First, a quick overview of the typical process for most software in this format—though note some apps (like Sublime) skip the compilation step:
- Extract the archive: Use the
tarcommand to unpack the file. The standard syntax is:
Let's break down the flags:tar -xjvf your-file-name.tar.bz2x= extract,j= handle bzip2 compression,v= verbose (shows progress),f= specify the archive file. - Check for installation instructions: Always look for a
READMEorINSTALLfile in the extracted directory. Runcat READMEorcat INSTALLto see if the app requires special steps (like compiling withconfigure/make). - Install (if needed): For compiled software, you'll usually run:
But many pre-built apps (like Sublime) just need to be moved to a system directory and set up with shortcuts../configure make sudo make install
Step-by-Step: Install Sublime Text from
.tar.bz2 Sublime Text is a pre-built binary, so no compilation is required—here's how to get it set up properly:
- Download the correct archive: Grab the Ubuntu 64-bit (or 32-bit if your system is 32-bit)
.tar.bz2package (pick a version compatible with Ubuntu 16.04—Sublime Text 3 builds up to 3211 work well). - Extract the archive: Open a terminal, navigate to the directory where you downloaded the file, and run:
(Replace the filename with the exact name of your downloaded file.)tar -xjvf sublime_text_3_build_3211_x64.tar.bz2 - Move the folder to a system directory: We'll use
/opt—this is the standard location for third-party system-wide apps:sudo mv sublime_text_3 /opt/ - Create a desktop shortcut: This lets you launch Sublime from your applications menu. Create a
.desktopfile with:
Paste this content into the editor:sudo nano /usr/share/applications/sublime-text.desktop
Save and exit by pressing[Desktop Entry] Version=1.0 Type=Application Name=Sublime Text Comment=Sophisticated text editor for code, markup and prose Exec=/opt/sublime_text_3/sublime_text Terminal=false Icon=/opt/sublime_text_3/Icon/48x48/sublime-text.png Categories=TextEditor;Development; StartupNotify=trueCtrl+O, hitting Enter, thenCtrl+X. - Add a terminal shortcut: For quick access from the command line, create a symbolic link:
Now you can open any file or folder directly by runningsudo ln -s /opt/sublime_text_3/sublime_text /usr/local/bin/sublsubl filenameorsubl /path/to/folder.
That's it! Sublime Text should now show up in your applications list and be accessible from the terminal. For other .tar.bz2 apps, just follow the general workflow above and check their specific README for any extra steps.
内容的提问来源于stack exchange,提问作者BlindCoder
相关产品推荐
相关产品推荐

