1酵使、自建yum倉庫袭异,分別為網(wǎng)絡(luò)源和本地源
服務(wù)端
yum -y install httpd
systemctl enable --now httpd
mkdir -p /var/www/html/centos/8
mount /dev/sr0 /mnt
cp -a /mnt/AppStream /var/www/html/centos/8/AppStream
cp -a /mnt/BaseOS/ /var/www/html/centos/8/BaseOS
dnf reposync --repoid=extras --download-metadata -p /var/www/html/centos
repo
客戶端
cat /etc/yum.repos.d/test.repo
[BaseOS]
name=BaseOS
baseurl=http://10.0.0.153/centos/8/BaseOS
gpgcheck=0
enabled=1
[AppStream]
name=Appstream
baseurl=http://10.0.0.153/centos/8/AppStream
gpgcheck=0
enabled=1
[extras]
name=extras
baseurl=http://10.0.0.153/centos/extras
2、編譯安裝http2.4惑淳,實(shí)現(xiàn)可以正常訪問额港,并將編譯步驟和結(jié)果提交。
yum -y install gcc apr-devel apr-util-devel make autoconf pcre-devel openssl-devel redhat-rpm-config
wget https://dlcdn.apache.org//httpd/httpd-2.4.51.tar.bz2
tar -xvf httpd-2.4.51.tar.bz2 -C /usr/local/src
cd /usr/local/src/httpd-2.4.51/
./configure --prefix=/app/httpd
make && make install
/app/httpd/bin/apachectl start
httpd
3歧焦、利用sed 取出ifconfig命令中本機(jī)的IPv4地址
ifconfig | sed -rn 's#.*inet ([0-9.]+).*#\1#p'
4移斩、刪除/etc/fstab文件中所有以#開頭,后面至少跟一個空白字符的行的行首的#和空白字符
sed -rn '/^#\ +/s@# (.*)@\1@p' /etc/fstab
5、處理/etc/fstab路徑,使用sed命令取出其目錄名和基名
echo /etc/fstab|sed -rn 's#(/[a-z]+)/([a-z]+)#\1#p'
echo /etc/fstab|sed -rn 's#(/[a-z]+)/([a-z]+)#\2#p'
6向瓷、列出ubuntu軟件管理工具apt的一些用法(自由總結(jié))
-
sudo apt install
安裝安裝包 -
sudo apt remove
卸載安裝包 -
sudo apt update
更新可用安裝包列表 -
sudo apt upgrade
升級已安裝的安裝包