Linux archive compression and software management

Source: Internet
Author: User
Tags rpmbuild

Package Compression
 
Windows:
Format:. rar. zip, etc.
Tool: winrar zip 7zip, good pressure, etc.
 
Linux:
Format: .tar.gz .tar.bz2. zip. rar
Tool: gzip bzip2 zip rarlinux
 
Package (non-compressed ):
# Tar cvf file.tar package file...
# Tar cvf abc.tar a B c d e
C create
V verbose
F file
 
Unpack (not decompress ):
# Tar xvf package file [-C/root/Desktop]
X extract
-C: Specify the unpacking path
 
Gzip bzip2
Compression:
# Gzip source file...
# Bzip2 source file...
Decompress:
# Gunzip compressed file
# Bunzip2 compressed file
# Gzip-d compressed file
# Bzip2-d compressed file
 
Package and compress together:
# Tar cvzf file.tar.gz source file...
# Tar cvjf file.tar.bz2 source file...
Decompress the package together:
# Tar xvzf compressed file [-C decompression path]
# Tar xvjf compressed file [-C decompression path]
View the subfiles In the compressed file
-T
# Tar-tf compressed file
 
Software Installation
Common Methods: rpm yum source code (Compilation)
Others: src. rpm. bin. sh. pl. bundle
 
Prepare an iso image (or rpm installation package)
# Mount-o loop iso image path mount point
# Mount-o loop/root/Desktop/rhel-server-6.4-x86_64-dvd.iso/mnt/rhel6u4
# Cd/mnr/rhel6u4/Packages
 
Package name composition: (General)
Software name version number (main version, minor version, revision number) operating system cpu Platform Architecture format
 
Operating System: el6 el5 Fedora SUSE debin Ubuntu
Cpu platform: i386 486 586 686 32-bit Software
X86_64 indicates that 64 is software
Noarch indicates 32, 64 generic
 
Rpm command
Rpm installation:
# Rpm-ivh package name
-I install
-VL verbose human
 
# Rpm-ivh lftp-4.0.9-1.el6.x86_64.rpm
 
Query the software installation path:
# Rpm-ql software name
-Q query
-L list
# Rpm-ql lftp-4.0.9-1.el6.x86_64.
 
Name of the query software:
# Rpm-qa
# Rpm-qa | grep lftp
Lftp-4.0.9-1.el6.x86_64
-A all
 
Query software details:
# Rpm-qi software name
# Rpm-qi gedit-2.28.4-3.el6.x86_64
-I information
 
Query which software generates a file:
# Rpm-qf/etc/passwd
Setup-2.8.14-20.el6.noarch
# Rpm-qf/bin/rpm
Rpm-4.8.0-32.el6.x86_64
-F file
 
Uninstall Software
# Rpm-e Software name
-E erase
 
-- Force is used during installation (force installation)
-- Nodeps is used for uninstallation (dependency is not checked during uninstallation)
 
Use rpm to install the following software:
Mysql
Mysql-server
 
 
Yum configuration and usage:
The dependency can be automatically resolved.
Local yum
Remote yum
 
This operation only involves local yum. For remote yum, you need to prepare a remote download server (ftp, http, or nfs)
Yum Source:
Mount the image to the local directory/mnt/rhel6u4
# Mount-o loop/rhel6u4. iso/mnt/rhel6u4
 
Yum client configuration file:
# Cd/etc/yum. repos. d/
# Rm-rf/etc/yum. repos. d /*
# Vim yum. repo must end with. repo
[Rhel6-Server] yum source name, used to differentiate other yum sources
Name = rhel6 yum source description (comment)
Baseurl = file: // mnt/rhel6u4/absolute path of the local yum source of the Server
Enabled = 1 whether to use this yum Source
Gpgcheck = 0 check software
 
Clear yum cache:
# Yum clean all
 
Search software:
# Yum search mysql
This command will find information about the software that has been installed in the system and not installed in the yum source. You can use this command to test whether yum is easy to use. Remember, it is just a simple test.
 
Install software:
# Yum install software name
# Yum install mysql-server-y
-Y skip confirmation prompt for direct Installation
 
Uninstall software:
# Yum erase mysql-server
Or
# Yum remove mysql-server
 
View the software groups installed in the system and those not installed:
# Yum grouplist
 
Check the software installed in the system and the software that has not been installed:
# Yum list
 
Install software group:
# Yum groupinstall software group name
 
Create your own yum Source
# Mkdir/myyum
Copy the software you want to install with yum to the directory
# Createrepo/myyum
 
Please complete the following exercises on your own:
Download and install realplayer for rpm
Download httpd from the official website and install httpd.
 
The. bin. sh. pl. bundle software only needs to grant the executable permission and run it directly to install it.
 
Src. rpm source code distribution version of rpm
In fact, there are three installation methods:
# Rpmbuild -- rebuild lftp-4.0.9-1.el6.src.rpm
# Cd/root/rpmbuild
# Ls
BUILD RPMS SPECS
BUILDROOT SOURCES SRPMS
# Cd RPMS
# Cd x86_64
You can find the executable file after rebuild and install it by using rpm.
 
Location of rpm package after rhel5 rebuild/usr/src/RedHat
 
Compile and install (source code)
1) decompress
2) cd to the decompressed directory
3)./configure -- prefix = installation directory (you do not need to create it in advance)
Configure a makefile, which records the various configurations and installation paths required during software installation.
4) make compilation to generate executable files
5) install make install
The above steps can only be used as a reference. For most software installation methods, the configure of each compiled and installed software must be different from the options, and the functions you need are different, for details about the installation, see the README and INSTALL software or the official manual.
After the software is installed, all the information, documents, and files of the software are under the installation directory.
 
Uninstall the compilation and installation software:
2 types
1) directly Delete the installation directory (commonly used)
2) decompress the cd directory
# Make uninstall
Or
# Make clean
# Make distclean
Which of the above two depends on the software? See the following two files:
# Vim READEME
# Vim INSTALL

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.