Basic LINUX operations: compression/decompression, CD mounting, mirror preparation, YUM Library configuration

Source: Internet
Author: User
Basic LINUX operations: compression/decompression, CD mounting, mirror preparation, and YUM Library configuration today I will tell you about common LINUX operations first! I hope you can read this article carefully. Xiao Ning wrote this article carefully. haha! Operation 1 of www.2cto.com: basic operations of data packets... LINUX: compression/decompression, CD mounting, image creation, YUM Library configuration

Today, I want to talk about common LINUX operations first! I hope you can read this article carefully. Xiao Ning wrote this article carefully. haha!
Www.2cto.com
Operation 1: compress and decompress data packets
The common formats of compressed data packets are gzip and bzip. how can we compress and decompress these two types of compressed files?
Gzip: gzip/lianxi/123.txt
Decompress the gip: gunzip 123.txt



Bzip compression: bzip/lianxi/123.txt
Decompress bzip: bunzip/lianxi/123.txt

The following figure shows the operation carrier www.2cto.com.
 
 
Part 2: Packaging
The tool tar is usually used for packaging.
Tar is used as follows:
Tar-cvf [package file name] [compressed file name] create a package file
-C create
-V verbose can be understood as a detailed process
-F file

Example: tar-cvf lianxi.tar 123.txt


Part 3: Packaging + Compression
Compress the entered xixi.tarand generate the xixi.tar.gz file.
Gzip lianxi.tar

 

Method 2: you can use the package + compression command to solve the problem at one time.
Tar-zcvf xixi.tar.gz/lianxi2/xixi
-Z compressed with gzip
 
   

Decompress the xixi.tar.gz file
Tar-zxvf xix.tar.gz
-X extract extraction
 
 
Part 4: attach a CD
(1) insert the CD to the optical drive on the LINUX server.
(2) by default, the CD is under/dev/cdrom. Therefore, you need to attach the CD to/mnt from here, and then you can open the/mnt directory to directly access the content in the CD.
Mount-t iso9660/dev/cdrom/mnt
-T indicates that the type of the disc is iso9660.
(3) you can directly access the files on the cd/mnt.

Part 5: prepare the system disk mirror:
 
Function: after a local disk mirror is available, you can directly mount the disc mirror to a directory without inserting it. this is convenient and convenient.
(1) make a disc mirror:
Put the CD in the optical drive beforehand, and then run the following command in the command line:
Dd if =/dev/cdrom of =/root/Desktop/rhel5u8. iso
It may take about 20 minutes for a new disc mirror to appear in your system. haha!
(2) mount the mirror to/mnt
Mount/root/Desktop/rhel5u8. iso/mnt-o loop
-O loop adopts local loopback mounting
(3) open the/mnt directory to access the files in it.
Cd/mnt
(4) verification
Enter mount in the command line to view mounting information
  Note: The last line shows that the mirror rhel5u8 is mounted to/mnt.

Part 6: configure the YUM Library
When does the YUM Library need to be used? when installing some installation packages in LINUX, other packages must be installed first, which is troublesome. what about the YUM library, the integration of all software solves the dependency between data packets during the installation process. ensure that the disk or image is mounted
Mount/var/ftp/rhel5u8. iso/mnt-o loop 2. modify the yum configuration file/etc/yum. conf
Gpgcheck = 0 disable key verification 3.cd/etc/yum. repos. d/
Mv rhel-debuginfo.repo rhel-debuginfo.repo.bak
Touch iso. repo // Create a repo file
4. vim iso. repo
[Rhel5u8]
Name = yum server
Baseurl = file: // mnt/Server // baseurl = fule: //: + path
Enabled = 1
Gpgcheck = 0 5. test
Yum clean all clear yum cache
Yum list test yum
6. use YUM to install the service package
Yum install httpd-devel
Yum remove apr-dev
Yum reinstall httpd
 
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.