REDHAT7 no yum template by default, you need to create it yourself
[[email protected] ~]# mount/dev/cdrom/root/iso/(Mount image)
Mount:/dev/sr0 write protection, will be mounted as read-only
Simplifying Client configuration Files
[Email protected] ~]# Yum-config-manager--add file:///root/iso/
Loaded plugins: LangPacks, Product-id
adding Repo from:file:///root/iso/
[Root_iso_]
name=added from:file:///root/iso/
baseurl=file:///root/iso/
Enabled=1
[[email protected] desktop] #vim/etc/yum.conf (to this path to change Gpgcheck to 0, that is, do not have to verify the key)
[Main]
cachedir=/var/cache/yum/$basearch/$releasever
Keepcache=0
debuglevel=2
Logfile=/var/log/yum.log
Exactarch=1
Obsoletes=1
Gpgcheck=0 (change this to 0, cancel key verification)
Plugins=1
Installonly_limit=3
[[email protected] ~]# Yum Clean all (cleanup cache)
Loaded plugins: LangPacks, Product-id, Search-disabled-repos, Subscription-manager
This system isn't registered to Red Hat Subscription Management. You can use the Subscription-manager to register.
Cleaning up software Source: Root_iso_
Cleaning up everything
[email protected] ~]# Yum repolist (reload Yum)
Loaded plugins: LangPacks, Product-id, Search-disabled-repos, Subscription-manager
This system isn't registered to Red Hat Subscription Management. You can use the Subscription-manager to register.
Root_iso_ | 4.1 KB 00:00:00
(a): Root_iso_/group_gz | 136 KB 00:00:00
(2/2): root_iso_/primary_db | 3.6 MB 00:00:00
Source Identity Source Name status
Root_iso_ added from:file:///root/iso/4,620
repolist:4,620
(Ps: There will be dozens of Yum on the enterprise, if the Yum configuration error, you can create a repo folder in the current directory,
Move all of the Yum sources in and create a file again)
Yum Warehouse Definition
To change the package directory to a usable source:
First install the Createrepo package and centralize the collected *.rpm package files into a custom folder.
Use Creatererepo to generate warehouse definition data,
[[email protected] desktop] #yum-y install Creatererepo (default does not have this package, to generate)
[[email protected] desktop] #creatererepo/rpm/
Publish the above warehouse directory, configure the client, use the above Yum repository.
—————————————————————————————————————————————————————————————————————————
Error running command, need to provide command search path
[[email protected] desktop] #yum-y install Xsnow (installation xsnow)
[[email protected] desktop] #rpm-ql xsnow (view path)
/usr/x11r6/bin/xsnow
/usr/x11r6/man/man1/xsnow.1x.gz
...............
[[email protected] desktop] #xsnow
Bash:xsnow:command not found
[[email protected] desktop] #echo $PATH (search for the command)
/usr/lib64/ql-3.3/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/root/bin
[[email protected] desktop] #cp/usr/x11r6/bin/xsnow/bin/(to copy the road/usr/x11r6/bin/xsnow to the bin directory)
[[email protected] desktop] #xsnow (then it will run)
————————————————————————————————————————————————————
Vim Advanced Application
Visual selection
(Pick action) VIM command mode
-V: Take multiple consecutive characters
-V: Take consecutive lines
CTRL + V: Take contiguous multiple columns
-GV: Repeat Last Selection
Action for selection of text
-D: Delete
-Y: Copy
Apply a real column:
Add comments in batches by Ctrl + V for continuous multiple columns
Select first column, enter capital I
Input
Press ESC to exit
The completion of VIM
Use of CTRL + N: In input mode, CTRL + N can list full-text fields
(Remember to add a colon:)
Execute external commands in vim
Use in the last line mode! ", you can execute command-line commands
:! Hostname
:! Pwd
:! Ls/root
Use "R" in the last line mode! ”。 Can be read into the execution result of the external command line to the current text
: R! Hostname
: R! Pwd
——————————————————————————————————————
Historical Command application:
Default Record 1000 recently executed commands
Storage location: ~/.bash_history
[Email protected]~] #grep ^histsize/etc/profile
histsize=1000 (number of records globally set)
Related actions:
Histroy: View a list of history commands
Histroy-c: Empty History command
!XX: Performs the most recent history command beginning with XX
Ctrl+r: Search History command
[[Email protected]~] #vim/ETC/BASHRC Show History command, Show time
Export histtimeformat= "%F%h:%m" (write this script in)
——————————————————————————————————————————————————
Find extension
Find by account name or ID
-type: Find by File type
-name: Find by file name
-size: Find by File size
-mtime: Time Modified by content
-iname: Search by name, ignoring case
-uid: Based on UID, files belonging to this user
-gid: Based on GID, files belonging to this group
-user: Based on the user name lookup, find the user who belongs to the
-group: Search by group name to find the one that belongs to this group
-nouser: Find this file does not belong to any user
-nogroup: Find this file does not belong to any group
-maxdepth: Limit the depth of directory lookups
-inum: Search by file I node number
-I: View File I node
Operation:
[[Email protected] Desktop]# find/etc/-maxdepth 2-name "passwd" (Limit the depth of directory lookup/etc/The second layer of passwd directory)
/etc/pam.d/passwd
/etc/passwd
——————————————————————————————————————————————————————————————————————
LS-LH and Du-sh
Common denominator: Ability to display the size of objects
Different points: Meaning of size
LS-LH: Displays the size of the data content
Du-sh: Displays the disk space occupied by the data (4kb/block)
Trial columns:
[[Email protected] Desktop]# Ls-lh/root/install.log
-rw-r--r--. 1 root root 45K August 2016/root/install.log (data 45k)
[[Email protected] Desktop]# Du-sh/root/install.log
52k/root/install.log (52k of disk space occupied)
————————————————————————————————————————————————————————
Soft Connect/Hard Connect
Soft connection:
Connection file > destination file > I node > Document data
Target file > I node > Document data
(If the target file is deleted, the connection file will be invalidated, can cross the partition, the target can be the directory)
Hard Connect
Connection file > I node > Data content
Target file > I node > Data content
(If the target file is deleted, the connection file is still available, cannot cross the partition, the destination cannot be a directory)
Linux Fundamentals 7