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.)
lsb_release
, check out it's source code and see if you're willing to reinvent all that