How to build 7zip for a generic Linux distro

I have a project to build, and someone 7zipped the files. My Linux does not have 7zip on it. It can uncompress just about anything, but it will not properly uncompress 7zipped files even though it runs and it looks like it's doing it, and even leaves a bunch of files and directories.

I do not have any idea which link to click on to get the binaries for a generic Linux distribution of 7zip so I need to build it. But there are so many makefiles, I don't know which one to use for my OS/machine?

I clicked this link Download p7zip_16.02_src_all.tar.bz2 (4.2 MB)
from here: https://sourceforge.net/projects/p7zip/files/
I then unzipped it all and looked at the README:

BUILD :
-------

If you have downloaded the "bin" package,
use directly the program bin/7za. (tested on Debian 3, Ubuntu 14.10)
As the program is statically linked, its should run on many x86 or amd64 linux.

If you have downloaded the "source" package,

According to your OS, copy makefile.linux,
makefile.freebsd, makefile.cygwin, ...
over makefile.machine

Example : building 7za, 7z (with its plugins), 7zr and Client7z and passing the internal tests
cp makefile.linux_x86_asm_gcc_4 makefile.linux
make all_test

So am I supposed to copy a makefile over another makefile? What does makefile.machine have to do with it? Why did he cp that makefile over makefile.linux?

I have a Dell Optiplex 755 - it's an Intel firmware board, is there a makefile that will work for that machine? Why is it all so specific?

I guess I will just have to try the binaries link:
https://packages.debian.org/sid/p7zip-full

And pick one - the closest to my machine I guess.

Last edited on
I have an 2x Intel coreTM2 duo CPU E7300 - I suspect that this might not be 64 bits.
A Dell 0GM819 motherboard.
Last edited on
What Linux distro do you have ? You must already know. Also you should also know if your distro is 64 bit or not, the CPU certainly supports it.

The generic Linux binaries can be downloaded from p7zip website if you want:
https://sourceforge.net/projects/p7zip/files/p7zip/16.02/


Make sure to "mark" all executables with read and execute permissions, otherwise it wont run (this is not windows to just works)
Last edited on
Also, most Linux distros have some kind of package manager, prefer to use that to install software. They are usually good at finding dependencies, which is handy. They can also build source packages. The main reason for using a package manager is that it is a coherent system for dealing with software installation and updates. On my system (Fedora 25) updates happen daily, it checks the package database and various repositories to determine what needs updating, including the kernel. There is probably a GUI program that one can use to go looking for new software, and it uses package management in the background, so you may not have to do anything in the shell.

IIRC you have Ubuntu?
https://help.ubuntu.com/lts/serverguide/package-management.html
I too recommend using the package manager to install these kinds of programs. You just need the thing to work out of the box.

Not only is the manager smart enough to update the program regularly, it also can detect when a library is no longer in use and can remove it. The manager will prevent packages from clashing, and generally will save space because of dynamic linking to dependencies (which are all also kept up to date).

The package manager might not detect that a personally installed program uses one of it's packages, so if the library gets updated to a new version that defuncts the personally installed program then you are stuck trying to figure out how to remove and re-install something that you haven't worked with, used, or updated for months, possibly years. (That is of course a rare issue since most dependencies try to remain backwards compatible)


The downside to a package manager is due to the constant updates some packages offer. If you are on a pay-per-gig data service these constant updates might eat into your plan. (I'm currently going through about 2-3 Gb per month to keep my Fedora up to date, and had to turn off auto-updates)
Last edited on
Topic archived. No new replies allowed.