If there are updates, you'll see an output similar to this: $ sudo apt-get update In the terminal, enter sudo apt-get update in the command line, enter in your admin password, and press the Enter key. For example, in Ubuntu and Linux Mint, the default terminal is Gnome Terminal, but may be listed under Terminal in the application menu. In your Debian-based Linux distro (Debian, Ubuntu, Linux Mint, Kali Linux, Raspberry Pi OS, and so on), open a terminal window.ĭepending on your distro, the terminal might go by different names depending on how you open it. How to Use the sudo apt-get update Command But just running sudo apt-get upgrade will not automatically upgrade the outdated packages – you'll still have a chance to review the changes and confirm that you want to perform the upgrades. The sudo apt-get upgrade command downloads and installs the updates for each outdated package and dependency on your system. In other words, it'll figure out what the latest version of each package and dependency is, but will not actually download or install any of those updates. The main difference is that sudo apt-get update fetches the latest version of the package list from your distro's software repository, and any third-party repositories you may have configured. What Are the Differences Between sudo apt-get update and sudo apt-get upgrade? In this article, I'll go into what both of these commands do, how to use them, and some frequently asked questions. They're common commands for Linux admins and people doing DevOps, but are handy to know even if you don't use the command line often. The general settings for individual packages.Sudo apt-get update and sudo apt-get upgrade are two commands you can use to keep all of your packages up to date in Debian or a Debian-based Linux distribution. See also apt_preferences(5) for a mechanism for overriding The /etc/apt/sources.list fileĬontains a list of locations from which to retrieve desired packageįiles. So, dist-upgradeĬommand may remove some packages. It will attempt to upgrade the most important packages at theĮxpense of less important ones if necessary. Of packages apt-get has a "smart" conflict resolution system, and An update must be performed first so thatĪpt-get knows that new versions of packages are available.ĭist-upgrade in addition to performing the function of upgrade,Īlso intelligently handles changing dependencies with new versions New versions ofĬurrently installed packages that cannot be upgraded withoutĬhanging the install status of another package will be left at Not already installed retrieved and installed. Versions available are retrieved and upgraded under noĬircumstances are currently installed packages removed, or packages Upgrade is used to install the newest versions of all packagesĬurrently installed on the system from the sources enumerated in You would get very frustrated when apt performs unscripted behavior, particularly if this leads to downtime of a production service. You might be using advanced features like apt pinning or pulling from a collection of PPAs (perhaps you have an in-house PPA), with various automations in place to inspect your system and available upgrades instead of always eagerly upgrading all available packages. To expand on why you'd want upgrade instead of dist-upgrade, if you are a systems administrator, you need predictability. If you want things to "just work", you probably want apt-get dist-upgrade to ensure dependencies are resolved. If that's important to you, use apt-get upgrade. Using upgrade keeps to the rule: under no circumstances are currently installed packages removed, or packages not already installed retrieved and installed. I typically upgrade my machines with: sudo apt-get update & time sudo apt-get dist-upgradeīelow is an excerpt from man apt-get.
0 Comments
Leave a Reply. |