Linux command package version

Command to check version [duplicate]

I am new to this platform so can some one help me out for some commands. I need some commands on patching a server for only specific packages. After upgrading packages how to figure out package updated to latest version or not ??

3 Answers 3

There are a lot of different solutions/workarounds I’m going to mention some:

1. Find installed version

1.1. dpkg

Use dpkg -l pkg-name to get package version, e.g:

it’s going to give you some information:

||/ Name Version Architecture Description +++-========================================================================== ii firefox 53.0.3+build1-0ubuntu0. amd64 Safe and easy web brow 

1.2. pkg —version

Depends on your package switches like -v or —version might be available to you:

2. Last available version

2.1. apt show

Then use sudo apt update to make sure your sources are up to date, and use apt show firefox | grep -i version to see the last version available.

2.2. Ubuntu packages database

You can also check https://packages.ubuntu.com to search for your package version.

2.3. apt changelog

As an alternative you can use apt changelog pkg-name , e.g apt changelog firefox this will connect to internet to get the last «change log» data so you don’t have to update your sources for using this command.

2.4. rmadison

The other option is rmadison , it remotely query the archive database about a packages, so you don’t have to update your source in this option.

First install its package: sudo apt install devscripts , then use it like:

 rmadison -s zesty -a amd64 wget 

it give you last available version of wget for «zesty» and «amd64» architecture.

Читайте также:  Linux reload limits conf

Check if upgrades are available for a particular package

It is possible to use apt-cache like this,

$ apt-cache policy # generic $ apt-cache policy firefox # example with output firefox: Installed: 53.0.3+build1-0ubuntu0.16.04.2 Candidate: 53.0.3+build1-0ubuntu0.16.04.2 Version table: *** 53.0.3+build1-0ubuntu0.16.04.2 500 500 http://se.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages 500 http://security.ubuntu.com/ubuntu xenial-security/main i386 Packages 100 /var/lib/dpkg/status 45.0.2+build1-0ubuntu1 500 500 http://se.archive.ubuntu.com/ubuntu xenial/main i386 Packages 

Update source list

Update listing the sources

Upgrade a package

Upgrade a particular package (and whatever is needed to support the new version)

Upgrade all installed packages

Upgrade the installed packages, which have upgrades available

Man pages

Источник

How can I find the version number of an installed package via dpkg?

Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Description +++-=========================-=========================-================================================================== ii network-manager 0.8.3~git.20101118t223039 network management framework daemon 

As you can see, it returns 0.8.3~git.20101118t223039 which is wrong because it truncates the version (I’ve picked a long one for the purpose of this question). The way I’ve solved this in the past is to pass a stupidly long COLUMNS argument to make it expand:

COLUMNS=200 dpkg -l network-manager 
Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Description +++-============================================-============================================-======================================================================================================== ii network-manager 0.8.3~git.20101118t223039.d60a988-0ubuntu1 network management framework daemon 

Now I can see the full version number, which is 0.8.3~git.20101118t223039.d60a988-0ubuntu1 . I get the feeling that this is not the proper way to find the version number of an installed package. This never really was a problem in the past, but with the tacking on of «ubuntu» in the versions and the proliferation of PPAs these strings are getting longer and longer. Is there an easier way?

Источник

How can I check the available version of a package in the repositories?

How can I check the version of the available package in the Ubuntu repositories without installing it?

7 Answers 7

This gives you information of all available package versions.

alaa@aa-lu:~$ apt-cache policy vlc vlc: Installed: 2.0.8-0ubuntu0.13.04.1 Candidate: 2.0.8-0ubuntu0.13.04.1 Version table: *** 2.0.8-0ubuntu0.13.04.1 0 500 http://ae.archive.ubuntu.com/ubuntu/ raring-updates/universe i386 Packages 500 http://security.ubuntu.com/ubuntu/ raring-security/universe i386 Packages 100 /var/lib/dpkg/status 2.0.6-1 0 500 http://ae.archive.ubuntu.com/ubuntu/ raring/universe i386 Packages
  • From the output, you can see that there are two versions available: 2.0.8-0ubuntu0.13.04.1 and 2.0.6-1 . It also tells you which repositories they are coming from.
  • Installed: tells you the version you have installed. If you don’t have the package installed, you’ll see (none) .
  • Candidate: is the version that will be installed if you use apt-get install vlc . If you want to install the other version, you would do apt-get install vlc=2.0.6-1 .
Читайте также:  Как сделать оболочку linux

Go to packages.ubuntu.com, fill in the search form and get a nice view of the package including the version.

enter image description here

enter image description here

Additional benefits

  • Will also list versions of packages for other versions of Ubuntu. Eg. if you want to know about the version of the package in Raring (13.04), but your system still has Precise (12.04), then this will provide a way to find it out.
  • You don’t even need Ubuntu to be installed.

Biggest downside is that it won’t list the versions of other repositories you possible have installed, such as PPAs. You will then need the apt-cache policy approach as already posted.

Pro tip

Take the shortcut — just browse to http://packages.ubuntu.com/packagename and replace packagename with the name of the package you want to query.

It also gives information about all available package versions in the repositories. This command output had the syntax like this:

packageName | Version | Repository 

apt-cache’s madison command attempts to mimic the output format and a subset of the functionality of the Debian archive management tool, madison. It displays available versions of a package in a tabular format. Unlike the original madison, it can only display information for the architecture for which APT has retrieved package lists (APT::Architecture).

$ apt-cache madison chromium-browser chromium-browser | 32.0.1700.102-0ubuntu0.13.10.1~20140128.970.1 | http://mirror.sov.uk.goscomb.net/ubuntu/ saucy-updates/universe amd64 Packages chromium-browser | 32.0.1700.102-0ubuntu0.13.10.1~20140128.970.1 | http://mirror.sov.uk.goscomb.net/ubuntu/ saucy-security/universe amd64 Packages chromium-browser | 29.0.1547.65-0ubuntu2 | http://mirror.sov.uk.goscomb.net/ubuntu/ saucy/universe amd64 Packages chromium-browser | 29.0.1547.65-0ubuntu2 | http://archive.ubuntu.com/ubuntu/ saucy/universe amd64 Packages chromium-browser | 29.0.1547.65-0ubuntu2 | http://mirror.sov.uk.goscomb.net/ubuntu/ saucy/universe Sources chromium-browser | 32.0.1700.102-0ubuntu0.13.10.1~20140128.970.1 | http://mirror.sov.uk.goscomb.net/ubuntu/ saucy-updates/universe Sources chromium-browser | 32.0.1700.102-0ubuntu0.13.10.1~20140128.970.1 | http://mirror.sov.uk.goscomb.net/ubuntu/ saucy-security/universe Sources chromium-browser | 29.0.1547.65-0ubuntu2 | http://archive.ubuntu.com/ubuntu/ saucy/universe Sources chromium-browser | 29.0.1547.65-0ubuntu2 | http://archive.ubuntu.com/ubuntu/ saucy/universe Sources 

Источник

How can I check the version before installing a package using ‘apt-get’?

I’m thinking to install hylafax+ version 5.5.4 which was released last month on my Debian PC. I checked dpkg -l | grep «hylafax» and found out that the current version is 5.5.3. Then I checked apt-cache search hylafax and saw the packages are available, but I can’t see any version number. How can I find the version of packages available in the apt-get ?

Читайте также:  What is unix linux and solaris

11 Answers 11

apt-cache policy will show the version details.

It also shows which version is currently installed and which versions are available to install.

For example, apt-cache policy hylafax+

Can’t believe this isn’t shown in apt install , to give you a chance to review the versions before saying Y .

If we use apt install some packages (may not installed) get install straightaway. So I think for new Linux user its better to use apt policy .

$ apt-cache policy redis-server redis-server: Installed: (none) Candidate: 2:2.8.4-2 Version table: 2:2.8.4-2 0 500 http://us.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages 
$ apt-get install -s redis-server NOTE: This is only a simulation! apt-get needs root privileges for real execution. Keep also in mind that locking is deactivated, so don't depend on the relevance to the real current situation! Reading package lists. Done Building dependency tree Reading state information. Done The following extra packages will be installed: libjemalloc1 redis-tools The following NEW packages will be installed: libjemalloc1 redis-server redis-tools 0 upgraded, 3 newly installed, 0 to remove and 3 not upgraded. Inst libjemalloc1 (3.5.1-2 Ubuntu:14.04/trusty [amd64]) Inst redis-tools (2:2.8.4-2 Ubuntu:14.04/trusty [amd64]) Inst redis-server (2:2.8.4-2 Ubuntu:14.04/trusty [amd64]) Conf libjemalloc1 (3.5.1-2 Ubuntu:14.04/trusty [amd64]) Conf redis-tools (2:2.8.4-2 Ubuntu:14.04/trusty [amd64]) Conf redis-server (2:2.8.4-2 Ubuntu:14.04/trusty [amd64]) 
$ apt-cache show redis-server Package: redis-server Priority: optional Section: universe/misc Installed-Size: 744 Maintainer: Ubuntu Developers Original-Maintainer: Chris Lamb Architecture: amd64 Source: redis Version: 2:2.8.4-2 Depends: libc6 (>= 2.14), libjemalloc1 (>= 2.1.1), redis-tools (= 2:2.8.4-2), adduser Filename: pool/universe/r/redis/redis-server_2.8.4-2_amd64.deb Size: 267446 MD5sum: 066f3ce93331b876b691df69d11b7e36 SHA1: f7ffbf228cc10aa6ff23ecc16f8c744928d7782e SHA256: 2d273574f134dc0d8d10d41b5eab54114dfcf8b716bad4e6d04ad8452fe1627d Description-en: Persistent key-value database with network interface Redis is a key-value database in a similar vein to memcache but the dataset is non-volatile. Redis additionally provides native support for atomically manipulating and querying data structures such as lists and sets. . The dataset is stored entirely in memory and periodically flushed to disk. Description-md5: 9160ed1405585ab844f8750a9305d33f Homepage: http://redis.io/ Bugs: https://bugs.launchpad.net/ubuntu/+filebug Origin: Ubunt 
$ dpkg -l nginx Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-========================================-=========================-=========================-===================================================================================== ii nginx 1.6.2-1~trusty amd64 high performance web server 

Источник

Оцените статью
Adblock
detector