Installation and uninstall of software under Linux (command line mode) __linux

Source: Internet
Author: User
Tags bz2 file diff gpg

China's faster open source software mirror sites, including Debian, Ubuntu, Fedora, Gentoo, Centos, FreeBSD, Eclipse and other open source software mirror image

http://mirrors.163.com,http://mirrors.sohu.com,http://centos.ustc.edu.cn

Linux is in addition to the binary form of software distribution, as well as the source code in the form of packages, talk about these software installation and uninstall:
Installation and uninstall of one or two-in-system distribution packages
Binary distribution of Linux software refers to the release form of a software package that has already been compiled in binary form, the advantage is that the installation is easy to use, the disadvantage is the lack of flexibility, if the package is for a specific hardware/operating system platform compiled, it can not be in a different platform or environment to perform correctly.
1, *.rpm form of binary package
Installation: RPM-IVH *.rpm Upgrade: RPM-UVH *.rpm Uninstall: Rpm-e packgename
Description: RPM (RedHat packge Manager) is RedHat company out of the package manager, use it can easily to the RPM package installation, upgrade, uninstall, verify, query and other operations, installation is simple, Uninstall can also remove files that are installed in multiple directories. The parameters of RPM are installed--------------------------------------to display the installation progress with a hash, *.rpm is the file name of the package (here *.rpm refers to a file other than
2, *.tar.gz/*.tgz, *.bz2 form of binary package
Installation: Tar zxvf *.tar.gz or tar yxvf *.bz2
Uninstalling: Deleting manually
Description: *.tar.gz/*.bz2 form of the binary package is the use of the TAR tools to package, with GZIP/BZIP2 compression, the installation of a direct solution package can be. For software that has only a single directory after decompression, uninstall with the command "RM-RF software directory Name", if the file is dispersed in multiple directories after decompression, you must one by one manual removal, want to know what files are installed to the system when decompression, you can use the command "tar ztvf *.tar.gz"/"Tar YTVF * . bz2 "Get the list. Tar parameter z is called gzip decompression, X is unpack, V is checksum, F is display result, Y is call bzip2 decompression, T is List of file packages.
3, provide the installation program package
Such packages already provide installation scripts or binary installation wizards (Setup, install, install.sh, etc.) that can be installed by simply running it, while uninstalling scripts or programs are provided accordingly. And after the software installation to provide the reverse installation function, the current type of software package is still relatively small.

Installation and uninstall of source code distribution software package
The source code distribution of Linux software refers to the release form of all program source codes for the software. Require the user to compile their own executable binary code and install, the advantage is flexible configuration, you can remove or retain certain functions/modules, adapt to a variety of hardware/operating system platform and the compilation environment, the disadvantage is more difficult , generally not suitable for beginners to use.
1, *.src.rpm form of source code software package
Installation: 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, then installs the binary package. Packgename as mentioned earlier.
2, *.tar.gz/*.tgz, *.bz2 form of source code software package
Installation: Tar zxvf *.tar.gz or tar yxvf *.bz2 first extract and then into the unpacked directory:
./configure Configuration
Make compilation
Make install Installation
Uninstalling: Make uninstall or manually removed
Note: It is recommended to read the description file after decompression, you can understand what needs to install, if necessary, you need to change the compilation configuration. The source code for some packages can be uninstalled with the make install command after compiling the installation, and if this feature is not available, the uninstall of the software must be manually removed. Since software may be able to distribute files across multiple directories of the system, it is often difficult to remove them cleanly, then you should configure them before compiling to specify that the software will be installed to the target path:./configure--prefix= directory name, so you can use the RM-RF software directory name command to perform a clean and thorough uninstall. It is most difficult to build a user's own installation compared to other installation methods.
Import Unofficial Library address methodCheck for the existence of ls-l/etc/yum.repos.d/dag.repo if it does not exist Vi/etc/yum.repos.d/dag.repo import the following content [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 check file wget http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt RPM--import rpm-gpg-key.dag.txtAdd Epel Software Warehouse (rpmforge,rpmfusion) to Centos/rhel CentOS was compiled by Rhel, removing everything from copyright issues. Therefore, in the absence of Third-party software libraries, many software cannot be installed directly using Yum install. Under the Redhat Fedora Project, there is a Epel (Extra Packages for Enterprise Linux), Epel is a third party software warehouse for Rhel and fedora. Installation Epel is very simple. The official address is http://. Fedoraproject.org/wiki/epel/faq#howtouse 1. To install the Yum-priorities plug-in, ensure the official source preferred. Yum install yum-priorities after installation, you need to edit the. Repo related files (such as Centos-base.repo) under the/etc/yum.repos.d/directory, and insert sequential instructions at the end of each of these files: priority=n (n is a positive integer from 1 to 99, the smaller the number is preferred) general [base], [addons], [updates], [extras] End plus priority=1 [centosplus],[contrib] End plus priority=2 Other third software source at the end plus Priority=n (n>10) 2. Download and install the corresponding Epel RPM package (1) Download and install Epel RPM package 32-bit system su-c ' RPM-UVH http:// DOWNLOAD.FEDORA.REDHAT.COM/PUB/EPEL/5/I386/EPEL-RELEASE-5-4.NOARCH.RPM ' 64-bit system su-c ' RPM-UVH http:// download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm ' (2) Import Dag's PGP Key rpm–import/etc/pki/ Rpm-gpg/rpm-gpg-key-epel (3) Set the level of the source in the/etc/yum.repos.d/epel.repo file, which is to add the priority=11 edit this file at the end of the [Epel] section, add priority=11 3. Install Rpmforge RPM Package Rpmforge Library now has more than 10000 CentOS packages, the CentOS community is considered the safest and most stable of a third-party software library. (1) DownloadRpmforge RPM Package 32-bit system wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm 64-bit system wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm (2) installs Dag PGP Key rpm– Import Http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt (3) verifies the Rpmforge RPM package Rpm-k RPMFORGE-RELEASE-0.5.1-1.EL5.RF.*.RPM (4) Install Rpmforge RPM Package Rpm-i rpmforge-release-0.5.1-1.el5.rf.*.rpm (5) Set/etc/ The level of the source in the Yum.repos.d/rpmforge.repo file is the addition of the priority=12 sentence. Edit this file at the end of the [Rpmforge] section, add priority=12 4. Install rpmfusion RPM package (optional) CentOS official said the software library inside the stability of the software is not as good as rpmforge, here only for the selection of the above installed Epel after the input su -C ' yum install foo ' 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 http://download1.rpmfusion.org/nonfree/el/updates/testing/5/i386/ rpmfusion-nonfree-release-5-0.1.noarch.rpm ' CentOS 6 Enter the following command su-c ' RPM-UVH http://download1.rpmfusion.org/free/el/ updates/testing/6/i386/rpmfusion-free-release-6-0.1.noarch.rpm Http://download1.rpmfusion.org/nonfree/el/updates/testing/6/i386/rpmfusion-nonfree-release-6-0.1.noarch.rpm ' Uninstall method  rpm -E rpmfusion*
If you encounter the header V3 DSA Signature:nokey This is due to Yum installation of an older version of the GPG keys, the solution is RPM--import/etc/pki/rpm-gpg/rpm*----------------- ------------------A comparison of file system formats Ext4, Ext3, JFS, XFS, ReiserFSRead a lot of tests, are large and small file reading and writing, feeling still lack of practical application of the test, the actual production environment test to explain the problem. In the writing aspect ext4>ext2>reiserfs>ext3>jfs>xfs in the reading aspect Ext2>ext3>ext4>jfs>xfs>reiserfs JFS=EXT4>XFS>REISERFS>EXT3>EXT2-----------------------------------in Practical applicationSummary of common commands for DebianNeed to mirror official package when installing Debian,/etc/apt/sources.list file can get related site
The first word of each line is Deb or DEB-SRC, describes the file type, which contains a binary package (DEB), a compiled package that we typically use, or a package source code (DEB-SRC) that contains source codes, Debian Management files (. DSC), and The record file diff.gz for the changes made by the program is "Debian". If you install an individual package, you will use the APT and dpkg two commands.
Apt
APT (the Advanced packaging Tool) is a high-level interface for the Debian package management system, consisting of several programs that begin with the name "apt-." Apt-get, Apt-cache, Apt-cdrom, apt-config are command-line tools for handling software packages, and they are also the backend for other user foreground programs, such as Dselect and aptitude.
Apt-get update package list from source in/etc/apt/source.list
Apt-cache Search search-string Description of packages such as Search-string
Apt-cache Policy Package-name Displays the version and priority of the package
Apt-cache Show Package-name Display file description information
Apt-cache showpkg package-name Display package dependencies
Apt-get Install Package-name install packages from source and all dependent packages
Apt-get Upgrade updates the currently installed package to the latest
We see some packets being blocked from being updated (kept back)
Apt-get Dist-upgrade
Conflicts can be resolved automatically, such as Apt-get upgrade
Apt-get Remove Package-names Removes the package and all its dependencies on its
Apt-get--purge Remove these packages and their configuration files completely
Apt-get--purge Remove Gnome-panel nautilus+
When you delete a package, if you follow a "+" after the package name, the package is installed instead of deleted.
Apt-cache depends package-names lists all dependent packages for the specified package
Apt-cache rdepends package-names Lists all packages that depend on a given package
Apt-file Upgrade Update content list from source
Apt-file Search File-name Find packages that contain files
Apt-file Search Package-name List The contents of the package
Auto-apt
If you need to be able to automatically install the package, you can replace apt-file, you need to install AUTO-APT.
Aptitude APT's console interface needs to be installed aptitude
Synaptic apt GUI interface, need to install synaptic
Apt-get Clean
Deletes downloaded packages that are saved in the cache directory (/var/cache/apt/archives).
All files under the/var/cache/apt/archives directory and the/var/cache/apt/archives/partial directory will be deleted, except for locked files. When you install a package again, apt will download it again.
Apt-get AutoClean Only delete files that do not need to be downloaded again.
After selecting the package in Dselect, run:
Apt-get-u Dselect-upgrade
Compare the situation with Apt-get Dist-upgrade
You can see that many packages are installed in the preceding list as the result of "recommended" or "recommended" by other packages. Other packages have been installed or deleted through the Dselect tool to make decisions. This shows that the combination of dselect and apt will be a powerful tool.
Repair of Apt-get--reinstall install GDM software package
Apt-get Check downloads the package database from the default server
Apt-get upgrade Package_name Upgrades the specified package and upgrades its dependent packages Apt-cache showpkg Package_name displays some general information about the package Apt-cache stats display related statistics
Brief description of each package in the Apt-cache dump display cache
Apt-cache unmet shows dependencies that do not conform to consistency.
Apt-cache Show Displays the record information for the specified package, similar to the RPM-QI
Apt-cache Search Search Package
Apt-cache depends displays the dependency relationship of the package.
Apt-cache pkgnames Lists all the packages
The Apt-config apt-config dump displays current configuration information.
Apt-get Install nessus-server Automatic Download installation dependency pack
Apt-get source package_name Download the source RPM of the package
Dpkg
It is the main tool for manipulating package files;
The dpkg evolved from several original helper programs.
Dpkg-deb: operation. deb file. Dpkg-deb (1)
dpkg-ftp: An old package fetch command. DPKG-FTP (1)
dpkg-mountable: An old package fetch command. Dpkg-mountable (1)
dpkg-split: Split a large package into small packages. Dpkg-split (1)
dpkg-l [Names] List packages
Dpkg-i Pkg.deb Display Package related information
Dpkg-c Pkg.deb List The contents of the package
Dpkg-s filename shows which package contains this file
Dpkg-i Pkg.deb installation Package
Deborphan shows no dependencies (orphan) packages that need to be installed Deborphan
Debsums Audit installs the software newspaper, needs to install Debsums
Dpkg-divert [option] file overrides the version of a package
dpkg--compare-versions V1 GT v2 comparison version, with echo $? Check
Dpkg-query-w--showformat=format query installed packages, format such as ' $ $ '.
Dpkg--get-selections writes the selected package to a file
Dpkg--set-selection the list of available packages from the file read package Select Aptitude Update Update
Aptitude Upgrade Upgrade Available packages
Aptitude Dist-upgrade Upgrade the system to a new release
Aptitude Install Pkgname installation package
Aptitude Remove Pkgname Delete Package
Aptitude Purge Pkgname Delete package and its configuration file
Aptitude search String Searching package
Aptitude show Pkgname details of the package
Aptitude Clean Delete downloaded package file
Aptitude AutoClean Delete Only expired package file Upgrade Directives Aptitude Update && aptitude Upgrade-----------------------------------
VI use of vimVIM has 3 modes of operation
Command (command) mode, for entering commands (switching using ESC key)
Insert (insert) mode, for inserting text
Visual (visual) mode, for visually highlighting and selecting the bodySave and exit
: W Save
: q! Do not save exit
: w filename saved as filename
: wq! Save exit
: wq! FileName Note: Save with filename as filename and exit
: x should be saved and exited, function and: wq! same 3.5 insert mode (insert of text)
Enter insert mode
I insert before the cursor (this is most commonly used)
A after the cursor inserts;
I inserts at the beginning of the line where the cursor is located
A inserts at the end of the line at the cursor
o Insert a row above the line where the cursor is located
O Insert a row below the line where the cursor is located
s deletes a character after the cursor, and then enters insert mode
S deletes the line where the cursor is located, and then enters insert mode
Delete character
X a character (this is most commonly used)
#x remove a few characters, #表示数字, such as 3x
DW Delete a Word
DW Delete a few words, #用数字表示, such as 3DW to delete three words
DD Deletes a row
#dd Delete multiple rows, #代表数字, such as 3DD to delete the cursor line and the next two lines of the cursor
d$ deletes the cursor to the end of the line
J clears the space between the line at the cursor and the previous line, connecting the cursor line to the previous line
Undo Edit
U undo Modify or delete operation
: U
Search
/key Key and search keywords, support for regular--------------------------------------------------------------Yum cannot use workaround 1.rpm database error rm-f/var /lib/rpm/__db.* to delete the database used by rpm
# RPM--REBUILDDB Rebuild the database
# Yum Clean all 2. Or the problem is a quick search source error Yum--disableplugin=fastestmirror update
Yum--disableplugin=fastestmirror-y install Pam-devel or vi/etc/yum/pluginconf.d/fastestmirror.conf makes Enabled=0 3. Reload Yum display uninstall all relevant software Rpm-qa | grep Yum then uninstall and then install three software to download http://centos.ustc.edu.cn/centos/5.4/os/i386/CentOS/will Yum,yum-fastestmirror, Yum-metadata-parser download to a folder and then execute RPM-IVH yum*.rpm

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.