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. ssh-keygen+ssh-copy-id无密码登录远程LINUX主机(转载)

    From:http://blog.163.com/lgh_2002/blog/static/44017526201011333227161/ 1.创建公钥和私钥 ligh@local-host$ ss ...

  2. iOS 图片拉伸 resizableImageWithCapInsets

    UIImage *image =  [[UIImage imageNamed:@"test.png"] resizableImageWithCapInsets:UIEdgeInse ...

  3. ISO14229系列之一:简介

    作者:autogeek 原文链接:http://www.cnblogs.com/autogeek/p/4458591.html 前言 由于工作中经常用到ISO-14229,因此决定对该协议做个总体介绍 ...

  4. 采访ServiceStack的项目领导Demis Bellot——第2部分(转)

    ServiceStack是一个开源的.支持.NET与Mono平台的REST Web Services框架.InfoQ有幸与Demis Bellot深入地讨论了这个项目.在这篇两部分报道的第2部分中,我 ...

  5. Java实现单向链表的增删改查

    class List<T> { private class Node { private T data; private Node next; private Node(T data) { ...

  6. 算法库:OpenCV3编译配置

    2016-01-20  23:55 更新: 关于Opencv3.1的lib文件 opencv_aruco310d.libopencv_bgsegm310d.libopencv_bioinspired3 ...

  7. [SQL]reName存储过程

    exec sp_helptext aa--应用sp_helptext查看存储过程的定义文本 exec sp_depends aa --通过sp_depends查看存储过程的相关性 exec sp_he ...

  8. ormlite性能对比

    看了一下现在的android设备,性能都不差,就懒得直接用sqlite,直接上ORM框架把,上网搜了一圈,觉得androrm, ormlite 这两个不错,当然,还有点别的,这里就不多做介绍,竟然说明 ...

  9. hbase的regionserver宕机

    错误日志: regionserver.HRegionServer: Failed deleting my ephemeral node zookeeper.RecoverableZooKeeper: ...

  10. 【练习】显示MySQLadmin 库户籍选项

    [oracle@enmo ~]$ mysqladmin -V mysqladmin Ver , for Linux on x86_64