Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and uninstall software under Linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to install and uninstall software under Linux. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

There are many forms of linux software installation and uninstallation, which can be installed and uninstalled in binary form and source code form.

Installation and uninstallation of binary distribution package

The binary distribution of Linux software refers to the distribution form of a software package that has been compiled in binary form beforehand. Its advantage is that it is easy to install and use, but its disadvantage is the lack of flexibility. If the package is compiled for a specific hardware / operating system platform, it cannot be executed correctly in another platform or environment.

1. Binary software package in the form of * .rpm

Description: RPM (RedHat Packge Manager) is the software package manager of RedHat company, it can be easily used to install, upgrade, uninstall, verify, query and other operations on the rpm form of software packages, easy to install, and uninstall the software in multiple directories when the files can be deleted clean. .rpm is the file name of the software package (where .rpm refers specifically to files other than * .src.rpm with the suffix rpm)

Rpm common parameters:-ivh: installation shows installation progress [install--verbose-hash]-Uvh: upgrade package [Update];-qpl: list file information in RPM package [Query Package list];-qpi: list RPM package description information [Query Package install package (s)];-qf: find out which RPM package the specified file belongs to [Query File];-Va: verify all RPM packages and find missing files [View Lost] -e: delete package

2. Binary software package in the form of * .tar.gz/*.tgz, * .bz2

Description: .tar.gz / .bz2 form of binary software package is packaged with tar tools, compressed with gzip/bzip2, and can be unpacked directly during installation. For software with only a single directory after decompression, uninstall with the command "rm-rf software directory name"; if the files are scattered in the directory, you must delete them one by one. If you want to know which files are installed in the system when unpacking, you can use the command "tar-ztvf * .tar.gz" / "tar-jtvf * .bz2" to get the list. The parameter z of tar is to call gzip to extract, x is to unpack, v is to check, f is to display the result, j is to call bzip2 to extract, and t is the list of files to list the package.

Install: tar-zxvf * .tar.gz or tar-jxvf * .bz2 Uninstall: manually remove

Provides a software package for the installer

This type of software package already provides installation scripts or binary installation wizards (setup, install, install.sh, etc.), which can be installed simply by running it; and the uninstall script or program is provided accordingly. And provide anti-installation function after the software installation, at present, this type of software package is still relatively few.

Installation and uninstallation of source code distribution package

The source code distribution of Linux software provides the release form of all the program source code of the software, which requires users to compile and install the executable binary code themselves, and compile and install according to the different application environment. The configuration is flexible, some functions / modules can be removed or retained at will, and it is difficult to adapt to a variety of hardware / operating system platforms and compilation environments.

1. Source code package in the form of * .src.rpm

Install: rpm-rebuild * .src.rpm cd / usr/src/dist/RPMS rpm-ivh * .rpm Uninstall: rpm-e packgename

Description: the rpm-rebuild * .src.rpm command compiles the source code and generates a binary rpm package under / usr/src/dist/RPMS, and then installs the binary package. Packgename as mentioned earlier, the two methods are as follows:

1:rpm-I your-package.src.rpmcd / usr/src/redhat/SPECSrpmbuild-bp your-package.specs # A specs file cd / usr/src/redhat/BUILD/your-package/ # with the same name as your software package and a directory with the same name as your software package. / configure # this step is the same as compiling ordinary source software You can add the parameters makemake instal method 2:rpm-I you-package.src.rpm cd / usr/src/redhat/SPECS # the first two steps and method one the same rpmbuild-bb your-package.specs # an specs file with the same name as your package is now in / usr/src/redhat/RPM/i386/ (depending on the specific package, it may be i686 rpm, etc.) in this directory, there is a new rpm package, this is the compiled binary file. Rpm-I new-package.rpm can be installed.

2. Source code package in the form of * .tar.gz/*.tgz, * .bz2

Install: tar-zxvf * .tar.gz or tar-jxvf * .bz2 and then enter the directory after decompression: configuration:. / configure compilation: make installation: make install

Note: it is recommended to read the documentation after decompression to understand the requirements of the installation and to change the compilation configuration if necessary. The source code of some software packages can be uninstalled with the make uninstall command after compilation and installation, and if this feature is not provided, the uninstall of the software must be removed manually. As the software may be installed in multiple directories of the system, it is often difficult to delete it clean, then you should configure before compilation, specify that the software will be installed to the target path:. / configure-prefix= directory name, so that you can use the "rm-rf software directory name" command to clean and thoroughly uninstall. Compared with other installation methods, it is the most difficult for users to compile and install by themselves.

Decompress the source package: [root@Mylinux ~] # tar-zxvf zip-2.3-27.tar.gz (or tar-jzxf zip-2.3-27.tar.bz2) enter the directory of the decompressed source package, and install: [root@Mylinux ~] # cd zip-2.3-27 [root@Mylinux zip-2.3-27] #. / configure-- prefix=.... & & make & & make install uninstall source code package: [root@Mylinux zip] # make uninstall this article on "how to install and uninstall software under Linux" ends here. I hope the above content can be helpful to you so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report