3

Hello im just new for Linux

I know that sudo apt-get is for installing application

but how I would know that I have installed the latest version of the application

for example apt-get install sun-java6-jdk

is there an option to upgrade or see the latest version

or its ok to install an old version the application and Linux will upgrade it for me ?

3

Use the apt-cache policy command:

$ apt-cache policy openjdk-6-jre
openjdk-6-jre:
  Installed: (none)
  Candidate: 6b32-1.13.4-4ubuntu0.14.04.1
  Version table:
     6b32-1.13.4-4ubuntu0.14.04.1 0
        500 http://aptmirror.fqdn/ubuntu/ trusty-security/universe amd64 Packages
     6b31-1.13.3-1ubuntu1 0
        500 http://aptmirror.fqdn/ubuntu/ trusty/universe amd64 Packages

It says that I don't have any version installed, and of the available versions, 6b32-1.13.4-4ubuntu0.14.04.1 (the candidate) will be installed if I do sudo apt-get install openjdk-6-jre.

Even if you have it installed already, if you do sudo apt-get install openjdk-6-jre, the latest version available (according to the Candidate field above) will be installed. So an installed package will be upgraded.

You can press CtrlC to exit from most programs, including sudo password prompts and apt-get. It's a very bad idea to do so with apt-get. You can cancel while the download is in progress, but once the installation begins, don't do so.

  • this help .. i have one more question please .. for example now when write sudo for anything .. linux will ask you for password .. if I see the option to input the password for admin .. is there something in the keybored to click to exit or close instead if i changed my mind to not input a password? .. also my second question Can I stop an installation while it's running in the terminal by clicking something in the keybored ? – boudi Sep 13 '14 at 3:08
  • @boudi I have updated the answer. – muru Sep 13 '14 at 3:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.