apt介绍

apt是Advanced Packaging Tool的简称。

在Ubuntu下,我们可以使用apt命令进行软件包的更新安装删除清理

类似于Windows的软件管理工具.

就是Centos的yum

但是更新很慢,强烈建议在 /etc/apt/sources.list 文件修改换源!

关于apt的所有指令都要在root权限下执行或者加上sudo

apt更新软件下载地址教程

  1. 查看Ubuntu的版本中Codename信息

    lsb_release -a
  2. 修改源文件

    sudo gedit /etc/apt/sources.list
  3. 将内容替换

    deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
    # 注意须将xenial改成自己系统的Codename
    # 阿里云源
    deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
    ##proposed表示測試版源,不建议启用
    #deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
    # 源碼
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
    ##測試版源
    #deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
    # 清华大学源
    deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
    deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
    deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
    deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
    ##測試版源
    #deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
    # 源碼
    deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
    deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
    deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
    deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
    ##proposed表示測試版源,不建议启用
    #deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
  4. 更新源

    apt-get update

    这个命令,会访问源列表里的每个网址,并读取软件列表,然后保存在本地电脑。 我们在软件包管理器里看到的新的软件列表,都是通过update命令更新的。

  5. 更新软件(如果不需要更新就不用)

    apt-get upgrade

apt相关命令

更新源(就你换了apt源位置地址后需要更新一次)

apt-get update

升级系统

apt-get dist-upgrade

下载包的源代码

apt-get source 包名

安装包相关指令


安装包

apt-get install 包名

重新安装包

apt-cache install 包名 --reinstall

修复安装

apt-get -f install

安装相关编译环境

apt-get build-dep 包名

更新已安装的包

apt-get upgrade

删除包相关指令

删除包

apt-get remove 包名

删除包和包的配置文件

apt-get remove 包名 --purge

查询包信息相关指令

搜索相关软件包

apt-cache search 包名

获取包的相关信息

apt-cache show 包名

了解这个包需要哪些依赖

apt-cache depends 包名

查看这个包是什么包的依赖

apt-cache redpends 包名

dpkg介绍

dpkg是一个Debian的命令行工具。

用来安装,删除,构建和管理Debian的软件包

就类似CentOS的rpm软件包管理工具

dpkg相关命令

安装软件

dpkg -i 软件包的路径地址

列出已安装的软件

dpkg -l

卸载软件

dpkg -r 软件名

查看软件包内容

就查看你离线下载到本地的那个软件包里面的内容

dpkg -c 软件包路径

查看已安装软件的信息

dpkg -s 软件包名

查看软件包安装位置

dpkg -L 软件包名

筛选包含指定模式的软件包

dpkg -S 指定模式

Linx__Ubuntu_APT的更多相关文章

随机推荐

  1. PHP生成器yield使用示例

    <?php function getLines($file) { $f = fopen($file, 'r'); try { while ($line = fgets($f)) { yield ...

  2. linux rz上传失败

    最近rz上传文件时出现了一次文件上传失败的情况,故搜集了以下资料加强学习 rz -ary --o-sync -a 表示使用ascii码格式传输文件,如果是Dos格式的文件,会转换为unix格式 -r ...

  3. Vue 样式绑定 && 条件渲染

    1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="UTF-8" /> 5 & ...

  4. 小白之Python基础(一)

    一.数字类型: 1.整形 十进制:默认为十进制:(如:99,100.......) 十六进制: 0x,0X开头的表示16进制数 二进制:0b,0B开头的表示2进制数 八进制: 0o,0O开头的表示8进 ...

  5. React报错之Objects are not valid as a React child

    正文从这开始~ 总览 当我们尝试在JSX代码中,直接渲染对象或者数组时,会产生"Objects are not valid as a React child"错误.为了解决该错误, ...

  6. WPF 截图控件之移除控件(九)「仿微信」

    WPF 截图控件之移除控件(九)「仿微信」 WPF 截图控件之移除控件(九)「仿微信」 作者:WPFDevelopersOrg 原文链接: https://github.com/WPFDevelope ...

  7. vue2与vue3实现响应式的原理区别和提升

    区别: vue2.x: 实现原理: 对象类型:Object.defineProperty()对属性的读取,修改进行拦截(数据劫持): 数组类型:通过重写更新数组的一系列方法来进行拦截(对数组的变更方法 ...

  8. CDO如何盘点算法、推动算法业务增长

    在数字经济时代,算法对企业业务增长至关重要,是企业进行数字化转型.构建竞争优势的关键.IT工程师或数据分析师可能会将算法描述为一组由数据操作形成的规则.而从业务价值方面考虑,算法是一种捕获商业机会.提 ...

  9. Docker 链接sqlserver时出现en-us is an invalid culture错误解决方案

    在部署服务到docker的时候出现全球化错误 System . Global ization . Cul tureNotFoundException: Only the invariant cultu ...

  10. Spring 03 切面编程

    简介 AOP(Aspect Oriented Programming),即面向切面编程 这是对面向对象思想的一种补充. 面向切面编程,就是在程序运行时,不改变程序源码的情况下,动态的增强方法的功能. ...