{"id":7833,"date":"2021-02-03T16:14:20","date_gmt":"2021-02-03T13:14:20","guid":{"rendered":"https:\/\/kifarunix.com\/?p=7833"},"modified":"2024-03-19T19:59:02","modified_gmt":"2024-03-19T16:59:02","slug":"upgrade-a-single-package-on-ubuntu","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/upgrade-a-single-package-on-ubuntu\/","title":{"rendered":"Upgrade a Single package on Ubuntu"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"908\" height=\"316\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/02\/upgrade-single-package.png\" alt=\"Upgrade a Single package on Ubuntu\" class=\"wp-image-7849\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/02\/upgrade-single-package.png?v=1612349908 908w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/02\/upgrade-single-package-768x267.png?v=1612349908 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/02\/upgrade-single-package-150x52.png?v=1612349908 150w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/02\/upgrade-single-package-300x104.png?v=1612349908 300w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/02\/upgrade-single-package-696x242.png?v=1612349908 696w\" sizes=\"(max-width: 908px) 100vw, 908px\" \/><\/figure><\/div>\n\n\n<p>Follow through this guide to learn how to upgrade a single package on Ubuntu.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Upgrading a Single package on Ubuntu<\/h2>\n\n\n\n<p>Ubuntu and other Debian derivatives provides commands such as <code><strong>apt upgrade<\/strong><\/code> for upgrading the system packages.<\/p>\n\n\n\n<p>According to APT man pages, <strong><code>man apt<\/code><\/strong>;<\/p>\n\n\n\n<p><strong><code>apt upgrade:<\/code><\/strong> <em>is used to install available upgrades of all packages currently installed on the system from the sources configured via sources.list(5). New packages will be installed if required to satisfy dependencies, but existing packages will never be removed. If an upgrade for a package requires the removal of an installed package the upgrade for this package isn&#8217;t performed<\/em>.<\/p>\n\n\n\n<p>In order to install a package in Ubuntu, you would usually run the command;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install &lt;packagename&gt;<\/code><\/pre>\n\n\n\n<p>Where <code><strong>&lt;packagename&gt;<\/strong><\/code> is the name of the package in question.<\/p>\n\n\n\n<p>So upgrading a single package on Ubuntu, you would pass yet another option,<code><strong> --only-upgrade<\/strong><\/code> to the <code><strong>apt install<\/strong><\/code> command such that your command looks like;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install --only-upgrade &lt;packagename&gt;<\/code><\/pre>\n\n\n\n<p>Note that the package ought to have already been installed.<\/p>\n\n\n\n<p>For example, let us list the packages that can be upgraded on my Ubuntu 20.04 system;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt list --upgradable<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Listing... Done\nfirefox-locale-en\/focal-updates,focal-security 85.0+build1-0ubuntu0.20.04.1 amd64 &#91;upgradable from: 84.0.2+build1-0ubuntu0.20.04.1]\nfirefox\/focal-updates,focal-security 85.0+build1-0ubuntu0.20.04.1 amd64 &#91;upgradable from: 84.0.2+build1-0ubuntu0.20.04.1]\nlibmysqlclient21\/focal-updates,focal-security 8.0.23-0ubuntu0.20.04.1 amd64 &#91;upgradable from: 8.0.22-0ubuntu0.20.04.3]\nskypeforlinux\/stable 8.68.0.100 amd64 &#91;upgradable from: 8.67.0.96]\nubuntu-drivers-common\/focal-updates 1:0.8.6.4~0.20.04.1 amd64 &#91;upgradable from: 1:0.8.6.3~0.20.04.2]<\/code><\/pre>\n\n\n\n<p>As you can see, I have some packages that can be upgraded.<\/p>\n\n\n\n<p><strong>NOTE:<\/strong> if i run apt upgrade, all these packages will be marked for upgrade;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt upgrade<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Reading package lists... Done\nBuilding dependency tree       \nReading state information... Done\nCalculating upgrade... Done\nThe following package was automatically installed and is no longer required:\n  libllvm10\nUse 'sudo apt autoremove' to remove it.\n<strong>The following packages will be upgraded:\n  firefox firefox-locale-en libmysqlclient21 skypeforlinux ubuntu-drivers-common<\/strong>\n5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.\nNeed to get 141 MB of archives.\nAfter this operation, 2,381 kB disk space will be freed.\nDo you want to continue? [Y\/n]<\/code><\/pre>\n\n\n\n<p>Update the package cache;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt update<\/code><\/pre>\n\n\n\n<p>Then, upgrade a single package using the <code><strong>apt install --only-upgrade<\/strong><\/code> command.<\/p>\n\n\n\n<p>For example, If i want to upgrade only skypeforlinux package as per my output of the list of upgradable packages;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install --only-upgrade skypeforlinux<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Reading package lists... Done\nBuilding dependency tree       \nReading state information... Done\nThe following package was automatically installed and is no longer required:\n  libllvm10\nUse 'sudo apt autoremove' to remove it.\nThe following packages will be upgraded:\n  skypeforlinux\n1 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.\nNeed to get 83.1 MB of archives.\nAfter this operation, 2,857 kB disk space will be freed.\nGet:1 https:\/\/repo.skype.com\/deb stable\/main amd64 skypeforlinux amd64 8.68.0.100 &#91;83.1 MB]<\/code><\/pre>\n\n\n\n<p>As a side note, if you want to install or upgrade a package and at the same time you need to remove packages that are no longer required, pass the <code><strong>--auto-remove<\/strong><\/code> option.<\/p>\n\n\n\n<p>for example;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install --only-upgrade skypeforlinux --auto-remove<\/code><\/pre>\n\n\n\n<p>You would achieve the same y running the command;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt autoremove<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Further Reading<\/h4>\n\n\n\n<p>Consult APT man pages for detailed information on using it.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><code><strong>man apt<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Follow through this guide to learn how to upgrade a single package on Ubuntu. Upgrading a Single package on Ubuntu Ubuntu and other Debian derivatives<\/p>\n","protected":false},"author":3,"featured_media":7849,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[49,121],"tags":[3102,3104,3103,3105,3101,3099,3100,3106],"class_list":["post-7833","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-command-cheatsheets","category-howtos","tag-only-upgrade","tag-apt-install","tag-apt-install-only-upgrade","tag-apt-upgrade-single-package","tag-ubuntu-apt-upgrade","tag-upgrade-one-package-ubuntu","tag-upgrade-single-package-ubuntu","tag-upgrade-specific-package-ubuntu","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/7833"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=7833"}],"version-history":[{"count":4,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/7833\/revisions"}],"predecessor-version":[{"id":21947,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/7833\/revisions\/21947"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/7849"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=7833"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=7833"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=7833"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}