Use APT To Install A List Of Packages From A File

Posted by Weston Ganger

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:

Article Topic:Software Development - Linux

Date:July 27, 2020

Recommended Posts

Contact

604-309-8713
info@solidfoundationwebdev.com

Send Me A Message

I would love to get in touch and talk about your next project. Feel free to send a message and I will get back to you shortly.

Get Connected