Linux 使用本地yum源及软件包管理
Linux 使用本地yum源及軟件包管理
2016-12-18 10:09 by 宋躍杰, 5 閱讀, 0 評論, 收藏, 編輯[root@node130 rh]# pwd
/opt/rh
[root@node130 rh]# ls
rhel-server-6.4-x86_64-dvd.iso
[root@node130 rh]#mkdir /mnt/cdrom
[root@node130 dev]# mount -v -t iso9660 -o loop? /opt/rh/rhel-server-6.4-x86_64-dvd.iso /mnt/cdrom/
mount: going to use the loop device /dev/loop0
/opt/rh/rhel-server-6.4-x86_64-dvd.iso on /mnt/cdrom type iso9660 (rw,loop=/dev/loop0)
[root@node130 yum.repos.d]# vim rhel-source.repo
[rhel-source]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=file:///mnt/cdrom
enabled=1
gpgcheck=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
清除原有緩存
[root@node130 cdrom]# yum clean all
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning repos: rhel-source
Cleaning up Everything
獲取yum列表
驗證yum配置是否成功
[root@node130 cdrom]# yum makecache
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
rhel-source?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? | 3.9 kB???? 00:00 ...
rhel-source/group_gz????????????????????????????????????????????????????????????????????????????????????????????????????????????????? | 204 kB???? 00:00 ...
rhel-source/filelists_db????????????????????????????????????????????????????????????????????????????????????????????????????????????? | 3.7 MB???? 00:00 ...
rhel-source/primary_db??????????????????????????????????????????????????????????????????????????????????????????????????????????????? | 3.1 MB???? 00:00 ...
rhel-source/other_db????????????????????????????????????????????????????????????????????????????????????????????????????????????????? | 1.5 MB???? 00:00 ...
Metadata Cache Create
驗證yum配置是否成功
[root@node130 cdrom]# yum grouplist | grep Server
Network Infrastructure Server
Print Server
Web Server
Backup Server
Directory Server
Identity Management Server
Network Storage Server
Server Platform
Server Platform Development
Systems Management Messaging Server support
?
?
查找軟件包
yum list available? #列出可供安裝的軟件包
yum list installed #列出已安裝的軟件包
yum list extras #列出不是通過倉庫安裝的軟件包
yum list *vorbis*#列出標題包含vorbis的軟件包
yum list updates #列出可以更新的軟件包
yum info wordpress #wordpress軟件包說明
yum info word* #以word開頭的軟件包說明
yum search mp3 #查找包含字符串mp3的軟件包
安裝軟包
yum install wordpress
yum groupinstall XFCE #安裝整套XFCE桌面軟件包
更新軟件包
yum check-update #列出所有可更新的軟件包
yum list updates openoffice* #查找openoffice*的更新
yum update #更新所有可更新的軟件包
刪除軟件包
yum remove beagle #刪除beagle 軟件包
yum remove xscreen* 刪除xscreen開頭的軟件包
yum groupremove XFCE 刪除XFCE的組內(nèi)的所有軟件包
清除軟件包
yum clean packages #清除遺留在緩存里的包文件
yum clean metadata #清除遺留在緩存里的元數(shù)據(jù)
yum clean headers #清除遺留在緩存里的頭文件
yum clean all #清除元數(shù)據(jù),頭文件和包文件
?
rpm安裝軟妹包
rpm -ivh rpmforge-release-*.rpm
rpm -ivh http://ftp************.rpm
rpm升級軟件包
rpm -Uhv? *.rpm
刪除軟件包
rpm -e rpmforge-release
rpm -e --nodeps? rpmforge-release
查詢rpm包相關(guān)信息
rpm -q rsync? #版本信息
rpm -qp ***.rpm #獲取當前目錄下rpm包的相關(guān)信息
rpm -qa|less #列出系統(tǒng)中已安裝的所有軟件包
rpm -qf /etc/sysctl.conf #檢查系統(tǒng)里某個文件以查看該文件屬于哪個軟件包
rpm -qi rpmforge-release #列出已安裝軟件包的標準信息信息
rpm -qlp *.rpm |less #列出rpm文件的內(nèi)容
rpm -q --scripts kernel |less #列出已安裝的rpm包自帶的安裝前和安裝后腳本
?[root@node130 ~]# find / -name 'functest.sh' -print | xargs ls -l;-rw-r--r--. 1 root root 202 Nov 30 06:42 /root/functest.sh
-rw-r--r--? 1 root root 202 Dec 18 05:09 /tmp/functest.sh
[root@node130 ~]# find / -name "postgresql-9.4.10-1-linux-x64.run" -exec ls -l {} \;
-rwxr-xr-x. 1 root root 37291135 Nov? 8 08:27 /root/postgresql-9.4.10-1-linux-x64.run
-rwxr-xr-x. 1 postgres postgres 37291135 Nov? 8 08:30 /home/postgres/postgresql-9.4.10-1-linux-x64.run
[root@node130 ~]# find / -name "functest.sh" -exec ls -l {} \;
-rw-r--r--. 1 root root 202 Nov 30 06:42 /root/functest.sh
-rw-r--r-- 1 root root 202 Dec 18 05:09 /tmp/functest.sh
[root@node130 ~]# find /home -name '*.conf' |xargs -I {} cp -r {} /tmp/
[root@node130 tmp]# find /home -name '*.conf' |xargs -I {} ls -l {}
-rw------- 1 root root 20642 Dec 18 05:23 /home/kingbase/data/kingbase.conf
-rw------- 1 root root 4106 Dec 18 05:23 /home/kingbase/data/sys_hba.conf
-rw------- 1 root root 88 Dec 18 05:23 /home/kingbase/data/kingbase.auto.conf
-rw------- 1 root root 1628 Dec 18 05:23 /home/kingbase/data/sys_ident.conf
-rw------- 1 root root 20642 Dec 18 05:24 /home/kaadmin/data/master/kaseg-1/kingbase.conf
-rw-r--r-- 1 root root 2361 Dec 18 05:25 /home/kaadmin/data/master/kaseg-1/kaperfmon/conf/kaperfmon.conf
-rw------- 1 root root 4106 Dec 18 05:25 /home/kaadmin/data/master/kaseg-1/sys_hba.conf
-rw------- 1 root root 1628 Dec 18 05:25 /home/kaadmin/data/master/kaseg-1/sys_ident.conf
-rw------- 1 root root 20642 Dec 18 05:26 /home/kaadmin/data/kaseg0/kingbase.conf
-rw------- 1 root root 4106 Dec 18 05:26 /home/kaadmin/data/kaseg0/sys_hba.conf
-rw------- 1 root root 1628 Dec 18 05:26 /home/kaadmin/data/kaseg0/sys_ident.conf
-rw------- 1 root root 7856 Dec 18 05:23 /home/postgres/.gnupg/gpg.conf
-rw------- 1 root root 4214 Dec 18 05:22 /home/postgres/data/pg_hba.conf
-rw------- 1 root root 1636 Dec 18 05:22 /home/postgres/data/pg_ident.conf
-rw------- 1 root root 88 Dec 18 05:22 /home/postgres/data/postgresql.auto.conf
-rw-r--r-- 1 root root 20825 Dec 18 05:22 /home/postgres/data/postgresql.conf
[root@node130 tmp]# find /home -name '*.conf' -exec ls -l {}\;
find: missing argument to `-exec'
[root@node130 tmp]# find /home -name '*.conf' -exec ls -l {} \;
-rw------- 1 root root 20642 Dec 18 05:23 /home/kingbase/data/kingbase.conf
-rw------- 1 root root 4106 Dec 18 05:23 /home/kingbase/data/sys_hba.conf
-rw------- 1 root root 88 Dec 18 05:23 /home/kingbase/data/kingbase.auto.conf
-rw------- 1 root root 1628 Dec 18 05:23 /home/kingbase/data/sys_ident.conf
-rw------- 1 root root 20642 Dec 18 05:24 /home/kaadmin/data/master/kaseg-1/kingbase.conf
-rw-r--r-- 1 root root 2361 Dec 18 05:25 /home/kaadmin/data/master/kaseg-1/kaperfmon/conf/kaperfmon.conf
-rw------- 1 root root 4106 Dec 18 05:25 /home/kaadmin/data/master/kaseg-1/sys_hba.conf
-rw------- 1 root root 1628 Dec 18 05:25 /home/kaadmin/data/master/kaseg-1/sys_ident.conf
-rw------- 1 root root 20642 Dec 18 05:26 /home/kaadmin/data/kaseg0/kingbase.conf
-rw------- 1 root root 4106 Dec 18 05:26 /home/kaadmin/data/kaseg0/sys_hba.conf
-rw------- 1 root root 1628 Dec 18 05:26 /home/kaadmin/data/kaseg0/sys_ident.conf
-rw------- 1 root root 7856 Dec 18 05:23 /home/postgres/.gnupg/gpg.conf
-rw------- 1 root root 4214 Dec 18 05:22 /home/postgres/data/pg_hba.conf
-rw------- 1 root root 1636 Dec 18 05:22 /home/postgres/data/pg_ident.conf
-rw------- 1 root root 88 Dec 18 05:22 /home/postgres/data/postgresql.auto.conf
-rw-r--r-- 1 root root 20825 Dec 18 05:22 /home/postgres/data/postgresql.conf
總結(jié)
以上是生活随笔為你收集整理的Linux 使用本地yum源及软件包管理的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: stm32串口中断
- 下一篇: mysql 5.6 禁用 innodb_