免费的推文制作网站,网站知名度,微信电脑网站是什么原因,做旅游网站的首页的图片编辑整理 by Staok。
注#xff1a;在 Github 上的原版文章日后可能会更新#xff0c;在其它位置发的不会跟进。文章的 Gitee 仓库地址#xff0c;Gitee 访问更流畅。 Ubuntu 下的包管理 / apt工具
包管理系统的功能和优点大致相同#xff0c;但打包格式和工具会因平台在 Github 上的原版文章日后可能会更新在其它位置发的不会跟进。文章的 Gitee 仓库地址Gitee 访问更流畅。 Ubuntu 下的包管理 / apt工具
包管理系统的功能和优点大致相同但打包格式和工具会因平台不同的 Linux 发行版而异如下表所示。
操作系统格式工具Debian.debapt, apt-cache, apt-get, dpkgUbuntu.debapt, apt-cache, apt-get, dpkgCentOS.rpmyumFedora.rpmdnfFreeBSDPorts, .txzmake, pkg
一般来说 Ubuntu 下很多软件是需要先自行提供源码使用源码自行编译编译完成以后使用命令 “install” 来安装到系统中。当然 Ubuntu 下也有其它的软件安装方法使用得最多的方法就是自行编译源码后进行安装尤其是嵌入式 Linux 开发。
自行对软件源码编译的一个好处是可以针对不同平台进行编译和部署。
我们利用软件包管理系统可以直接下载并安装所有通过认证的软件其中 Ubuntu 下我们用的最多的下载工具 APT 下载工具 APT 下载工具可以实现软件自动下载、配置、安装二进制或者源码的功能。 在我们使用 APT 工具下载安装或者更新软件的时候首先会在下载列表中与本机软件进行对比看一下需要下载哪些软件或者升级哪些软件默认情况下 APT 会下载并安装最新的软件包被安装的软件包所依赖的其它软件也会被下载安装或者更新非常智能省心。
包管理工具 apt
Linux apt 命令 | 菜鸟教程 (runoob.com)。
# package 替换为 包名。
sudo apt-get update 更新源
sudo apt-get upgrade 更新已安装的包
sudo apt-get install package 安装包
sudo apt-get remove package 删除包
sudo apt-cache search package 搜索软件包
sudo apt-cache show package 获取包的相关信息例如说明、大小、脚本等
sudo apt-get install package --reinstall 重新安装包
sudo apt-get -f install 修复安装
sudo apt-get remove package --purge 删除包包括配置文件等
sudo apt-get build-dep package 安装相关的编译环境
sudo apt-get dist-upgrade 升级系统
sudo apt-cache depends package 了解使用该包依赖那些包
sudo apt-cache rdepends package 查看该包被那些包依赖
sudo apt-get source package 下载该包的源代码
换源 和 添加系统变量
换源
Ubuntu Ports更换成阿里云镜像源-阿里云开发者社区 (aliyun.com)。 首先备份源列表sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup 编辑 /etc/apt/sources.list 文件在文件最前面添加镜像源 # 阿里源
deb https://mirrors.aliyun.com/ubuntu-ports/ xenial main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu-ports/ xenial-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu-ports/ xenial-backports main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu-ports/ xenial-security main restricted universe multiverse
# deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
# deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
# deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
# deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
# deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
# 清华源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse# 中科大源
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# 163源
deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse 更新源 sudo apt update
sudo apt upgrade
添加系统变量 临时终端中键入 export PATH$PATH:目录/要添加的系统变量重启后丢失。 永久只对当前用户有效修改 ~/.bashrc 文件在行尾添加 export PATH$PATH:目录/要添加的系统变量然后终端键入 source ~/.bashrc 使之生效即可。
Ubuntu 下的卸载包
Ubuntu GUI 界面操作 使用 Synaptic 软件包管理器进行卸载。系统里面若没有 Synaptic Pack Manager 软件则在终端安装 sudo apt-get install synaptic具体使用方法。 使用 Ubuntu 的软件中心进行卸载。略。
Ubuntu 终端里操作 列出所有软件包以可翻页的形式dpkg --list | less以搜索特定包名的形式dpkg --list | grep -n python还可以加通配符很灵活。 卸载程序和所有配置文件sudo apt-get --purge remove package-name。 只卸载程序但保留配置文件sudo apt-get remove package-name。 删除没用的依赖包sudo apt-get autoremove package-name加上 --purge 选项就是程序和配置文件都删除。资源不紧张时此条慎用。