copypasta code from apt