Legally you can do that only for advertisements of UCB. If the advertisements are for any other entity they cannot be removed.The UCB advertising clause has been rescinded by the copyright owner. See this authorization. ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change The advertising clause is no longer required and is deleted. With all of the usual cautions about IANAL I believe it is enough to delete that clause from the copyright and reference that document.