Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

It's easy to install a specific version of a package with apt-get:

apt-get install <package name>=<version>

For example:

apt-get install jenkins=1.517

But is there a shortcut for installing the latest version?

For example, say writing a script to automate Jenkins installation. After adding http:/q/pkg.jenkins-ci.org/debian to /etc/apt/sources.list, Jenkins is available from two sources. Now, I'd like to tell apt-get to install the latest version without knowing exactly what the latest version is at the time the script is executed.

Is this possible in any simple way?

share|improve this question
add comment

1 Answer 1

up vote 5 down vote accepted

just type

apt-get update    
apt-get install <package-name>

And the latest available in all your repositories will be installed.

share|improve this answer
2  
Don't forget apt-get update before apt-get install ... to update the package lists from repositories. –  Eric Carvalho Jun 3 '13 at 13:13
    
Thanks, kind of obvious... :) Earlier I've run into having an older version installed unintentionally, but maybe that was caused by forgetting to do apt-get update first. –  Jonik Jun 3 '13 at 14:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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