Advertisement

Ubuntu: How to upgrade a single package using apt-get?

Ubuntu: How to upgrade a single package using apt-get? Ubuntu: How to upgrade a single package using apt-get?


Question: How do I update a single package? As far as man apt-get says apt-get upgrade
doesn't take a package/list of packages as parameter:
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.

Solutions Sample (Please watch the whole video to see all solutions, in order of how many people found them helpful):

== This solution helped 122 people ==
In order to update a single package using the CLI:
sudo apt-get install --only-upgrade <packagename>
e.g., sudo apt-get install --only-upgrade ack
Reading package lists... Done
Building dependency tree
Reading state information... Done
Skipping **ack**, it is not installed and only upgrades are requested.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

== This solution helped 15 people ==
On Ubuntu 9.04 Jaunty,
apt-get --only-upgrade install <package>
yields:
E: Sense only is not understood, try true or false.
The command
apt-get --only-upgrade true install <package>
worked in my case.

== This solution helped 24 people ==
In my experience on Ubuntu 12.04 LTS, using the command below will not upgrade
the package if using a separate PPA -
sudo apt-get --only-upgrade install <packagename>
Similarily, I did not want to run the upgrade command, which would upgrade all
packages on my server -
sudo apt-get dist-upgrade
For example, I have PHP 5.3 installed and have added the ondrej PPA to my
apt.sources using -
sudo add-apt-repository ppa:ondrej/php5
If I run
sudo apt-get install php5
it will just reinstall PHP 5.3.
I have to, first, determine the version number to upgrade to, using
sudo apt-cache policy php5
This will list all available version numbers. You should find the version
number you want to upgrade to, and then copy the whole string that references
it. For example, the string for PHP 5.5 on Ubuntu is "5.5.16+dfsg-
1+deb.sury.org~precise+2".
Now, you can run the apt-get install command with the specific version number,
and voila!
sudo apt-get install php5=5.5.16+dfsg-1+deb.sury.org~precise+2
I only added this because I was unable to find this information anywhere else!

== This solution helped 52 people ==
There are two possible ways I can think of:
1. sudo apt-get install nameofpackage
This will upgrade the package even if is already installed:
~$ sudo apt-get install emesene
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
emesene
1 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
Need to get 1,486 kB of archives.
After this operation, 696 kB disk space will be freed.
Get:1 natty-updates/universe emesene
all 2.11.4+dfsg-0ubuntu1 [1,486 kB]
2. UsingSynaptic Package Manager: Right click→Mark for upgrade:
[enter image description here]
Note: Sometimes it may asks for additional packages or dependencies, it
is normal.

With thanks & praise to God! With thanks to all the many who have made this project possible! | Content (except music & images) licensed under cc by-sa 3.0 | Music & music license: | Images & images license: and others | With thanks to user svick ( user Shane ( user muru ( user lurscher ( user karthik ( user Josh ( user John M. ( user Ian ( user golem ( user Eliah Kagan ( user chopsuei3 ( user Binarylife ( and the Stack Exchange Network ( Trademarks are property of their respective owners. Disclaimer: All information is provided "AS IS" without warranty of any kind. You are responsible for your own actions. Please contact me if anything should be amiss at Roel D.OT VandePaar A.T gmail.com.

ubuntu,apt,upgrade,question,answer,package management,apt-get,software,packages,installation,solutions,

Post a Comment

0 Comments