0

When you install a package manually via a .deb file it doesn't get updated by apt (see also the How does update work with programs installed from .deb file question), but what happens when you install a package that isn't available from the repositories for the current Ubuntu version, but gets included into a later Ubuntu version. When you upgrade to this new version that includes the package by default, will the system:

  • Realize that the package is already installed and update it in the proper way.
  • Realize that the package is already installed, but hold it on the manually installed version.
  • Not realize that it is installed and install it again, causing the same package to be installed twice.
  • Crash and burn in some other way?

If any of the later options is the correct answer, how do I prevent it?

Manuel Jordan
  • 1,768
  • 7
  • 30
  • 50
Minos
  • 1,771

2 Answers2

2

The package manager doesn't care whether a package has been installed by dpkg or apt. If it finds a newer version of a package in the repositories that newer version gets installed.

In your case that means your package gets updated if the package in the new Ubuntu version has a higher version number.

See "How to prevent updating of a specific package?" if you don't want updates for your package.

  • It's still a bit unclear, doesn't this contradict the answer to the question I linked to: "Now, when you download a .deb file manually, you are bypassing apt and will use dpkg -i packagename.deb to install it mannually. This means that apt's database will not be updated and that the apt system will have no knowledge of the package you installed. In other words, apt-get upgrade will never update any manually installed packages." or am I missing something? – Minos Jan 17 '15 at 17:13
  • That information is wrong. You can try it yourself: Download e.g. the bash-doc package for 10.04 (assuming you are running a newer version of Ubuntu), install it via dpkg and run sudo apt-get upgrade. – Florian Diesch Jan 17 '15 at 18:06
0

Maybe it's only certain sources that include the ability to update. The linked you posted states that when you install with dpkg it bypasses apt and therefore won't get updated.

As a test I searched what version of nodejs is available in Utopic (v0.10.25) and then installed nodejs (v0.10.20) using checkinstall

I downloaded and extracted then ran:

./configure
 make
 sudo checkinstall -D

Once installed I checked the version and it was in fact 0.10.20

I then did an

  sudo apt-get update 
  sudo apt-get upgrade 

And was told node was being held back

So I tried

 sudo apt-get dist-upgrade

And it updated node. I check version after and it reports 0.10.25 (the version available for Utopic)

So I'm not sure if it only some packages manually installed that will update, or if it cause I used checkinstall to make the deb/install.

The only weird thing is when I manually installed I checked version with

 node -v

But since update using apt, now I have to use

nodejs -v

So again, I built an old version deb from source using checkinstall and it updated to latest version using

 sudo apt-get dist-upgrade
geoffmcc
  • 1,334