-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnote2
241 lines (186 loc) · 5.78 KB
/
note2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
Managing Software
Package Concepts
-Linux package managemnet tools are intended to help build and modify this programs based on:
1. Package = contain information about software packages,
-usually distributed as single files
-once installed in consist of dozens or hundreds of files
-incluse additional information for package management systems
2. Installed File Database = include all information about every file installed via package system,
3. Dependencies = requirements of package for one another
4. Checksums - used to verify the validity of the installed software
5. Upgrades and Uninstallation = package management systems will track upgrades and uninstall
6. Binary package Creation = got tools to create package form source code.
USING RPM!!
-Red hat package management
-been used by many linux Distro
RPM PACKAGE = packagename-a.b.c-x.arch.rpm
Above contain
-Package name
-Version Number
-Build number
-Architecture
In Ideal world RPM will install and run on any RPM distro that uses an appropriate CPU type.BUT!!!
-distro may be use other version of RPM
-RPM designed for other distro maybe using a different library
-distro maybe named the package differently
-sometimes package contain slightly different file
-some programs contain disto-specific file or script/configuration
IT safe to use YUM(Yellow Dog Updater) to install rpm package!
rpm = red hat package manager
-i =install
-U = Upgrade
-e = uninstall
q = query
-V = verify
-f = freshen
--rebuild = build binary package
--rebuilddb = rebuild rpm database to fix errors
++++++++
--force = force installation
-h = show progression
-v = perform uniform hash
--nodeps = no dependency checks
--test = check dependency conflicts.and other problems
-a = veifies all ackages
.
.
.
yum = rpm meta-packager ( make life more easy)
=install
=update
=check-update
=upgrade
=remove
=list
=search
=provides
=info
=clean
=shell
=resolvedep
=localinstall
=localupdate=deplist
yum configuration FIles
/etc/yum.conf
repos
/etc/yum.repos.d
Using Debian Packages
dpkg
-i = install
--configure = configure installed package
-r = remove packages but leave conf
-P / --purge = remove package including ,conf files
--get-selections =display currently installed package
-p = Display indoramtion about and installed package
-T = display information about an uninstalled package
-l = list installed package with pattern
-L = list the installed files associated with a package
-S = locates the packages that own the files
-C search for partially installed packages and suggests what to do with them
apt-cache = database program
apt-cache showpkg = display information about package
apt-cache stats = learn how many packages you've installed,
apt-cach unmet = show missing libraries or files
apt-cache depends = shows all of the specified packages dependencies.
apt-cache pkgnames = displays the names of all the packages installed on the system.
apt-get =meta-packaging tools for Debian
=update
=upgrade
=dselect-upgrade
=dist-upgrade
=install
=remove
=source
=check
=clean
=autoclean
+++++++
-d = download only
-f = fix a system on which dependencies is not statisfied
-m = ignore missing
-q = quiet omit progress indicator
-s = simulate
-y = produce yes for all prompt
-b = compile source package
--no-upgrade = not upgrade if the olader version is already installed
dslect,aptitude, Sypnatic = interactive text-based meta-packager
dpkg-reconfigure = use to reconfigure package(postfix etc.)
Debian package contain extra files for signature!
cfg file
/etc/dpkg/dpkg.cfg
source list
/etc/apt/sources.list
Converting between Package Formats
!
Use alien
alien = use to change oackage file to other format
--to-deb
--to-rpm
--to-slp
--to-tgz
rpmbuild = to rebuild an RPM source to package
ldd = check which libraries the programs files uses.
ldconfig = update library cache
-v = verbose
-N = dont rebuild cache, just update link
-x = opposite of -N rebuild cache not updating links
-f = change library default path
-C = change cache file
-r = treat dir as a root
-p = cause ldconfig to display the current cache
uname =show kernel information
-i = hardware
-s = kernel
-v = version
-r = release
-p = processor
-o = operating system
-n = node
-m = machine
ps = show process information
a= show all
u= show user process
e/A = show all system processes
x= display all process for user who give command
--forest = show process in linked
top = Dynamic variant of ps
-delay = specifes delay between update
-p = monitor specific processies
-n = tek number of updates
-b = batch mode ,
keymode
k = kill process
q = quite from top
r = change process prioritu
s = change display update rate
P = sets the display to sort by CPU ussage
M = sets the display to sort by Memory usage
jobs = display minimal information about the processes associated with the current sessions
pgrep = find PID easy!
-u = specifies user
fg = bring app to foreground
Ctrl +Z = bring to back
bg = runngin in the background
Manage proccess Priorites
nice = change program priorities
- = use minus
-n = chnage the priorities
--adjustment = change the priorities
!use 10 as default
-20 ~ 19 is posibble value
default priorities is 0
renice = change process priorites and need pid
exp
renice 7 16580 -u pdavison tbaker
Killing Processes
- to kill process we send signal
kill = kill processes by specifing signal and pid
-s =signal
SIGKILL=9 cause the process ot exit without performing routine shutdown tasks
SIGHUP==1 terminate interactive programs and cause many daemons to reread their configuration files
SIGTERM=15 causes the process to exit but allows it to close open files and so on
-if you not specifiying signal default is 15=SIGTERM
*nohup = make the program to ignore SIGHUP
killall = kill a process bsed on its name rather thatn its PID
-i = interactive
pkill = allow you to kill one or more processes based on usernames,user id or group ID