Home >System Tutorial >LINUX >Various software package installation methods on Ubuntu Linux system
Ubuntu should be the most popular Linux desktop system at present. This section will introduce several methods of software installation on UbuntuLinux system.
The following will introduce four software installation methods: apt software package management tool, direct installation of deb software package, green software package installation, and bundle software installation package.
apt package management
apt is the abbreviation of AdvancedPackagingTool, which is used to install, update, and delete deb software packages on Linux distributions such as Ubuntu and Debian.
apt is a CS-structured system Linux formatted hard disk, which stores managed deb software packages on its server side. When a user needs to install or upgrade a certain software package, the client installed on the laptop will download the software package and all its dependencies from the server and install it.
The command format of apt is as follows:
<code class="hljs cmake vditor-linenumber" style="max-height:1338px">apt [<span class="hljs-keyword">install</span> | <span class="hljs-keyword">remove</span> | search ...] 软件包名称 <span class="vditor-linenumber__rows"><span></span></span></code>
Search for software packages about jdk-17 below:
The following is to install the openjdk-17-jdk software package:
In fact, we only install the openjdk-17-jdk software package, but apt will manually install the dependent software packages together, and a total of 20 new software packages will be installed.
apt will install jdk to the /usr/lib/jvm directory.
The following is to delete the openjdk-17-jdk software package:
The remove command will only delete openjdk-17-jdk itself, not all its dependencies. Therefore, after executing the remove command, the jdk is not uninstalled "cleanly".
In order to delete all dependencies of openjdk-17-jdk, you need to execute the autoremove command again:
After executing the autoremove command, all jdk-related software packages will be deleted.
The use of the apt command is introduced here, but another thing worth paying attention to is the software source of apt.
In general, it is best to use foreign apt software sources, which can make us install software faster. I usually use Alibaba Cloud's apt software source. For the specific method of switching apt software source, please refer to the link below:
<code style="max-height:1338px" class="hljs apache vditor-linenumber"><span class="hljs-attribute">https</span>://developer.aliyun.com/mirror/ubuntu?spm=a<span class="hljs-number">2</span>c<span class="hljs-number">6</span>h.<span class="hljs-number">13651102</span>.<span class="hljs-number">0</span>.<span class="hljs-number">0</span>.<span class="hljs-number">3</span>e<span class="hljs-number">221</span>b<span class="hljs-number">118</span>t<span class="hljs-number">6</span>URV <span class="vditor-linenumber__rows"><span></span></span></code>
Install deb package directly
Although it is very convenient to use apt to install softwarelinux installation ubuntu software center, many software manufacturers' deb installation packages are not entrusted to apt management, such as Baidu Cloud Disk. For this type of software, we can only download the deb software package from its official website and install it ourselves.
The installation of the deb software package is also relatively simple. If you are using the Ubuntu desktop system, you only need to right-click and select the Softwareinstall application to open the deb software installation package:
打开deb软件安装包的界面如右图所示linux装ubuntu软件中心,再点击install按键就可以启动安装流程了:
假如你没法登陆桌面环境,也可以在命令行中使用dpkg命令执行安装流程。dpkg的命令格式如下:
<code style="max-height:1338px" class="hljs nginx vditor-linenumber"><span class="hljs-attribute">dpkg</span> -I xxx.deb<span class="hljs-comment"># info,查看软件包<u>信息</u></span> dpkg -i xxx.deb<span class="hljs-comment"># install,安装软件包</span> dpkg -r xxx<span class="hljs-comment"># remove,卸载一个软件包</span> dpkg -P xxx <span class="hljs-comment"># purge,完全清除一个软件包</span> <span class="hljs-comment"># remove只是删掉数据和可执行文件,purge另外还删除所有的配置文件</span> <span class="vditor-linenumber__rows"><span></span><span></span><span></span><span></span><span></span><span></span></span></code>
查看百度云盘deb软件安装包信息:
安装百度云盘:
卸载百度云盘,注意这儿用的名子不是安装包的文件名:
卸载百度云盘,并消除与其相关的配置文件:
红色软件安装
红色软件统称可携式软件,是指这些无需安装,解压能够直接使用的软件。
比如IntelliJIDEA这款开发工具,为Linux平台提供的软件就是一个.tar.gz格式的压缩包,而不是deb安装包:
将这个压缩包下载然后直接对其解压:
在其解压目录的bin子目录下有一个名叫idea.sh的可执行文件,直接执行idea.sh就可以启动IDEA了:
尽管IDEA的安装过程很简单,但每次启动IDEA都须要执行一个shell脚本就有点麻烦了。我们希望它还能在桌面有一个启动图标,我们点击那种启动图标就可以启动IDEA。
Ubuntu的桌面图标配置文件都置于/usr/share/applications目录下,为了给IDEA创建一个桌面启动图标linux查看操作系统,我们在该路径下创建一个名为idea.desktop的文件,并在该文件中输入如下内容:
<code style="max-height:1338px" class="hljs gradle vditor-linenumber"><span class="hljs-number">1</span>[Desktop Entry] <span class="hljs-number">2</span>Name=Idea <span class="hljs-number">3</span>Comment=idea <span class="hljs-number">4</span>Exec=sh ~<span class="hljs-regexp">/prog<u>ram</u>/i</span>dea-IU-<span class="hljs-number">231.8109</span>.<span class="hljs-number">175</span><span class="hljs-regexp">/bin/i</span>dea.sh <span class="hljs-number">5</span>Icon=~<span class="hljs-regexp">/program/i</span>dea-IU-<span class="hljs-number">231.8109</span>.<span class="hljs-number">175</span><span class="hljs-regexp">/bin/i</span>dea.png <span class="hljs-number">6</span><u>Te</u>rminal=<span class="hljs-keyword">false</span> <span class="hljs-number">7</span>Type=Application <span class="hljs-number">8</span>Categories=Application; <span class="vditor-linenumber__rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code>
然后就可以在showApplications见到IDEA的启动图标,点击该图标就可以启动IDEA软件了:
bundle软件安装包
最后一类是.bundle格式的软件安装包,.bundle文件是Linux系统中的一种可执行文件,可以类比Windows系统中的.exe文件。
比如常用的虚拟机软件VMware为Linux平台提供的软件安装包就是.bundle的格式。
我们从VMware官网下载的安装包文件名为:
<code style="max-height:1338px" class="hljs apache vditor-linenumber"><span class="hljs-attribute">VMware</span>-W<u>or</u>kstation-Full-<span class="hljs-number">17</span>.<span class="hljs-number">0</span>.<span class="hljs-number">0</span>-<span class="hljs-number">20800274</span>.x<span class="hljs-number">86</span>_<span class="hljs-number">64</span>.bundle <span class="vditor-linenumber__rows"><span></span></span></code>
下载完成后,为该文件降低x权限并执行安装流程:
.bundle文件执行完成后,VMware应用就安装完成了,可以在showApplications中看见与VMWare相关的3个应用:
假如想要卸载VMware,可以执行下边的命令:
<code style="max-height:1338px" class="hljs nginx vditor-linenumber"><span class="hljs-attribute">sudo</span> vmware-installer -u vmware-workstation <span class="vditor-linenumber__rows"><span></span></span></code>
The above is the detailed content of Various software package installation methods on Ubuntu Linux system. For more information, please follow other related articles on the PHP Chinese website!