LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (http://www.linuxquestions.org/questions/debian-26/)
-   -   Does apt-get install <package> upgrade the package if it is already installed? (http://www.linuxquestions.org/questions/debian-26/does-apt-get-install-package-upgrade-the-package-if-it-is-already-installed-166595/)

davidas 04-05-2004 05:38 PM

Does apt-get install <package> upgrade the package if it is already installed?
 
Eg. I have lib-2.0 installed. If I do a apt-get install lib-2.1, will it automatically upgrade lib-2.0 that is already in my system or will it install as a separate package?

Also, will I see

ii lib-2.0
ii lib-2.1

or

ii lib-2.1 (only)

when I do a dpkg -l lib-2* ?

Thanks!

leonscape 04-05-2004 05:43 PM

Depends if the lib is required for backward compatibility.

apt-get upgrade usually does the upgrading, but if this is a separate package, then there's probably a problem with just replacing it.

What lib are we talking about?

comp12345 04-05-2004 05:44 PM

It will replace the old package

davidas 04-05-2004 05:53 PM

Before installing g++-3.3:

||/ Name Version Description
+++-==============-==============-============================================
un g++ <none> (no description available)
un g++-2.95 <none> (no description available)
un g++-3.0 <none> (no description available)
ii g++-3.2 3.2.3-9 The GNU C++ compiler
un g++-3.3 <none> (no description available)

After installing g++-3.3:

||/ Name Version Description
+++-==============-==============-============================================
un g++ <none> (no description available)
un g++-2.95 <none> (no description available)
un g++-3.0 <none> (no description available)
ii g++-3.2 3.2.3-9 The GNU C++ compiler
ii g++-3.3 3.3.3-5 The GNU C++ compiler

After installing g++

||/ Name Version Description
+++-==============-==============-============================================
ii g++ 3.3.3-2 The GNU C++ compiler
un g++-2.95 <none> (no description available)
un g++-3.0 <none> (no description available)
ii g++-3.2 3.2.3-9 The GNU C++ compiler
ii g++-3.3 3.3.3-5 The GNU C++ compiler


Now I have three different versions of g++?

If there are 3 different versions listed in apt-cache search, what is the problem syntax to install: apt-get install <packagename only> or apt-install <packagename>-<version> ?

Eg. apt-cache search ^test

test-1.0
test-1.1
test-1.2

If I want to install test-1.2, do I use apt-get install test (just the package name only) or apt-get install test-1.2?

Thanks !

leonscape 04-05-2004 06:12 PM

It depends. apt-get installs the version you specifiy, or if you don't specify whatever the default is. If the default package is 1.2 then yes, if its 1.1 then no. It depends on the package. Usually it the latest version but not always.

There are several packages for g++ simply because there are slight imcompatabilites and other problems. Some programs will only compile with older versions, simply because the older version has a diffrent ABI or had a non-standard behaviour thats been fixed in the newer version, but which the program used, so it fails.

g++ simply points to the g++ 3.3 package, if type the following

cd /usr/bin
ls -l g++*

you'll probably get this

g++ -> g++-3.3
g++-3.2
g++-3.3

I don't think you have 2.95, or 3.0 installed, The cache contains stuff you don't have installed, Its a listing of whats available.


All times are GMT -5. The time now is 09:15 PM.