On Sun, Jul 05, 2026 at 20:14:40 +0200, Hans wrote:
> I need normal *.deb and *.udeb files and my list is rather long, so that I 
> would automate this. I tried
> 
> apt -d install < mylist.txt 
> 
> but this did not work.
> 
> My list is a asci textfile and its entries are looking so:
> 
> ---- snip ----
> 
> cdrom-detect
> cebconf-udeb
> di-utils
> libglib2.0-udeb

Because these are Debian package names, and we know these package names
conform strictly to a specific format (no internal whitespace, no quote
characters), we can use xargs(1) the way it was originally envisioned:

    xargs apt -d install < mylist.txt

This won't work with all inputs.  If you ever need to perform the same
kind of operation with inputs that are not so restricted, it gets a
little bit uglier:

    tr \\n \\0 < mylist.txt | xargs -0 apt -d install 

That converts the newline-delimited list to a NUL-delimited list, and
then uses xargs -0 to read the NUL-delimited list.

Reply via email to