debian9.6安装卸载软件(apt-get方式)

关于dpkg的请看我的博文(debian9.6安装卸载软件(dpkg方式))。

1,前提

设置好源,联网,或者插入cd盘,dvd盘也行。

2,更新源

如果修改了源文件,就需要更新一下

guoyanzhang@bogon:~$ sudo apt-get update

3,升级包

guoyanzhang@bogon:~$ sudo apt-get upgrade

4,智能升级

guoyanzhang@bogon:~$ sudo apt-get dist-upgrade

3和4的区别,我的理解是,3如果更新的包对其他的软件没影响,就不改变,4则全部更新,还会解决一些最新包的依赖关系。

5,安装

guoyanzhang@bogon:~$ sudo apt-get install xxxx

6,卸载

guoyanzhang@bogon:~$ sudo apt-get remove xxxx

7,卸载一些没有用的依赖包

guoyanzhang@bogon:~$ sudo apt-get autoremove

8,卸载并删除配置文件

guoyanzhang@bogon:~$ sudo apt-get remove -purge xxxx

9,解决前一个包因为依赖性而安装失败的问题

guoyanzhang@bogon:~$ sudo apt-get -f install

这个就是我们经常看到安装某个软件失败,提示让我们执行apt-get --fix broken。

10,搜索我们要安装的软件,但是又不知道它的全名

guoyanzhang@bogon:~$ apt-cache search xxxx*

11,查看某个软件的功能

guoyanzhang@bogon:~$ apt-cache show xxxx

12,将安装盘加入本地源

guoyanzhang@bogon:~$  apt-cdrom add

13,删除已经安装的软件的安装包

guoyanzhang@bogon:~$ sudo apt-get clean

14,删除已经安装的软件的安装包和没安装的软件的软件包

guoyanzhang@bogon:~$ sudo apt-get autoclean

15,其他的请用man

guoyanzhang@bogon:~$ man apt-get 

参考:https://baike.baidu.com/item/linux/27050?fr=aladdin

猜你喜欢

转载自blog.csdn.net/weixin_39465823/article/details/86561416
今日推荐