菜鳥學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 ...







發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章