I need to add specific packages (ksh) to a windows machine running wsl2. How do I install the software with dependencies (such as ksh)?
Thanks,
Joseph
I need to add specific packages (ksh) to a windows machine running wsl2. How do I install the software with dependencies (such as ksh)?
Thanks,
Joseph
Hi there!
I think the easiest way is to download the package directly from a mirror or the CDN and then look which dependencies are missing. (you can also use pkgs.org to find the packages you need an directly download it there)
I mean like:
ksh
package/c/
)dnf install <path-to-rpm-file>
dnf config-manager --disable <repo>
or directly setting the enabled
to 0 in the repo files)dnf install <path-to-ksh> <path-to-package-2> <path-to-package-n>
and then just retry until no dependency missing messages are there anymore and it lets you install
Cheers, Lukas
Lukas,
Thanks for the response. dnf is still trying to reach the package server and of course getting an error because the machine is not connected to the internet. Any ideas on forcing dnf to look in the local directory?
Joseph
As said you can just disable all the repos it canât reach, it wonât even be annoyed if you donât have any repos enabled anymore.
But if you need to, you can also point the baseurl
to a filepath, like itâs done for the gpg keys (file://
), that would make you clone a whole mirror though.
So disabling all repos and directly giving it the packages it wants is the easier method.
Hello @joeslide
i have no knowledge with wsl but if it possible to run rpm command there then you can
rpm -i <path-to-the-rpm-file>
the command will require sudo permission so if it was on linux you will run it as
sudo rpm -i <path-to-the-rpm-file>
hope that help and have a nice day
You are correct. I have not set up our repo collection server for our systems (we run an air gapped network), but if it is like RHEL8, you have to download the entire repository AND the repodata. In 7 you could use createrepo to generate even a fractional repo, but no longer. It is a royal PITA if you miss anything, as the repo will not work.
I believe that he is having issues with the dependencies not being installed. I have used rpm to install individual files, however I am not familiar enough to know if there is a switch to determine dependencies. Even if there was, some of the dependencies have dependencies, so it can get pretty involved real quick.
I really appreciate the help. Setting âenabled =0â in all the repos did the trick.
Whatâs involved in syncing the repos?
Thanks again for your help!
I do use crude ârsyncâ from nearest official mirror with no observable pain:
for R in BaseOS AppStream CRB extras
do
${RSYNC} ${SOURCE}/${R}/x86_64/os/ ${DEST}/${R}/x86_64/os/
done
Apparently the dnf would have functionality to do some âsmartâ mirroring, but what I use has worked since CentOS 5 (or was it 4?) âŚ
I do build some packages myself and those are in separate âlocalâ repo, for which âcreaterepo_câ generates metadata ok â no âmodulesâ in that repo though.
Well as jlehtone already says you can go the very bare route of just syncing with rsync
(or dnf
) and then either serving it locally as directory to the wsl, or more sophisticated on another server, either via NFS, SMB, (insert other file protocols) or just plain HTTP via a webserver.
If you want fully managed repos I recommend to use either Pulp directly or layered into Foreman or even clients, when fully managing clients.
rpm -i
will report missing dependency even without internet but will not be recursive so he can install all of them with same command with space between each package
and rpm --query --requires <package-file>
will return the required packages
and have a nice day everyone
\begin{pedantic}
rpm --query --requires -p path_to_ksh-*.rpm
rpm --query --requires ksh # when ksh is installed
# and on system that has access to repos:
dnf repoquery --requires ksh
dnf repoquery --requires --resolve ksh | grep -v ".i686$"
thanks @jlehtone for the extra info and have a nice day
sorry to be late in getting back to you. Basically, since our is air-gapped, I have a cron job do a reposync at the first of the month, then copy the repodata directory for each repo, as well as the Packages directory, making sure only to get the files that are new since the last download. In copying them over, I simply choose to overwrite in case I copied something from the previous month, Simple, but effective. Just a hassle if you miss anything in the new files, as the repo will just not work because it is not in line with the repodata databases.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.