0

Background: I'm trying to figure out how to install WINE on an MX 19.3 system offline. I am having great difficulty. I seem to be incapable of building from source code (I never really like having to do this). I don't care about size, I like to keep my own offline repository, If I could I'd download all the dlls I could ever need, so I could install them offline as necessary. The closest method I've found is using the MX package installer, copying the /var/cache/apt/archives/ .debs to the offline system (I add the location of where I copy these debs to /etc/apt/sources.list.d/mysources.list on the offline PC and do sudo apt-get update) and the list of files generated by the MX installer, there are 145 of these this looks like this:

libaom0:i386 (1.0.0-3)
libasound2-plugins:i386 (1.1.8-1)
libasound2:i386 (1.1.8-1)
libasyncns0:i386 (0.8-6)
libatomic1:i386 (8.3.0-6)....

Now, using this list copied from the output of the MX package installer when I install them via the terminal of the offline PC one-by-one (e.g. sudo apt-get install libaom0:i386) they seem to install fine. However, when I try and install the whole lot at once it doesn't work. I think it also tries to go to the online repository for some reason. Pasting them into the terminal one-by-one is not really a practical solution. Three of the examples I've tried are as follows:

sudo apt-get install libaom0:i386 && \
libasound2-plugins:i386 && \ 
libasound2:i386 && \
libasyncns0:i386 && \
libatomic1:i386 .....


sudo apt-get install libaom0:i386 \
sudo apt-get install libasound2-plugins:i386 \ 
sudo apt-get install libasound2:i386 \
sudo apt-get install libasyncns0:i386 \
sudo apt-get install libatomic1:i386 .....


sudo apt-get install libaom0:i386 && \
sudo apt-get install libasound2-plugins:i386 && \ 
sudo apt-get install libasound2:i386 && \
sudo apt-get install libasyncns0:i386 && \
sudo apt-get install libatomic1:i386 .....

However, there are issues in all of the above. I'm not very good at BASH yet, is there a way where I can loop it so that each line is treated as a new paste into the terminal, or even better, a tweak to the above so I can just paste the whole lot into the terminal; because I have a feeling that if they were treated discretely so that each line is processed individually that they would all install. Really I just want to re-create what the MX package installer does.

Thanks in advance!

3
  • Is this what you are looking for? askubuntu.com/questions/835655/…
    – nobody
    Dec 23, 2020 at 14:43
  • Thanks for the fast reply nobody. I've tried apt-offline, I appreciate the efforts of the developer, but it's not for me. Thanks anyway
    – 1toneboy
    Dec 23, 2020 at 15:08
  • you mixed the && and backslashes in a wrong way. In your first try, remove the &&s and it will work.
    – Marco
    Dec 23, 2020 at 16:31

1 Answer 1

1
awk '{print $1}' file |
    while read -r package
    do
        sudo apt -y install "$package"
    done

A while loop to read from file and installing the package one by one without asking for confirmation ( apt with -y option).

or:

xargs sudo apt install -y < <(awk '{print $1}' file)
1
  • 1
    Thanks! I look forward to trying both of those little codes out.
    – 1toneboy
    Dec 26, 2020 at 11:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .