|
|
ubuntu系统同步apt源到本地
8 M2 S5 S: _+ m: w, L2 j ]) k9 G1 z8 x0 E. `; s' d" A( x5 q
/ M, m& g! I/ ?
( D0 I4 _( L/ Z, M, Q& n, G
root@localhost:~# apt install -y apt-mirror $ O3 C/ S) Q5 f5 M" ~' ~/ n& H+ N
Reading package lists... Done$ I9 m9 \# f, H+ G
Building dependency tree... Done
* [8 W9 c0 N( T& wReading state information... Done
# O5 E2 |) k* r! k% [The following NEW packages will be installed: U6 g9 A2 V8 f6 ^
apt-mirror. ^( V( ^) U3 m3 d1 h6 u
0 upgraded, 1 newly installed, 0 to remove and 53 not upgraded.
! g$ J: M' j" l( C& T6 ?Need to get 14.5 kB of archives.* B$ z, v! i, P6 k8 L
After this operation, 68.6 kB of additional disk space will be used., K/ D8 e2 J# b4 y0 [ V X$ h# x
Get:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu lunar/universe amd64 apt-mirror all 0.5.4-2 [14.5 kB]
+ O. r5 N+ x) v2 QFetched 14.5 kB in 0s (49.2 kB/s) * n5 T4 ~& P' C! Y0 A
Selecting previously unselected package apt-mirror.
2 G6 y1 K7 r# M( D5 S(Reading database ... 82861 files and directories currently installed.) ?; f, b- M! D! _6 _
Preparing to unpack .../apt-mirror_0.5.4-2_all.deb ...
- q( h: f5 y S" W$ O. FUnpacking apt-mirror (0.5.4-2) ...( g2 s# I) {& M0 d
Setting up apt-mirror (0.5.4-2) ..., [* c# r6 D3 e) G; j* [% `
Processing triggers for man-db (2.11.2-1) ...
* _/ y' |/ p2 ^# F3 i7 U6 K/ mScanning processes...
G7 T S" A1 M6 i! O. y0 wScanning processor microcode...
: g7 }2 W A. _/ \Scanning linux images...
$ K, s$ B# y/ v& E, \" l/ v
$ d# J! ~1 X% y! q$ zRunning kernel seems to be up-to-date.
: x4 }+ w- b* m" I- [: b/ ?
$ r6 R2 g! S8 ^Failed to check for processor microcode upgrades.
6 U0 W2 L% f, Q' C6 R1 ^
! t" [& K$ v$ H; y2 L N* pNo services need to be restarted.
7 t5 A5 y D$ i# M
. T' M' X% j0 p; I6 RNo containers need to be restarted.9 h! f3 I0 S& y; i }; L
1 R* O% \$ S# C1 n* U" f. }4 ^No user sessions are running outdated binaries.
, d2 |7 n7 p; v+ L2 w/ _6 t8 [9 ~9 Q! @$ s: T/ R; \7 @ ~; h* W
No VM guests are running outdated hypervisor (qemu) binaries on this host.. V: H3 D* a; r# H$ m8 w
6 m6 g0 i6 P0 {, e& k& H: K4 t
( ]! F5 q4 z4 e+ t+ g
配置文件:
( M% B+ U: N6 b. ]" J* T5 x
B' P% H3 y1 `% J, x############# config ##################3 R2 u& I$ B3 p' \0 [
#" w: g8 O$ E" S1 ^ t" M& }
set base_path /var/www/html/; L; C+ n- v) W. {4 X* X
## }$ g7 D+ f% [" Z
# set mirror_path $base_path/mirror
) n. F) q0 W/ ]) m# set skel_path $base_path/skel
. U( Y# B/ W4 M, t% o& ?: u' M5 n# set var_path $base_path/var+ {5 v2 e) D" h1 M+ E0 H& }
# set cleanscript $var_path/clean.sh. I! w. e& e) Q e+ z
# set defaultarch <running host architecture>, n# [" K( t" l6 A
# set postmirror_script $var_path/postmirror.sh+ B8 S- M; T4 ^- _ j$ @: s/ R4 z
# set run_postmirror 0; V0 M. s0 `! K# }4 J
set nthreads 20
9 a2 H/ m4 s3 b7 Q& O5 a, Cset _tilde 0
. T. _5 g: ]4 ]( h8 L4 P6 K3 e2 M#
0 N% O5 K* I$ m" X############# end config ##############
1 T" h! t9 p; ^8 u# E4 p$ X+ |! w0 M2 c" P9 Q3 X$ B9 M
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse" ^ B; r( O5 Y1 p' u$ @
5 C( f% n5 ~! W
) V' B5 Q/ s9 |0 [: X6 U7 u1 Rdeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse% y4 ?! F) y! k V7 p0 l
#deb-src http://archive.ubuntu.com/ubuntu kinetic-proposed main restricted universe multiverse; L8 P5 e V \7 z' @& }
#deb-src http://archive.ubuntu.com/ubuntu kinetic-backports main restricted universe multiverse
% \. }7 K$ a0 G2 |% @8 @! ^; f1 l6 R1 M1 [5 u5 J
clean https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/
; k5 a8 r0 \4 o. f
" O* g$ u$ K) J% E- C3 c# q4 y0 l' Q+ y: J1 e: Z. E4 O
执行
. }- s$ @$ [4 F! e7 f! N% ~ apt-mirror
" C2 ?+ {8 M8 L: ]1 R2 m2 K6 \- Y
1 J# l" }; q% |9 `; ]7 g* K
4 X7 f- Y% d1 X: g8 F' D+ g& ]' |
# W9 P. a$ }, w9 v9 z/ m6 X0 v9 T9 K- {/ @. Q( `
6 _- ]* N6 a- P |
|