Sample Header Ad - 728x90

How to get the Debian codename without lsb_release

23 votes
12 answers
32054 views
I am trying to create a script that requires me to print the Debian codename so that I may echo it into the sources.list file. I am trying to make this script work across any version of Debian, so I had hoped to set a bash variable of the release codename. This would be simple to do with lsb_release -c. However, our deployment images do not contain lsb_release by default - and with this script being required to fix the sources.list, installing lsb-release with apt-get would not be an option. I have found numerous ways to get the release number and other info about the system, but cannot find a reliable place to get the codename. (I am testing this with Debian Squeeze.)
Asked by Woody (231 rep)
Jan 24, 2015, 03:01 AM
Last activity: Nov 22, 2022, 04:17 PM