Linux Learning notes--yum installing software, building warehouses, RPM commands

Source: Internet
Author: User
Tags gpg yum repolist

############ #如何安装软件 ####################
Yum #全称Yellow dog Updater moddified to automatically download RPM packages and install them from the specified server

Yum List all # #列出所有安装包
Yum List installed # #列出已经安装的
Yum List available # #列出没有安装的
Yum Remove Packages # #卸载软件 (package is a bundle)
Yum Install package # #安装软件
Yum Reinstall package # #重新安装软件
Yum Localinstall local Software # #安装本地软件并解决依赖关系
Yum Search Keyword # #搜索与关键字相关的软件
Yum whatprovides File # #搜索包含此文件的包
Yum Info # #显示软件信息
Yum Groups List # #列出软件组
Yum Groups Install # #安装组
Yum Groups Remove # #卸载组
Yum Groups Info # #查看组信息
Yum Update # #全部更新
Yum Update package # #更新指定软件包
Yum Clean Packages # #清除缓存目录下的软件包
Yum Repolist # #查看yum资源库信息


eg
Yum Install Package-y # #安装软件,-y indicates that the installation process prompts all Yes
Yum Whatprovides */lftp # #搜索包含此文件的包


############# #软件仓库的建立 ##############
1. Build a software repository first

1) Need a matching installation image, Rhel-server-7.0-x86_64-dvd.iso, this file is downloaded from the official website
2) Mount Rhel-server-7.0-x86_64-dvd.iso/yum # #挂在到/yum,/yum directory is new
3) mv/etc/yum.repos.d/*/mnt # #把原来的文件移到/mnt
4) Vim/etc/yum.repos.d/yum.repo # #文件格式要以. Repo End
[Redhatpackage] # #仓库名称
Name=localpackage # #仓库描述
Baseurl=file:///yum # #仓库地址
Gpgcheck=0 # #是否检测软件的gpgkey, 0 for no detection, 1 for detection
5) Yum Clean all # #刷新仓库配置
6) Yum Repolist # #查看yum资源库信息
Note: DF Command # #查看第2步挂载情况

2./etc/fstab # #fstab文件包含了系统在启动时, mounting file system and storage device details
Format:
/absolute path/rhel-server-7.0-x86_64-dvd.iso/xxx iso9660 ro,relatime 0 0
Image file location hangs on point type mount parameter not tested
eg
Vim/etc/fstab
Write/etc/fstab to enable the system to read the contents of Rhel-server-7.0-x86_64-dvd.iso in the boot
Mount-a # #检查/etc/fstab content and mount the content

3. Writing the specified file for the software repository
/ETC/YUM.REPOS.D # #仓库指向文件存储目录
Vim/etc/yum.repos.d/test.repo # #仓库指向文件
[Redhatpackage] # #仓库名称
Name=localpackage # #仓库描述
Baseurl=file:///yumsource # #仓库地址
Gpgcheck=1 # #是否检测软件的gpgkey
Enabled=1 # #此仓库在系统中生效 (0 is not active in the system)
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-redhat-release # #本机gpgkey文件

eg
Vim/etc/yum.repos.d/test.repo (leaves only test.repo in/etc/yum.repos.d/)
[Test]
Name=test
Baseurl=file:///source (The warehouse location of that machine)
Gpgcheck=0
Enabled=0

4. Configuration of the network software Warehouse
(Physical machine Build network Yum source, virtual machine can access using physical machine yum source)
1) Yum Install httpd-y # #物理机要有httpd服务
2) systemctl start httpd # #启动httpd
3) systemctl Enable HTTPD # #开机启动httpd
4) Systemctl Stop FIREWALLD # #关闭物理机的防火墙
5) mkdir-p/var/www/html/yum # #在 Create yum directory under/var/www/html/
6) Mount/iso/rhel-server-7.0-x86_64-dvd.iso/var/www/html/yum # #挂载镜像
7) Vim/etc/fstab # #写在/etc/fstab can be recorded, the next time the boot can be started
/iso/rhel-server-7.0-x86_64-dvd.iso/var/www/html/yum iso9660 ro,relatime 0 0
(Tips: Vim Edit Ctrl + Z into the background, copy rhel-server-7.0-x86_64-dvd.iso,fg, paste, continue to edit)
8) mount-a # #检查/etc/fstab content and mount the content

Browser access:/HTTP physical Machine Ip/yum # #可以查看到仓库内容

5. Building of third-party software repositories
1) Mkdir/software # #新建/software
2) mv. RPM Package/software # #把所有rpm包放到指定目录中
3) createrepo-v/software # #创建repodata
4) Vim/etc/yum.repos.d/test.repo # #仓库指向文件
[Software]
Name=software
Baseurl=file:///software
Gpgcheck=0
5) Yum Clean all # #刷新配置
6) Yum Repolist # #查看software库信息

6. The FTP service is the way to build
1) Yum Install vsftp-y # #安装vsftp服务
2) systemctl start VSFTPD # #开启服务
3) Firewall-cmd--permanent--add-service=ftp
4) To ensure that the content under the/var/ftp/has the readable permission
(Access: FTP://IP address/pub/can see content)
5) You can use LFTP IP to access the


########### #rpm命令 ##########

RPM # # #Red Hat Packages Manager, package management tools, similar to Windows Add/Remove Programs
-A # # #所有的安装包
-I. # #install
-V # # #显示信息
-H # # #指定包的解密方式为hash
-Q # #查询
-P # # #指定软件包本身
-L # # #列出软件中文件的名字
-F # # #查询某个文件属于那个安装包
-A # # #所有
-E # # #卸载
--force # # #强制
--nodeps # # #忽略依赖性

--scripts # #查看软件安装和卸载过程中所执行的动作常用组合:
1) query for installed software
RPM-QA |grep keyword # #在已经安装的软件包中查找关键字软件
RPM-QF file name # #查询已安装的文件属于哪个包, the absolute path to the file name is to be written out
RPM-QR Software Name # #查看软件的依赖性
RPM-QD Software Name # #查询软件的文档安装位置
2) View of the packages that are installed
Rpm-qpi file.rpm # #查询此file. RPM Package Usage, version information
RPM-QPL file.rpm # #查询此软件包所包含的软件
RPM-QPD file.rpm # #查询此软件包文档位置
RPM-QPR file.rpm # #查询此软件包的依赖关系
3) installation, upgrade and deletion of software packages
RPM-IVH file.rpm # #安装file. rpm
RPM-UVH file.rpm # #升级file. rpm
RPM-E Package Name # #卸载此软件包



Learn the installation and uninstallation of Linux source package software: http://12158275.blog.51cto.com/12148275/1881244



This article is from the "12148275" blog, please be sure to keep this source http://12158275.blog.51cto.com/12148275/1899018

Linux Learning notes--yum installing software, building warehouses, RPM commands

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.