Installation and uninstallation of software in Linux (command line mode)

Source: Internet
Author: User
Tags unpack

In Linux, apart from binary software distribution, there are also software packages in the form of source code. Let's talk about the installation and uninstallation of these software:

I. Installation and uninstallation of binary distribution software packages
The binary distribution of Linux software refers to the release form of a compiled binary software package. Its advantage is that it is easy to install and use, and its disadvantage is that it lacks flexibility, if the software package is compiled for a specific hardware/operating system platform, it cannot be correctly executed on another platform or environment.
1. * binary software package in RPM format
Install: rpm-IVH *. RPM upgrade: rpm-uvh *. RPM uninstall: rpm-e packgename
Note: rpm (RedHat packge manager) is a software package manager provided by RedHat. It can be used to install, upgrade, uninstall, verify, and query software packages in RPM format, the installation is simple. When you uninstall the software, you can also delete the files installed in multiple directories. In RPM parameters,-I is the installation,-V is the verification, and-H is the use of hashes to display the installation progress ,*. rpm is the file name of the software package (here *. RPM refers *. SRC. files other than rpm with the suffix rpm); parameter-E is to delete the software package.
2. Binary packages in the form of * .tar.gz/*. tgz and *. bz2
Installation: Tar zxvf * .tar.gz or tar yxvf *. bz2
Uninstall: manually delete
Note: The binary software package in the form of * .tar.gz/*. bz2 is packaged with the tar tool and compressed with gzip/Bzip2. You can unpack the package directly during installation. For software that only has a single directory after decompression, run the "RM-RF Software Directory Name" command when uninstalling the software. If the extracted files are scattered in multiple directories, manually delete them one by one, if you want to know which files are installed in the system during decompression, run the "Tar ztvf * .tar.gz"/"Tar ytvf * command *. bz2 "to get the list. The tar Parameter Z is to call gzip for decompression, X is to unpack, V is to verify, F is to show the result, Y is to call Bzip2 for decompression, and T is to list the file list of the package.
3. provide software packages for the installation program
These software packages provide installation scripts or binary Installation Wizard programs (setup, install, install. sh, etc.), you only need to run it to complete the software installation; while the uninstallation also provides a script or program for reverse installation. In addition, the anti-installation function is provided after the software is installed. Currently, this type of software package is relatively small.

Ii. Installation and uninstallation of source code distribution software packages
The source code distribution of Linux software refers to the release form of the source code of all programs of the software. You need to compile and install the executable binary code on your own. The advantage is that the configuration is flexible, some functions/modules can be removed or retained at will to adapt to a variety of hardware/operating system platforms and compiling environments. The disadvantage is that it is difficult and is generally not suitable for beginners.
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
Note: The rpm -- rebuild *. SRC. RPM command compiles the source code and generates a binary RPM package under/usr/src/Dist/RPMs. then install the Binary Package. Packgename is described above.
2. Source Code packages in the form of * .tar.gz/*. tgz and *. bz2
Install: Tar zxvf * .tar.gz or tar yxvf *. bz2. decompress the package and enter the decompressed directory:
./Configure Configuration
Make Compilation
Make install Installation
Uninstall: Make uninstall or manually delete
Note: It is recommended that you decompress the package and read the instruction file to learn about the installation requirements and modify the compilation configuration when necessary. The source code of some software packages can be uninstalled by using the make install command after compilation and installation. If this function is not provided, the software must be manually deleted. Because the software may install files in multiple directories of the system, it is often difficult to delete the files, you should configure them before compilation, specify the path to which the software will be installed :. /configure -- prefix = directory name. In this way, you can run the "RM-RF Software Directory Name" command to thoroughly uninstall the directory. Compared with other installation methods, it is the most difficult to compile and install by yourself.

How to import unofficial library addressesCheck whether LS-L/etc/yum. Repos. d/Dag. Repo exists. If not, import the following content to VI/etc/yum. Repos. d/Dag. Repo: [Dag]
Name = Dag RPM repository for Red Hat Enterprise Linux
Baseurl = http://apt.sw.be/redhat/el?releasever/en/?basearch/dag
Gpgcheck = 1
Enabled = 1 then, to import the GPG's check file wget http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txtrpm -- import RPM-GPG-KEY.dag.txt Add epel software repository (rpmforge, rpmfusion) for centos/RHEL)Centos was compiled by RHEL and removed all copyright issues. Therefore, many software cannot be directly installed using Yum install without using a third-party software library. The RedHat Fedora Project has an epel (extra packages for Enterprise Linux), which is a third-party software warehouse for RHEL and fedora. It is very simple to install epel. The official address is release. After Yum install Yum-priorities is installed, edit/etc/yum. repos. d/directory. repo-related files (such as CentOS-Base.repo), insert the sequence command at the end of each segment of these files: Priority = n (n is a positive integer from 1 to 99, the smaller the value, the higher priority)

Generally, [base], [Addons], [updates], and [extras] end with priority = 1 [centosplus], [contrib] add priority = 2 to the end of the third software source and add priority = n (n> 10) 2. download and install the epel RPM package

(1) download and install the epel RPM package

32-bit system Su-C' rpm-uvh running (2) import PGP keyrpm-import/etc/pki/rpm-GPG/RPM-GPG-KEY-EPEL (3) to Dag settings/etc/yum. repos. d/epel. the source level in the repo file is to add priority = 11 to edit this file. Add priority = 113 at the end of the [epel] segment. rpmforge-installed RPM file package rpmforge library now has more than 10000 centos software packages. The entos community considers it the safest and most stable third-party software library. (1) download the rpmforge RPM file package

32-bit system wget sans http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm (2) install Dag's PGP keyrpm-import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt (3) Verify rpmforge's RPM file package rpm-K rpmforge-release-0.5.1-1.el5.rf. *. RPM (4) install the RPM file package rpm-I rpmforge-release-0.5.1-1.el5.rf for rpmforge. *. RPM (5) setting/etc/y The source level in the Um. Repos. d/rpmforge. Repo file is to add priority = 12. Edit this file by adding priority = 124 at the end of the [rpmforge] segment. install rpmfusion's RPM file package (optional) centos officially said the software in this software library is not as stable as rpmforge, enter Su-C 'yum install foo' after installing epel and then centos 5 enter the following command Su-C' rpm-uvh http://download1.rpmfusion.org/free/el/updates/testing/5/i386/rpmfusion-free-release-5-0.1.noarch.rpm limit 6 enter the following command Su-C- c 'rpm-uvh http://download1.rpmfusion.org/free/el/updates/testing/6/i386/rpmfusion-free-release-6-0.1.noarch.rpm unzip rpm-e rpmfusion *
If header V3 DSA Signature: nokey is caused by the old version of GPG keys installed in yum, the solution is rpm -- import/etc/pki/rpm-GPG/RPM *----------------------------------- Comparison of File System formats: ext4, ext3, JFS, XFS, and reiserfsAfter reading many tests, both Reading and Writing large and small files, I feel that there is still a lack of practical application tests. The tests in the actual production environment can explain the problem. In terms of writing, ext4> ext2> reiserfs> ext3> JFS> XFS ext2> ext3> ext4> JFS> XFS> reiserfs actual application JFS = ext4> XFS> reiserfs> ext3> ext2 ----------------------------------- Debian Common commandsWhen installing Debian, You need to mirror the official software package. The/etc/APT/sources. list file can be used to obtain the relevant site.
. If you want to install a software package, use the apt and dpkg commands.
Apt
The advanced packaging tool is an advanced interface of the Debian software package management system. It consists of several programs named as "apt. Apt-Get, Apt-cache, Apt-CDROM, and apt-config are command line tools used to process software packages. They are also the backend of other user foreground programs, such as dselect and aptitude.
Apt-Get update: update package list from/etc/APT/source. List
Apt-cache search-string description, such as the search-string Software Package
Apt-Cache Policy Package-Name displays the package version and priority.
Apt-Cache show package-Name: displays the description of the file.
Apt-Cache showpkg package-name shows the dependency of the software package.
Apt-Get install package-name install the package from the source and all its dependent packages
Apt-Get upgrade: update the currently installed software package to the latest version.
We can see that some packages prevent updates (kept back)
Apt-Get dist-Upgrade
For example, Apt-Get upgrade will automatically resolve the conflict.
Apt-Get remove package-names
Apt-Get -- purge remove permanently deletes these packages and their configuration files
Apt-Get -- purge remove gnome-panel Nautilus +
When you delete a software package, if the package name is followed by a "+", the software package will be installed rather than deleted.
Apt-Cache depends package-names: list all dependent packages of a specified package
Apt-Cache rdepends package-names list all packages dependent on a given package
Apt-file upgrade: update the content list from the source
Apt-file search file-Name: Find the software package containing the file
Apt-file search package-Name: list the content of the package
Auto-Apt
If you need to install the software package automatically, you can replace apt-file and install auto-apt.
Aptitude apt console interface, you need to install Aptitude
Synaptic apt GUI interface, you need to install synaptic
Apt-Get clean
Delete the downloaded software package stored in the cache directory (/var/Cache/APT/archives.
The/var/Cache/APT/archives directory and all files under the/var/Cache/APT/archives/partial directory will be deleted, except the locked files. When you install a software package again, APT will download it again.
Apt-Get autoclean only deletes files that do not need to be downloaded again.
After selecting the software package in dselect, run:
Apt-get-u dselect-Upgrade
Compare the situation with that of APT-Get dist-upgrade.
You can see that many software packages installed in idea are the result of "recommended" or "recommended" of other software packages. Other software packages are installed or deleted by the dselect tool. It can be seen that the combination of dselect and APT will be a powerful tool.
Apt-Get -- reinstall install
Apt-Get check: download the software package database from the default server
Apt-Get upgrade package_name: Upgrade the specified software package, and upgrade the dependent Software Package apt-Cache showpkg package_name to display some general information about the software package. APT-Cache stats displays related statistics.
Apt-Cache dump displays brief descriptions of each software package in the cache
Apt-Cache unmet displays inconsistent dependencies.
Apt-Cache Show Displays the record information of the specified software package, similar to rpm-Qi
Apt-cache search software package
Apt-Cache depends displays the dependency of the software package.
Apt-Cache pkgnames list all software packages
Apt-config apt-config dump displays the current configuration information.
Apt-Get install Nessus-server automatically downloads and installs dependency packages
Apt-Get source package_name download package source rpm
Dpkg
It is the main tool for operating software package files;
Dpkg evolved from several original AIDS.
· Dpkg-DEB: operation. Deb file. Dpkg-DEB (1)
· Dpkg-FTP: an old software package command. Dpkg-FTP (1)
· Dpkg-mountable: an old software package command. Dpkg-mountable (1)
· Dpkg-split: splits large software packages into small packets. Dpkg-Split (1)
Dpkg-L [names] listing software packages
Dpkg-I PKG. Deb displays information about the software package.
Dpkg-c pkg. Deb list the content of the package
Dpkg-s filename shows which package contains this file
Dpkg-I PKG. Deb installation package
Deborphan shows that there are no dependent (orphan) software packages, and deborphan needs to be installed
Debsums audit installed software reports, need to install debsums
Dpkg-Divert [Option] File override the version of a software package
Dpkg -- Compare-versions V1 GT V2 comparison version, with ECHO $? Check
Dpkg-query-w -- showformat = format to query installed software packages. The format is '$ '.
Dpkg -- Get-selections writes the selected software package to a file
Dpkg -- Set-selection select aptitude update to update the list of available packages from the file read package
Available packages for aptitude upgrade
Aptitude dist-Upgrade: upgrade the system to the new release
Aptitude install pkgname installation package
Aptitude remove pkgname Delete package
Aptitude purge pkgname: Delete the package and its configuration file
APTITUDE search string SEARCH package
Aptitude show pkgname displays the package details
Aptitude clean: delete downloaded package files
Aptitude autoclean only deletes expired package file upgrade commands aptitude Update & aptitude upgrade -----------------------------------
VI Vim usageVim has three working modes
Command mode, used to input commands (use the ESC key to switch)
Insert mode, used to insert text
Visual mode, used to highlight the video and select the body Save and exit 
: W save
: Q! Do not save and exit
: W filename Save As filename
: WQ! Save and exit
: WQ! Filename Note: Save the file name as filename and exit.
Save and exit. Function and: WQ! The same 3.5 insertion mode (text insertion)
Enter insert mode 
I insert before the cursor (this is the most common)
A is inserted after the cursor;
I insert at the beginning of the row where the cursor is located
A is inserted at the end of the row where the cursor is located
O insert a row above the row where the cursor is located
O insert a row under the row where the cursor is located
S. delete a character after the cursor and enter the insert mode.
S. Delete the row where the cursor is located and enter the insert mode.
Delete character
X character (this is the most common)
# X delete several characters, # indicates a number, such as 3x
DW deletes a word
DW deletes several words. # It is represented by numbers. For example, 3dw deletes three words.
Dd deletes a row
# Dd deletes multiple rows and # represents numbers. For example, 3DD deletes the cursor row and the cursor's next two rows.
D $ Delete the content from the cursor to the end of the line
J. Clear the space between the row where the cursor is located and the previous line, and link the cursor row with the previous line.
Unedit 
U undo the modification or deletion operation
: U
Search
/Key key and search keyword, support regular expression ------------------------------------------------------------ Yum cannot be used solution 1. an error occurred in the RPM Database: Rm-F/var/lib/RPM/_ dB. * Delete the database used by rpm
# Rpm -- rebuilddb rebuilding the database
# Yum clean all2. or the problem is that the yum -- disableplugin = fastestmirror update error occurs in the quick search source.
Yum -- disableplugin = fastestmirror-y install Pam-devel or VI/etc/Yum/pluginconf. d/fastestmirror. conf makes enabled = 03. reinstall Yum to uninstall all related software rpm-Qa | grep Yum and then uninstall and install the three software. You can download unzip-IVH Yum * here *. rpm
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.