简体   繁体   中英

How can I get version information of a package which will be installed using apt on debian-based linux

I have a vim on my debian system. I want to update vim by apt-get install vim . But I'm not sure about the version which will be installed. If it is not the version I want, I will install by sources. How can I know what version will be installed? aptitude search or apt-cache search only gives me a short description, not the version. And aptitude show or apt-get show gives version information of installed packages. Thanks in advance.

aptitude show or apt-cache show shows available versions in addition to installed versions. Unless you're doing something weird with pins, the highest available version is the one that will be installed.

Since you mention aptitude , you can also open up the aptitude TUI and navigate to the package in question. In the overview view, the second-to-last column shows the currently-installed version of the package, and the last column shows the version that will be installed if you use + to mark the package for installation. If you press Enter on the package, the detail page will show all available versions, at the bottom.

To get the package version of a package that isn't currently installed on your system, you can use:

apt

apt-cache policy vim
apt policy vim

or

apt-cache madison vim

or

apt list vim

aptitude

aptitude versions vim

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM