update
update is used to resynchronize the package index files from their
sources. The indexes of available packages are fetched from the
location(s) specified in /etc/apt/sources.list. For example, when
using a Debian archive, this command retrieves and scans the
Packages.gz files, so that information about new and updated
packages is available. An update should always be performed before
an upgrade or dist-upgrade. Please be aware that the overall
progress meter will be incorrect as the size of the package files
cannot be known in advance. upgrade
upgrade is used to install the newest versions of all packages
currently installed on the system from the sources enumerated in
/etc/apt/sources.list. Packages currently installed with new
versions available are retrieved and upgraded; under no
circumstances are currently installed packages removed, or packages
not already installed retrieved and installed. New versions of
currently installed packages that cannot be upgraded without
changing the install status of another package will be left at
their current version. An update must be performed first so that
apt-get knows that new versions of packages are available. dist-upgrade
dist-upgrade in addition to performing the function of upgrade,
also intelligently handles changing dependencies with new versions
of packages; apt-get has a "smart" conflict resolution system, and
it will attempt to upgrade the most important packages at the
expense of less important ones if necessary. The dist-upgrade
command may therefore remove some packages. The
/etc/apt/sources.list file contains a list of locations from which
to retrieve desired package files. See also apt_preferences(5) for
a mechanism for overriding the general settings for individual
packages. 上面的内容是从apt-get的man文档中摘录出来的。上面表达的意思就是,update的作用是从/etc/apt/source.list文件中定义的源中去同步包的索引文件,即运行这个命令其实并没有更新软件,而是相当于windows下面的检查更新,获取的是软件的状态。 而upgrade则是更据update命令同步好了的包的索引文件,去真正地更新软件。 而dist-upgrade则是更聪明的upgrade,man文档中说它以更聪明的方式来解决更新过程中出现的软件依赖问题,它也是从/etc/apt/source.list文件中获得地址,然后从这些地址中检索需要更新的包。 最后,需要注意的一点是,每回更新之前,我们需要先运行update,然后才能运行upgrade和dist-upgrade,因为相当于update命令获取了包的一些信息,比如大小和版本号,然后再来运行upgrade去下载包,如果没有获取包的信息,那么upgrade就是无效的啦!

Ubuntu点滴--apt-get update和upgrade的作用的更多相关文章

  1. ubuntu sudo update与upgrade的作用及区别

    ubuntu sudo update与upgrade的作用及区别 入门linux的同志,刚开始最迫切想知道的,大概一个是中文输入法,另一个就是怎么安装软件.本文主要讲一下LINUX安装软件方面的特点. ...

  2. ubuntu 手动更新源 以及使用sudo update与upgrade的作用及区别

    一.今天更新一下我的ubuntu系统,用了几个源发现不怎么好用 上网查了一下发现有说阿里云的源挺好用 然后我试了一下 下载速度还挺快,下面分享一下怎么手动添加源列表 1.最好先做一下备份 sudo c ...

  3. Linux中的update和upgrade的作用

    update 是同步 /etc/apt/sources.list 和 /etc/apt/sources.list.d 中列出的源的索引,这样才能获取到最新的软件包.update是下载源里面的metad ...

  4. Linux - Ubuntu下执行apt-get update报错:Some index files failed to download. They have been ignored, or old ones used instead.

    报错命令 root@ubuntu:/etc/apt# apt-get update Err: http://mirrors.aliyun.com/ubuntu trusty InRelease Cou ...

  5. Ubuntu用sudo apt-get update出错:E: Problem executing scripts APT::Update::Post-Invoke-Success

    Ubuntu用sudo apt-get update出错:   E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /u ...

  6. 关于Ubuntu下apt的一些用法及和yum的比较

    Fedora和Red Hat有yum安装软件,Ubuntu有apt工具. apt简单的来说,就是给Ubuntu安装软件的一种命令方式. 一.apt的相关文件 /etc/apt/sources.list ...

  7. 在Ubuntu下运行 apt-get update命令后出现错误:

    在Ubuntu下运行 apt-get update命令后出现错误: The package lists or status file could not be parsed or opened sud ...

  8. Fully Update And Upgrade Offline Debian-based Systems

    Let us say, you have a system (Windows or Linux) with high-speed Internet connection at work and a D ...

  9. 修改Ubuntu默认apt下载源

    修改Ubuntu默认apt下载源 默认下载源很慢,改成阿里的下载速度超快 sudo vim /etc/apt/sources.list 将文件内容替换成 deb http://mirrors.aliy ...

随机推荐

  1. ZK框架的分析与应用

    前言:本文是在下的在学习ZK官方文档时整理出来的初稿.本来里面有很多的效果图片和图片代码的.奈何博客园中图片不能粘贴上去,所以感兴趣的筒子们就将就吧.内容中,如有不好的地方,欢迎斧正! ZK框架的分析 ...

  2. 105、android:windowSoftInputMode属性详解

    activity主窗口与软键盘的交互模式,可以用来避免输入法面板遮挡问题,Android1.5后的一个新特性. 这个属性能影响两件事情: [一]当有焦点产生时,软键盘是隐藏还是显示 [二]是否减少活动 ...

  3. DataTable.select() 返回 DataTable

    DataTable.select() 默认返回值为 DataRow[]数组 代码来自网络: /**/ /// <summary> /// 执行DataTable中的查询返回新的DataTa ...

  4. DML(Oralce)

    创建视图简化上面              视图就是一张表    一个子查询  虚表 视图通常以v$开头 grant create table,create view to scott;        ...

  5. 在Yarn上运行spark-shell和spark-sql命令行

    转载自:http://lxw1234.com/archives/2015/08/448.htm 如果你已经有一个正常运行的Hadoop Yarn环境,那么只需要下载相应版本的Spark,解压之后做为S ...

  6. 列出当前ARM开发板系统加载的模块

    lsmod 列出当前系统中加载的模块,其中左边第一列是模块名,第二列是该模块大小,第三列则是使用该模块的对象数目

  7. js捕获回车事件,并且获取每一条输入内容

    <body> <div style="width: 200px; height: 20px;"> <textarea id="inputVa ...

  8. loadrunner11安装与破解

    最近准备学习LR,借助这个平台,将自己的学习经历记录下来,当然很多都不是原创,都是遇到问题时各种百度,然后梳理下知识是为了避免以后遇到同样的错误时,能回过头来参考参考. 下面的是转载某位大神的博客,尊 ...

  9. 使用eclipse上传项目到开源中国代码托管Git@osc教程

    创建项目 安装EGit插件 没有的话看下图 生成公钥 注册git账号 新建git项目 添加公钥 建立本地代码库 本文章版权归博主所有,如需转载请私信.

  10. Selenium2.0介绍

    selenium是一个web的自动化测试工具,和其它的自动化工具相比来说其最主要的特色是跨平台.跨浏览器. 支持windows.linux.MAC,支持ie.ff.safari.opera.chrom ...