||/ Name Version Architecture Description |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend $ dpkg -l lyxĭesired=Unknown/Install/Remove/Purge/Hold To show which is installed, you can use dpkg -l. They are not all versions of the one package. The problem is that the different versions of the kernel ( linux-image) are in individual packages, and named independently according to the version. $ apt-cache search linux-image | grep '^linux-image' If you want to see all the versions of linux-image-like packages, you can just do a search, e.g. $ apt-cache showpkg lyxĢ.1.0-1~trusty~ppa4 (/var/lib/apt/lists/_lyx-devel_release_ubuntu_dists_trusty_main_binary-amd64_Packages) (/var/lib/dpkg/status)įile: /var/lib/apt/lists/_lyx-devel_release_ubuntu_dists_trusty_main_binary-amd64_PackagesĢ.0.6-1build1 (/var/lib/apt/lists/_pub_ubuntu_dists_trusty_universe_binary-amd64_Packages) N: Can't select versions from package 'linux-image' as it is purely virtualĪpt-cache showpkg should work for real packages, though. You have the correct command, except linux-image isn't a real package name. This would help me simply do a downgrade or upgrade to a specific version. Loaded plugins: langpacks, refresh-packagekit Linux-image-3.13.0-24-generic 3.13.0-24.46Įxpecting similar output: $ yum list kernel-headers -showduplicates The above command lists various versions of the kernel-headers rpm available on F20/RHEL or installations.Ĭloset I can get using apt-cache showpkg, not sure if there is a better way ? $ apt-cache showpkg linux-image The below code shows a simple use of the sys.version to check the version.Is there a equivalent of this command yum list kernel-headers -showduplicates on Ubuntu with apt-get, apt-cache etc. The second one uses the sys.version_info, which contains a tuple containing some python version info. The first uses the sys.version string, which contains some details like the python version, compiler version, etc. To get the version number using the sys library, we have two methods. These libraries are present in the python standard library, so we have no installation problem for these libraries. In this tutorial, we were using the sys and platform library. We have many modules that can help us to get the version of python. If f-string is supported, then continue with the code else, run some other code block. We can improve the program by checking the python version used programmatically and using the if/else condition to check whether f-strings are supported by the version. F-strings have been included in python in the 3.6 release, and so the code will work only on python version 3.6 or later. For example, assume you have written a python code that used f-strings for formatting strings. This technique has a benefit if our python program can be run only in a specified version. We can also use a python script to check which python version is used to run the script. If we write software using Python2, it will have some problems while running using the python3 interpreter.Ĭhecking python version in command line using –version parameter Using Python Script Still, the major releases were not compatible with each other. The python micro and minor releases are somewhat compatible, and a new version can run the same code without much problem. MICRO: The python micro releases contains many bug fixes and improvements.For example, python 3.7.x, python 3.8.x, etc.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |