Skip to content

Commit c4e46a9

Browse files
committed
ops/package: Fix code block formatting
1 parent 7619e11 commit c4e46a9

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

docs/ops/package.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ icon: material/package
88

99
<!-- 简介 -->
1010

11-
APT(Advanced Package Tool) 是 Debian 发行版最常用的包管理工具。其可以执行安装,卸载,更新,系统更新,校验与修复这些常见功能。
11+
APTAdvanced Package Tool是 Debian 发行版最常用的包管理工具。其可以执行安装,卸载,更新,系统更新,校验与修复这些常见功能。
1212

1313
## APT 系列工具
1414

@@ -30,23 +30,31 @@ Debian 下还有很多包管理软件,如 Synaptics、Aptitude,这里不一
3030

3131
在手动下载 .deb 包后,使用 dpkg 直接安装 .deb 包:
3232

33-
`dpkg -i <name_version.deb>`
33+
```shell
34+
dpkg -i <name_version.deb>
35+
```
3436

3537
使用 apt 安装软件包:
3638

37-
`apt install <name>`
39+
```shell
40+
apt install <name>
41+
```
3842

3943
如果 name 有未在系统上安装的依赖的话,那么第一个命令会失败(除非使用 `--force` 选项),第二个命令会下载对应的安装包及其依赖,并且进行安装。
4044

4145
#### 卸载软件包
4246

4347
使用 dpkg 直接卸载:
4448

45-
`dpkg -r <name>`
49+
```shell
50+
dpkg -r <name>
51+
```
4652

4753
使用 apt 卸载:
4854

49-
`apt remove name`
55+
```shell
56+
apt remove name
57+
```
5058

5159
那么现在产生了一个问题:要是我安装了一个有很多依赖的包,那么我们卸载它时依赖不会同时被卸载。这样依赖会一直占据我们电脑里面的空间。而手动卸载依赖并不直观,还可能破坏其他包的依赖。
5260

@@ -317,15 +325,15 @@ sudo:
317325

318326
优先级配置条目的一般格式如下:
319327

320-
```
328+
```yaml
321329
Package: <name>
322330
Pin: <clause>
323331
Pin-Priority: <priority>
324332
```
325333
326334
例如:
327335
328-
```
336+
```yaml
329337
Package: sudo
330338
Pin: version 1.9.13p3*
331339
Pin-Priority: 1001
@@ -335,7 +343,7 @@ Pin-Priority: 1001
335343
336344
可以选择调整不同源的优先级,例如:
337345
338-
```
346+
```yaml
339347
Package: *
340348
Pin: origin "mirrors.ustc.edu.cn"
341349
Pin-Priority: 999
@@ -347,7 +355,7 @@ Pin-Priority: 999
347355
348356
对于优先级介于 990 与 999 之间的来源,就算发行目标不一致也会进行安装,除非本地的优先级更高。因此可以优先安装一些包,例如:
349357
350-
```
358+
```yaml
351359
Package: vim
352360
Pin: release a=experimental
353361
Pin-Priority: 991

0 commit comments

Comments
 (0)