I wanted to maintain a list of packages in my dotfiles repo so that every time I re-installed the OS I would be able to quickly install the basics. Brew on OSX has the Brewfile so I figured something similar would be nice.
An example package list file
htop tree vim vim-gtk #some-disabled-package git-core curl
Here is the command install all the packages listed in the file excluding only commented lines. Please note this solution does not allow for comments on the same line as a package.
grep -vE '^#' ~/.my-apt-packages | xargs sudo apt install -y
Related External Links: