ubuntu apt工具详解
ubuntu软件包工具的使用
- apt-get和apt命令介绍
apt等同于Centos7的yum命令,是第一代的包管理工具,最稳定,比apt-get要先进,官方推荐使用apt来管理软件
- 常用命令
# 更新软件源列表
apt update
# 安装软件
apt install package
# 卸载软件
apt remove package
# 搜索包
apt-cache search package
配置apt软件源
ubuntu下的软件源可以在阿里源或者清华源上找到相应的配置方法:
vim /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
更新缓存:
apt update