this guy says enscript worked 'like a charm': http://www.dry-lab.org/blog/2018/numbering-pages-of-a-pdf but it wiped my pdf - producing page numbers on blank pages
id rather use something like pdfsam: https://userguide.pdfsam.org/Public/Default.aspx? "With the Page Number function, you can insert page numbers in the document" - but that is for pdfsam 'enhanced' and only 'basic' and 'visual versions are available for linux
when i search the web for a solution most answers relate to 'adding pages to pdf' and not 'adding page numbers', thus i can't find good info. The Q was asked mostly 10 years ago it seems, implying that it has recently become straightforward?