Common Software management in Centos
Linux software package installation method:
1. rpm package installation
2. Yum (solves dependencies and facilitates Software Package upgrade)
3. source code compilation and Installation
I. rpm package management:
Redhat package management
An example: sudo-1.7.2pl-5.el5.i386.rpm
Software name, version number, Release number, hardware platform
Sudo is the default Software Package for all linux systems.
Rpm package creation encapsulates the compiled execution program of the source code package into the rpm structure. When you install the rpm package, the third step of the source code package installation is actually executed, is to copy the execution program to the corresponding directory.
Rpm Path ProblemsMost rpm packages do not allow you to change their installation directory. By default, the installation directory is set. It is not like windows registry, and linux uninstallation will automatically uninstall and clean.
1. Install the rpm package
Rpm-ivh vsftpd-2.0.5-16.el5_4.1.i386.rpm
I installV Installation Process Information
Install rpm-ivh vsftpd-2.0.5-16.el5_4.1.i386.rpm -- replacepkgs
File conflicts install an older version of the software-- Replacefiles
To solve the dependency-- NodeppsDependency is not considered and cannot be used successfully in most cases.
2. view all rpm packages installed in the system
Rpm-qa
Rpm-qa | grep vsftp
3. vsftp installs many files and stores them in different directories under the root directory.
Rpm-SQL vsftpd-2.0.5-16.el5_4.1
4. Check which rpm software package installed the file.
Rpm-qf/etc/vsftpd. conf
5. Check what files may be installed after an uninstalled rpm package
Rpm-qlp vsftpd-2.0.5-16.el5_4.1.i386.rpm
6. Uninstall the rpm package
Rpm e vsftpd-2.0.5-16.el5_4.1
Rpm-e -- nodeps samba forced uninstall, ignore dependencies. No longer. Not recommended
7. Upgrade the Software Package
Rpm-Uvh Software Package
Ii. Three core files after the rpm package is installed:
1. Application '4
/Usr/sbin/vsftpd
# Execution Program
2. Configuration File
/Etc/vsftpd. conf
# A file to be read before the application starts and then loaded to the Process List
3. Service script
/Etc/rc. d/init. d/vsftpd
# Better control the application to read the configuration file and load it to the Process List
Iii. Run the script:
1. Corresponding path
./Vsftpd restart
2. absolute path
/Etc/rc. d/init. d/vsftpd restart
3. Run the service
Service vsftpd restart
Iv. Attach a CD:
1. Put the CD in the optical drive
2. Check whether the optical drive is powered on.
3. Mount the disc/media
Mount/dev/cdrom/media
4. How to check whether the mounting is successful
Df-Th
5. Enable the disc to be automatically mounted to/media
Vi/etc/fstab
/Dev/cdrom/media iso9660 defaults 0 0
5. Solve the rpm dependency problem:
Yum tool for managing rpm packages
All software packages are under the Centos subdirectory.
1. Attach the disc (start upon startup)
2. Change the software source cd/etc/yum. repos. d/
Mv CentOS-Base.repo CentOS-Base.repo.bak
The suffix here is sensitive so the CentOS-Base.repo is changed plus. bak.
3. Modify the disc Source
Vi CentOS-Media.repo
C5-media
Name = CentOS-$ releasever-Media
Baseurl = file: // media
# Disk Mount destination
Gpgcheck = 0
# Go to the official website to update the signature and close it.
Enabled = 1
# Enable the CD Source
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
4. install an rpm software through yum
Yum-y install vsftpd *
5. Install a lamp Environment
Yum-y install httpd * mysql * php *
6. How to detach an rpm package with yum
Yum-y remove httpd * mysql * php *
7. Force delete an rpm package
Rpm-e httpd-1.3.8 -- nodeps
# Nodeps truncation dependency
8. Force install an rpm package software
Rpm-ivh mysql-server-5.0.77-4.el5_4.2.i386.rpm -- force -- nodeps
Detection and upgradeYum check-update Software name
UpgradeYum update
Software Package QueryYum list
Software Package InformationYum info
UninstallYum remove
HelpYum-help
Determine if the software is installed with rpm-q
6. Install the source code package (compatible ):
Tar.gzTar.bz2
Tar zxfExtract
1. Generate the configuration file
./Configure -- prefix =/usr/local/apache2/
Collect System Information -- prefix to specify the installation directory. There is no special uninstall command. Generally placed in usr/local
Gcc is required to be installed with yum
2. Compile
Make
3. Install
Make install
4. cd/usr/local/apache2/
1) Applications
/Usr/local/apache2/bin/httpd
2) Service script
/Usr/local/apache2/bin/apachectl
3) configuration file
/Usr/local/apache2/conf/httpd. conf
5. Start the source code-installed apache
/Usr/local/apache2/bin/apachectl restart
6. View Processes
Ps-ef | grep httpd
7. How to enable the source code-installed apache to start automatically
Vi/etc/rc. d/rc. local
/Usr/local/apache2/bin/apachectl restart (ctl Control)
7. You only need to run the. sh script for script installation (similar to windows)
Webmin
Readme file
Install./setup. sh
8. APT package management for debian linux
Search for software packagesApt-cache search
Software Package InformationApt-cache show
InstallApt-get install (reinstall overwrite installation-f repair installation)
DeleteApt-get remove
Update Software SourceApt-get update
Update installed packagesApt-get upgrade