菜鸟学Linux 第030篇笔记 yum使用,源码编译安装

简介:

菜鸟学Linux 第030篇笔记 yum使用,源码编译安装


yum yellow updatet modified


c/s:

client, server


yum repository

文件服务定义

ftp, web, file directory

client

配置文件

yum仓库

createrepo




yum仓库中的元数据repo文件含义:

primary.xml.gz

当前仓库中所有rpm包的列表

依赖关系

每个rpm包安装所生成的文件列表

filelists.xml.gz

当前仓库内所有rpm包的所有文件列表

other.xml.gz

额外信息,rpm包的修改日志

repomd.xml

记录的是上面三个文件的时间戳和校验和;

comps*.xml

rpm包分组信息



yum配置文件

/etc/yum.conf


定义yum软件repo格式

[Repo_ID] (注意ID中不可有空格)

name=Description

baseurl=rpm包文件路径

ftp://

http://

file:/// 最后一个/表示根

enabled={0|1} 1启用 0禁用 是否启用此条目

gpgcheck={0|1} 1启用 0禁用  是否验证软件包合法性

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release 指定验证信息


yum 使用

yum [options] [command] [package ...]

Options

-y

--nogpgcheck

Command

list 列表

all

availabled

installed

updates

clean 清理缓存

repolist 显示repository列表及其简要信息

all

disabled

enabled

install Package_name

update 

update to 升级到指定版本

remove|erase

info

provides | whatprovides 查看指定文件或特性是由哪个包安装生成

groupinfo

groupinstall

groupupdate

grouplist

groupremove

创建yum仓库

createrepo /Package

便会将目录里的rpm包生成yum仓库,但不会生成组信息

如想添加组信息将原/repodata里的comp*.xml 拷贝到要创建仓库的目录里

执行createrepo -g /yum/comps.xml /yum/Package 

-g --groupfile <groupfile>

              A precreated xml filename to point to for group information.

              See examples section below for further explanation.



手动安装源码程序

二进制格式:

源程序-->编译-->二进制格式

1.有些特性是编译选定的,如果编译未选定此特性,将无法使用

2.rpm包的版本会落后于源码包,甚至落后很多 bind-9.8.7 bind-9.7.2

定制:手动编译安装程序

编译环境:开发环境

开发库,开发工具

Linux: C, 汇编

GNU: C

C,C++, 

编译器

gcc: GNU C Complier, C

g++: g plus plus

项目管理工具

make

makefile:定义了make(gcc,g++)按何种次序去编译这些源程序文件中的源程序

automake --> makefile.in

autoconf --> configure

编译安装三步骤:

前提准备开发环境(编译环境)

安装"Development Tools" "Development libraries"

# tar

# cd 到其目录

# ./configure

--help

--prefix=/path/to/somewhere

--sysconfdir=/PATH/TO/CONFFILE_PATH

功能:1、让用户选定编译特性; 2、检查编译环境;

# make

# make install


编译安装tengine软件

#tar xf tengine-1.4.2.tar.gz

#cd tengine-1.4.2

#./configure --help

#./configure --prefix=/usr/local/tengine --conf-path=/etc/tengine/tengine.conf

#make

#make install

#PATH=$PATH:/usr/local/tengine/sbin/nginx 或

#/usr/local/tengine/sbin/nginx

1. 修改PATH环境变量,以能够识别此程序的二进制文件路径

修改/etc/profile文件

在/etc/profile.d/目录建立一个以.sh为名称后缀的文件,

在里面定义export PATH=$PATH:/path/to/somedir

2. 默认情况下,系统搜索库文件的路径/lib, /usr/lib; 

增添额外搜寻库路径

1. 在/etc/ld.so.conf.d/ 中创建以.conf为后缀名的文件

而后把要增添的库文件路径直接写至此文件中(重启生效)

#ldconfig 通知系统重新搜寻库文件

-v 显示搜寻库的过程

3. 头文件: #include"file.h"   输出给系统

默认/usr/include

增添头文件搜寻路径,使用链接进行

/usr/local/tengine/include/ /usr/include/

两种方式:

ln -s /usr/local/tengine/include/* /usr/include 或

ln -s /usr/local/tengine/include/ /usr/include/tengine (推荐)

4. man 文档路径: 安装在--prefix man默认指定的目录/usr/share/man

1.man -M /PATH/TO/MAN_DIR COMMAND 手动指定查找某命令帮助文档目录

2.在/etc/man.config中添加一条 MANPATH /PATH_COMMMAND_DOC


netstat 命令

 netstat  -  Print  network  connections,  routing  tables,  interface

       statistics, masquerade connections, and multicast memberships

-r 显示路由表

-n 以数字显示路由表

-t 显示建立的tcp连接

-u 显示udp连接

-l 显示监听状态的连接listen 

-p 显示监听指定的套接字的进程的进程号及进程名


kill PID  杀死进程

perl, java, python ...

本文转自Winthcloud博客51CTO博客,原文链接http://blog.51cto.com/winthcloud/1875712如需转载请自行联系原作者


Winthcloud

相关文章
|
4天前
|
NoSQL Linux 测试技术
Redis的安装(Linux版)
Redis的安装(Linux版)
31 1
|
1天前
|
Linux 开发工具 C语言
Linux 安装 gcc 编译运行 C程序
Linux 安装 gcc 编译运行 C程序
7 0
|
1天前
|
Ubuntu Linux Python
Linux(15)Ubuntu安装ninja构建工具
Linux(15)Ubuntu安装ninja构建工具
8 0
|
1天前
|
Ubuntu Linux 数据安全/隐私保护
Linux(7)Ubuntu20.04 arm64安装Docker
Linux(7)Ubuntu20.04 arm64安装Docker
6 0
|
4天前
|
Linux
ZooKeeper的安装(Linux版)
ZooKeeper的安装(Linux版)
16 1
|
4天前
|
应用服务中间件 Linux 网络安全
Tomcat的安装(Linux版)
Tomcat的安装(Linux版)
17 0
|
7天前
|
关系型数据库 MySQL Linux
Linux联网安装MySQL Server
Linux联网安装MySQL Server
20 0
|
14天前
|
Linux C语言
linux yum安装ffmpeg 图文详解
linux yum安装ffmpeg 图文详解
32 0
|
14天前
|
Linux
linux yum 安装rar和unrar
linux yum 安装rar和unrar
47 0
|
1天前
|
存储 Linux 网络安全
centos7使用yum网络安装
这些是使用Yum进行网络安装的基本步骤。根据你的需求,你可以重复步骤3和4来安装其他软件包。请注意,执行Yum操作需要root或具有sudo权限的用户。
12 1