Common software installation methods under Linux

1. Linux source installation

1. Unzip the source package file

The source package is usually archived with the tar tool and then compressed with gunzip or bzip2. The suffix formats will be .tar.gz and .tar.bz2 respectively. The decompression methods are as follows:

#tar -zxvf File.tar.gz
#tar -jxvf File.tar.bz2

2. Switch to the decompressed directory

#cd File

3. Prepare for compilation

Before starting to install the service, you need to execute the configure script, which will automatically perform a series of evaluations on the current system, such as source files, software dependent libraries, compilers, assemblers, linker checks, etc. If necessary, you can also use - The prefix parameter specifies the installation path of the program, and when the script checks that the system environment meets the requirements, a Makefile will be generated in the current directory.

#./configure -prefix=/usr/local/program

4. Generate the installer

The Makefile file generated in the previous step will save the installation rules of the system environment dependencies. Next, you need to use the make command to use the appropriate SHELL to compile all the dependent source code according to the rules provided by the Makefile file, and then the make command will generate a final executable. installer.

#make

5. Install the service program

If the -prefix parameter is not used in the configure script phase, the program will normally be installed by default into the /usr/local/bin directory.

#make install

2. RPM package installation

Common command combinations:

-qa:查询安装包
-ivh:安装显示安装进度
-Uvh:升级软件包--Update
-e:删除包
--force 强制操作 如强制删除等
--requires 显示该包的依赖关系
--nodeps 忽略依赖关系并继续操作

1. Installation

#rpm -ivh 需要安装的软件包名

2. Upgrade

#rpm -Uvh 需要升级的软件包名

3. Uninstall

#rpm -e 需要卸载的软件包名

Note: If other programs depend on the package to be uninstalled, the system will prompt that it cannot be deleted. If you need to force deletion and add --nodeps, it will be forcibly deleted, but it may cause the software that depends on it to fail to run.

4. View installed

#rpm –qa 软件包名

5. View the specified package

#rpm -qa | grep "软件或者包的名字"

Three, yum installation

1. Installation

#yum install 软件名

2. Upgrade

#yum update 软件名

3. Delete

#yum remove 软件名

4. View

#yum info 软件名

5. Search software

#yum search 软件

6. View dependencies

#yum deplist 软件

7. View installed software

#yum list installded

List of yum command parameters:

-e 静默执行
-t 忽略错误
-R [分钟] 设置等待时间
-y 自动应答yes

Other common options

- upgrade 升级系统
- check-update 检查可更新的包
- clean all 清除全部
- clean packages 清除临时包文件(/var/cache/yum 下文件)
- list installed 已安装的包
- reinstall[RPM包] 重新安装包

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325268959&siteId=291194637