Command not found when using a package installed with apt-get - bash

I'm used to apt-get however today I'm stuck by something really easy. I'm on a Debian 8 VM and need to use gethostip. As it's part of syslinux here is what I've done:
$ sudo apt-get install syslinux
$ gethostip -d localhost
However it returns me bash: gethostip: command not found. I also tried which gethostip to find the package and it returns nothing.
What should I do in order to make it works?

gethostip is not part of the syslinux binary package.
Debian chose to split syslinux (the source package) into multiple binary (== installable) packages, to allow people/dependencies to just install the components they need. E.g. if you don't want to create bootable CDs, chances are high that you won't need the isolinux package.
The package that contains /usr/bin/gethostip is called syslinux-utils.
You can use the search on packages.debian.org to find out, which package installs a given file.
Alternatively you could install the command-not-found package, that will suggest to you which package to install when you typed a yet-unknown command on the cmdline.

Related

How to install a newer version of Ruby than what is present in the package manager?

I'm using "yum" which has a very old version of Ruby. I'm on linux OS and quite new to it. How can I install a specific version of Ruby that isn't present in the package installer?
Note: I don't have the other package managers (rbenv / rmv etc).
Note2: I am connected to this Linux machine via putty. So I only have command-line access.
Without package managers and using yum, your last option is to build from source.
Building from Source
Of course, you can install Ruby from source.
Download and unpack a tarball (EG: Ruby 3.0.2), then just do this:
$ ./configure
$ make
$ sudo make install
By default, this will install
Ruby into /usr/local. To change, pass the --prefix=DIR option to the
./configure script.
REF: https://www.ruby-lang.org/en/documentation/installation/#building-from-source

Packages apt-get vs brew?

Im trying to get something running in a lab, and I need to install a whole bunch of packages to compile the code:
sudo apt-get install build-essential libgtk2.0-dev libwxgtk3.0-dev libwx-perl libmodule-build-perl git cpanminus libextutils-cppguess-perl libboost-all-dev libxmu-dev liblocal-lib-perl wx-common libopengl-perl libwx-glcanvas-perl libtbb-dev libxmu-dev freeglut3-dev libwxgtk-media3.0-dev libboost-thread-dev libboost-system-dev libboost-filesystem-dev libcurl4-openssl-dev libextutils-makemaker-cpanfile-perl
The problem is, I'm working on a Mac; So I only have brew available - and the package names are not equivalent.
Am I trying to do something dumb and impossible, or is there a way to cross reference those apt-get packages to ones available in brew and install those so I can build the app?
For added context, its a modified "slicer" application for generating files that a 3d printer uses to make parts. I could fire up an ubuntu VM and use apt-get, but I'm on an M1 mac at the moment and recompiling experimental QEMU code just so I can fire up an ubuntu VM takes me way more out of my depth than I already am... I'm running brew on a duplicated, rosetta emulation forced terminal.
There is no straightforward way to automatically figure out whether a corresponding Homebrew package exists for each of these packages, no. But you can probably guess the majority, and manually figure out the rest. Each Debian package has a link to the upstream sources, and a home page if one exists, from which you can often find links to packages for other architectures, etc.
From the Debian package search page you can search e.g. for the libxmu-dev package, and discover the corresponding package page for Buster (the current stable Debian release), which in turn has links to the upstream repo, etc. But this is an X11 package, so it's not straightforwardly compatible with macOS, which uses an entirely different GUI architecture.

Output a custom message during a dpkg package installation

I am trying to install create a simple .deb dpkg package.
I have seen multiple packages where, during installation, they output custom messages like Reboot after installation! or Clearing caches or (in the case of iOS) Thanks to [developer]!.
I can't seem to find any way to replicate this myself during installation of my package.
How do I output a custom message to the terminal while dpkg is installing my package?
You can do this by providing a postinst script to the package.
See section 7.6 What is a Debian preinst, postinst, prerm, and postrm script?

How to install an external package to /usr/local without troubling Homebrew?

I'm trying to install a package called Geant4 by compiling from source (HomeBrew actually has the package but it's an old version and doesn't have support for Python which I need).
I want to put the Geant4 package in /usr/local/geant4 (perhaps this is not the proper place to put it in OSX?).
Now, the Homebrew FAQ has some instructions on how to install external stuff, but when I do brew diy, I get the error message:
Error: Couldn't determine build system
The command I should use to configure Geant4 is:
cd ~/my-build-directory
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/geant4 ~/Downloads/geant4.10.01.p01
brew diy makes a good effort to determine how to build a package, but it doesn't always get it right. In the case of custom packages, it's probably best to install them into $(brew --prefix)/Cellar/$package/$version, just as Homerew would -- that way, you can interact with the package using brew link, etc. You can also install it to /usr/local or anywhere you like, but mimicking Homebrew works really well.
In your case, you could probably install it with something like:
cd /my-build-directory
cmake -DCMAKE_INSTALL_PREFIX=$(brew --prefix)/Cellar/geant4/10.01.p01 ~/Downloads/geant4.10.01.p01
brew link geant4

apt-get not working in Cygwin

I'm something of a Cygwin newbie, so that might be the problem, but I'm trying to install a package using apt-get and it's telling me there's no such command. I installed it on Windows 7.
The best I got from searching other questions here and across the net was that you need to install something specific (or run the setup file to update) when initially installing, but it's not clear to me what I need to install or run or whatever.
How do I install or update my cygwin to be able to use apt-get or, alternatively, how would I install packages with the basic, default installation of Cygwin that I already have?
Thank you.
You can use this : apt-cyg
It works just like apt-get in terms of command line arguments, but you will be using apt-cyg instead.
Refer https://github.com/transcode-open/apt-cyg It did helped me.
To install apt-cyg package.
Cygwin's official installer is setup.exe. This is the "proper" way to install Cygwin packages. There's a project called cyg-apt but it's not officially part of Cygwin.

Resources