File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ icon: material/package
88
99<!-- 简介 -->
1010
11- APT( Advanced Package Tool) 是 Debian 发行版最常用的包管理工具。其可以执行安装,卸载,更新,系统更新,校验与修复这些常见功能。
11+ APT( Advanced 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
321329Package : <name>
322330Pin : <clause>
323331Pin-Priority : <priority>
324332` ` `
325333
326334例如:
327335
328- ```
336+ ` ` ` yaml
329337Package : sudo
330338Pin : version 1.9.13p3*
331339Pin-Priority : 1001
@@ -335,7 +343,7 @@ Pin-Priority: 1001
335343
336344可以选择调整不同源的优先级,例如:
337345
338- ```
346+ ` ` ` yaml
339347Package : *
340348Pin : origin "mirrors.ustc.edu.cn"
341349Pin-Priority : 999
@@ -347,7 +355,7 @@ Pin-Priority: 999
347355
348356对于优先级介于 990 与 999 之间的来源,就算发行目标不一致也会进行安装,除非本地的优先级更高。因此可以优先安装一些包,例如:
349357
350- ```
358+ ` ` ` yaml
351359Package : vim
352360Pin : release a=experimental
353361Pin-Priority : 991
You can’t perform that action at this time.
0 commit comments