Mailing List Archive

Problem installing ClamAV 104.1 on CentOS 7
I followed the instructions to install the prerequisites and then went through the
steps for the default build.  Everything went fine until I got to the last step.

$ sudo cmake --build . --target install
sudo: cmake: command not found

The instructions have me install cmake under my user directory (python3 -m pip
install --user cmake pytest).  That works fine for the build and testing steps,
however, it becomes a problem when I try to do the install under sudo.

Do I need to re-install cmake system-wide, or is there a way I can specify to use the
local version when running sudo?

Could I log in as root, add the /home/username/.local/bin directory to the path, and
then do the install?  If so, do I need to add the /home/username/.local/lib directory
to a lib variable?

I could just experiment with the settings, but that's a bit dangerous when running an
install as root.

--
Bowie

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Re: Problem installing ClamAV 104.1 on CentOS 7 [ In reply to ]
Hi there,

On Mon, 6 Dec 2021, Bowie Bailey via clamav-users wrote:

> ...
> $ sudo cmake --build . --target install
> sudo: cmake: command not found
> ...
> Do I need to re-install cmake system-wide ...

That's what I did.

> Could I log in as root, add the /home/username/.local/bin directory to the
> path, and then do the install? If so, do I need to add the
> /home/username/.local/lib directory to a lib variable?

I tried a few things like that but it was taking up too much time.

--

73,
Ged.

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Re: Problem installing ClamAV 104.1 on CentOS 7 [ In reply to ]
On Mon, 6 Dec 2021 16:41:51 -0500
Bowie Bailey via clamav-users <clamav-users@lists.clamav.net> wrote:

> I followed the instructions to install the prerequisites and then went through the
> steps for the default build.  Everything went fine until I got to the last step.
>
> $ sudo cmake --build . --target install
> sudo: cmake: command not found
>
> The instructions have me install cmake under my user directory (python3 -m pip
> install --user cmake pytest).  That works fine for the build and testing steps,
> however, it becomes a problem when I try to do the install under sudo.
>
> Do I need to re-install cmake system-wide, or is there a way I can specify to use the
> local version when running sudo?
>
> Could I log in as root, add the /home/username/.local/bin directory to the path, and
> then do the install?  If so, do I need to add the /home/username/.local/lib directory
> to a lib variable?
>
> I could just experiment with the settings, but that's a bit dangerous when running an
> install as root.
>

-------------------------------------

I also don't like running "install" as root.

I have always built ClamAV from source and installed it under
"/opt/clamav-VERSION". This was originally because I didn't want to
wipe out a previous working version until I tested the new version.

But it turns out to have another advantage as well: I can do *all* the
"make" stuff, including the "make install", as non-root. Then, at the
last minute, I do a "chmod -R 0.0" of the new installation, followed by
a "chmod -R clamuid.clamgid" of the "share/clamav/" subdirectory,
followed by setting a symbolic link of "/opt/clamav" to the new
version's subdirectory under "/opt".

Of course this also requires creating the new "/opt/clamav-VERSION"
directory with the proper permissions, changing some of the "make"
options to non-standard values, and now, changing an option or two to
put the systemd stuff into a different place to avoid tying ClamAV to
systemd. (I continue to use cron to trigger updates.)

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Re: Problem installing ClamAV 104.1 on CentOS 7 [ In reply to ]
On 12/6/2021 10:04 PM, Paul Kosinski wrote:
> On Mon, 6 Dec 2021 16:41:51 -0500
> Bowie Bailey via clamav-users <clamav-users@lists.clamav.net> wrote:
>
>> I followed the instructions to install the prerequisites and then went through the
>> steps for the default build.  Everything went fine until I got to the last step.
>>
>> $ sudo cmake --build . --target install
>> sudo: cmake: command not found
>>
>> The instructions have me install cmake under my user directory (python3 -m pip
>> install --user cmake pytest).  That works fine for the build and testing steps,
>> however, it becomes a problem when I try to do the install under sudo.
>>
>> Do I need to re-install cmake system-wide, or is there a way I can specify to use the
>> local version when running sudo?
>>
>> Could I log in as root, add the /home/username/.local/bin directory to the path, and
>> then do the install?  If so, do I need to add the /home/username/.local/lib directory
>> to a lib variable?
>>
>> I could just experiment with the settings, but that's a bit dangerous when running an
>> install as root.
>>
> -------------------------------------
>
> I also don't like running "install" as root.
>
> I have always built ClamAV from source and installed it under
> "/opt/clamav-VERSION". This was originally because I didn't want to
> wipe out a previous working version until I tested the new version.
>
> But it turns out to have another advantage as well: I can do *all* the
> "make" stuff, including the "make install", as non-root. Then, at the
> last minute, I do a "chmod -R 0.0" of the new installation, followed by
> a "chmod -R clamuid.clamgid" of the "share/clamav/" subdirectory,
> followed by setting a symbolic link of "/opt/clamav" to the new
> version's subdirectory under "/opt".
>
> Of course this also requires creating the new "/opt/clamav-VERSION"
> directory with the proper permissions, changing some of the "make"
> options to non-standard values, and now, changing an option or two to
> put the systemd stuff into a different place to avoid tying ClamAV to
> systemd. (I continue to use cron to trigger updates.)

Not a bad idea.  I may give that a try.

--
Bowie

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Re: Problem installing ClamAV 104.1 on CentOS 7 [ In reply to ]
On Mon, 6 Dec 2021, Bowie Bailey via clamav-users wrote:

> I followed the instructions to install the prerequisites and then went
> through the steps for the default build.  Everything went fine until I got to
> the last step.
>
> $ sudo cmake --build . --target install
> sudo: cmake: command not found
>
> The instructions have me install cmake under my user directory (python3 -m
> pip install --user cmake pytest).  That works fine for the build and testing
> steps, however, it becomes a problem when I try to do the install under sudo.
>
> Do I need to re-install cmake system-wide, or is there a way I can specify to
> use the local version when running sudo?
>
> Could I log in as root, add the /home/username/.local/bin directory to the
> path, and then do the install?  If so, do I need to add the
> /home/username/.local/lib directory to a lib variable?
>
> I could just experiment with the settings, but that's a bit dangerous when
> running an install as root.

I try to use packages for everything - a legacy of maintaning machines
for a whole department. That way I can trust the package management
system to know how to uninstall ...

Is the cmake from epel for CentOS7 recent enough to build clamav ?

If not, you could build a clamav rpm.
Perhaps start with the epel clamav.spec file, or maybe clamav has one since
they now ship Red Hat and Fedora binaries.
That way the cmake "install" happens inside rpmbuild, under your id
so root is only needed for the yum/dnf install.

--
Andrew C. Aitchison Kendal, UK
andrew@aitchison.me.uk

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml