-1

I just got a VM running on CentOS 6.5 and ls -l /etc/*release returns a number of files like /etc/centos-release, /etc/lsb-release, and /etc/redhat-release.

The last one, /etc/redhat-release, is a symlink to the centos-release file.

Is it safe to remove /etc/redhat-release? Or could it cause issues later?

4
1

It is possible that some third-party software could check for the existence/contents of that file and do something variable based on the result. So, for example, if something is designed to run only on RHEL and not CentOS, checking that file would be a simple (and FWIW, easy to bypass) way to enforce that.

I would be surprised if there is a good reason for removing these files.

3
  • Is this a standard way to check for OS level though? Wouldn't it make more sense to look at lsb_release -d for instance? Apr 3 '14 at 16:38
  • I don't appear to have lsb_release installed on my CentOS 6.4 box. Looks like there are some redhat-lsb-* packages that I don't have installed. This must have been a really lean install (and not likely fully lsb-compliant!). The existence of that file makes a quick test in shell scripts possible: [ -e /etc/redhat-release ] && echo redhat Apr 3 '14 at 16:44
  • Also consider that it's possible that lsb_release may even reference that file for some reason. Apr 3 '14 at 17:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.