Building Programs from Source on any Linux Distribution
HTML-код
- Опубликовано: 15 июл 2024
- In this video, I am going over building programs from source on any Linux distribution.
Install the essentials
$ sudo apt-get install build-essential git
Next get the grab the project..
$ wget www.example.com/test.tar.gz
OR
$ git clone github.com/ChrisTitusTech/gno...
Extract Tar file - Skip if git clone used
$ tar -xzvf test.tar.gz
Resolve Dependencies
$ ./configure
**LOOK FOR ERRORS! install any missing packages before continuing.
Compile project
$ make
Install project
$ sudo make install
Notes:
-Program won't be updated
-To uninstall you much use $ sudo make uninstall from directory
**If directory is deleted, you will need to recompile before uninstalling .
►► Digital Downloads ➜ www.cttstore.com
►► Reddit ➜ / christitustech
►► Titus Tech Talk ➜ / titustechtalk
►► Twitch ➜ / christitustech Наука
This was good, but I think it would have been more helpful for many of us if you had chosen something old that *did* have dependency problems.
Chris, nice vid but I would have opted for a build with a few dependency issues so newbee's could see that and you could show them the steps instead of just telling them what to do
Absolutely agree with this. I think Chris did a great job, but I couldn't help thinking what does it look like when things go wrong. I'm still fairly intimidated
same feeling.. like teacher on the piano is one lesson ahead.. :) no offence.. thanks for vid
git isn't for github
github is for git :p
I think it goes both ways.
@@cipherxen2 well you can use git without github or with gitlab, bitbucket and what not so uh yeah
I know that. But to use github you have to use git. So in this video git is for github.
@@cipherxen2 well still no GitHub uses git and works with git, the git in GitHub stands for well git xD
And you can use GitHub via their web interface tis just........tedious
Saying git is for GitHub is limiting git to GitHub even tho it's not the other way however is true :p
@@fuseteam I know that sherlock. You are missing point, here git is used to access github. So it is said that, IN THIS VIDEO, "git is for github". It is not supposed to be the general statement.
Please do more of these compiles from source, because every software is a bit different than others when it comes to compiling or facing errors as you mentioned. Cool video!
Been many years ago but one of the funnest times I had was building PHP, MySQL, and Apache from source. Was running minimal Gentoo system and decided to not use the package manager for a learning experience. Days and days of compiling the dependencies too. Then getting all the builds right to make things work right together. Really taught me how things work though which is what I wanted to know.
Thanks for talking through what you're doing while you're doing it. Minor detail but it makes it a lot easier to comprehend vs just watching someone type something into a terminal
and people ask why i don't like using libraries for my code...
Hey Chris, i want to thank you for being the absolutely most USEFUL youtuber I've ever come across.... You've helped me through SO MANY Linux projects!
I’ve been looking forward to doing this and I’m glad you covered it. Love your videos btw, do your thing lol
That was the easiest build I have seen go through. Usually I get a least one error when trying to build from source and usually it's about a dependancy that I forgot to install. But that is a great video.
Than you, Chris. Good and important topic.
This channel is great Chris! Just did the balls to the walls jump from windows to Pop!_Os on ubuntu LTS 2 weeks ago. Youve helped out quite a bit with understanding the system! So far Linux is really great! :D
Fapen Nice! Make sure to learn some of the keyboard shortcuts for Gnome, makes Pop!_OS really fly!
Now this is the good stuff!
This is something I struggle with and avoid
Thankyou Chris
Hi today I was inspired to put linux mint on an external hard drive. I've only installed Mint on a virtual machine but that experience was very lacking. I'm enjoying linux mint a lot thank you for the inspiration to make this change.
You should ran the project as well. Some wouldn't know how. I think you went just a little to fast for a beginner's point of view. While your on the github webpage. I would at least point out the green button to clone the source codes from the website as well. Much easier for a beginner before jumping in a terminal.
Very useful, thank you so much!
Thank you, I needed this.
Next step for Chris: Gentoo, building the entire distro from source. :p
I know that one of your viewers is waiting for you to do it, Chris. He is eager to assist you.
Building from source can be handy in a pinch, but I try to avoid it if at all possible because for me one of the biggest benefits of Linux is the ability to update everything in one spot through the package manager. You don’t appreciate just how wonderful it is until you go back to an OS where you have to update all of the apps independently. Depending on the system, some even get firmware and bios updates through the package manager, which is incredible.
Can you do a video about repairing broken packages and dealing with unsolveable dependencies? Thanks.
Like before watching video👍
Thanks for this!
A suggestion is to play with Gentoo in a VM. It's hard at first, like Arch but once you installed it a couple of times it gets easier and in the process you'll learn lots about compiling including CFLAGS and such. It's rolling release too, so once your OS is and running you can just keep updating it. It even teaches you to compile a kernel manually, which teaches and tests your true Linux kernel and hardware knowledge :)
great video, thank you.
I prefer " checkinstall " over " make install " ! so i can remove the resulting package . Or install it upon multiple machines .
Yr vdos are great man !although a little slow but playbackspeed works!!
I never did any of my own compiling in Linux until I was working with YDL 6 (CentOS 6-based, I believe) on PS3 and was working on a gaming/computer emulation suite for it and had to customize some emulator builds to use the PS3 controllers. I haven't done much of that lately, but still try new releases of hatari (Atari ST/etc. emulator) and mednafen. It definitely gets harder the newer the source is and the older your distro is because it just gets difficult/impossible to find new compatible dependencies required by the source. I remember having to search all over for cmake that would work for the 2.0+ versions of hatari. It's especially hard now that also ppc/ppc64 isn't supported by 99.5% of distros, and even the ones that do tend to have a lot more limited repo contents compared to x86. Yes, I still keep an old PS3 that has older firmware that supports the 'OtherOS' option (before evil Sony killed it).
thanks for this video
I would like to see a tarball install. Most of the documentation isn't the best for a new linux user and seeing someone do it helps alot. I don't even know what github is, I thought it was a place for programmers.
I Love Compiling!
one thing a friend told me is that when you need a package and apt can't find it by that exact name, it has often just omitted the -dev at the end of the package name, so for example I needed libreadline for something, but the package name actually is libreadline-dev.
Are there only real-world performance advantages by building from source? Seems quite a bit tedious if you're only going to see a delta of a few % points.
Chris, this way looks like a little bit without thinking to me. I am wondering, what you are going to do when you want to reinstall this software. How do you know, where the SW installed files to? (for instance: is the installation making more than one folder?) What I like most about package managers they keep track of what you have installed and once you want to uninstall them it is pretty easy because you do not need to remember where it was installed. So it seems like you need to have a doc somewhere to keep track, but how do you know where the program installs itself? do you get kinda output after running make install? And to add something to my question: If the software I want to install depends on other packages/software and I installed it only for this purpose .. what it the best practice to also remove it when I want to install the SW I wanted to install in the first place? Do I run into serious problems if I installed a 2nd application that also relied on this package? I probably do not gonna notice if it is already installed it won't show an error, will it?
This is amazing. What theme on terminal you using anyways?
That's how I did it 20 years ago. Now I skip installing a package I built into my root filesystem and just run it in place in my home directory. I write a wrapper script and put it into ~/bin so the executable appears on my $PATH. There are exceptions, of course. But generally if I don't need to install a package globally on my system that I built myself then I don't. Especially a stand alone program I specifically won't install either. The way I do it now just keeps things neater.
Can you do a detailed text guide about this, please?
@@stolenbike2946 there's no one method that works in all circumstances. So you have to solve on a case by case basis. Things tend to be similar though. So a variation of what works in one instance tends to work in another. The method is to get the program to run in a shell then automate whatever commands you had to issue to accomplish that into a shell script. Just so you don't have to go through that every time you want to run the program.
thanks a lot it was a learning experience. How about building a 64 bit kernel for Raspberry Pi? I would love to learn how to do it...
When running cmake, "portaudio library not found" message was shown. I wonder if that compiled program actually runs as expected.
A couple questions 1 how do you check to see if a dependency is installed before doing the Make? Also, how do you uninstall a program installed in this manner? Will doing this in Debian or Ubuntu cause it to show up as installed in Synaptic?
How to convert deb, rpm, tarball, repository, etc. packages into AppImage so you can create your own portable apps, make it executable and run on any Linux distro?
I think if you backup apps/games as AppImages so when in future, when those apps/games become old enough to not able properly run on those future Linux distro's, AppImages will make it easy to run those old apps/games on future Linux distro's which no longer officially support those old apps/games due to dependencies no longer existing or other reasons.
Who cares? I only run one distro. All anyone ever needs to run is one Linux distro. If you know how to do things like build source code, etc.
Creating AppImages can be a little tricky. Are there any _good_ tutorials on RUclips? Let me know! I’ve stumbled through making an AppImage before. Annoying experience. Wish I knew more. I’m not much of a developer, but making an AppImage wasn’t as simple as I thought it could have been-although I still prefer AppImages to Flats and Snaps. Before any haters say anything, I always prefer traditional package management, but sometimes clients insist on something else.
@@1pcfred you run only one distro there are many people who use different distros, i myself use 3 distros archlinux on my desktop, voidlinux on my laptop and debian on my server
Have you looked into guix for building from source?
How can I compile a project for aarch64? Do I have to compile it directly on the hardware which is using aarch64 or can I do that on my x86 machine?
I always have dependency issues when building from source. I have never been able to get Neomutt on Debian Stsble to work. I just can’t do it.
How can I upgrade the package if installed from package manager, I currently have node v14 installed from the source but I need to upgrade it to v16
make j8 ? 8 threads or cores? I running 2x quad-core CPU total 16 threads
This is easily the most important video about Linux 🤌
Classic Linux user reaction, "Wow, I can't believe that actually worked that easily, usually you might have some errors" lmao
am I the only one that automatically sudo su when I open the terminal?
what's the harm in me doing that and why doesn't everyone do it? I haven't seen a single youtuber do this.
you don't need "SUDO make" if you specify a prefix in home directory while ./configure. This way you can have multiple versions without disturbing the system wide folders.
With the -j8 command, do you mean logical cores or physical cores?
If you have Hyper Threading, then logical - otherwise physical ;)
Logical
@HaloBaller9813 compiles using 8 cores, rather than the default 1 core..speeds things up significantly as you can imagine
if your into typing emojis you can try building ibus-uniemoji
This is the 3rd time I have watched this video
Cheeky subtitle: "Fun with (make) flags!"
Near any Linux Distribution*
I've found that some distros needs sometimes more fiddling around for exanple by installing dependencies than others, because repo misses some dependency, which is built from installed packages and you need to rebuilt that package in order to have that dependency etc...
Some packages break dependencies up. That can be a gotcha. That's what apt-file search is for.
The problem this video solved: x=2+2
Real world problem: x=Fibonacci (1000)
So what happens when there's package updates? Do you have to go through manually and update each one?
Well, yeah.
(The sound quality is a little weak/muffled, this time. Just sayin')
Video idea: How to make package from source (compile into *.deb file)?
I like it!
Interesting.... How are compiled apps updated? Compiling them again?
"Any Linux distribution"
Immediately installs build-essentials
How do I cleanly remove a program from PC that was compiled from source?
Sudo make uninstall ||| from what i remember
Hi
How to install essentials and git. on Clear Linux? 🤔
I need to install qgis 2.18.14, don't know how, can u explain it to me?
Ubuntu 20.04
Your accent when talking normally in the beginning is much more preferable for me. When you're explaining while showing the screen, i have a hard time keeping myself engaged, it's as if you were not interested in the topic.
I said this because i care and i'm interested in your topic, no hard feelings
Ok, and so, How long did you last till you *had* to see the program run?
*InDeeeed!*
Fact, new through to old hat...
10 ? "run ffs RUN"
20 Goto 10
It has to be *run*
So, may a day of "would you like toast" be upon & annoy you 😝
LoL. Thanks Chris Great vid,
the visualiser sounds fun.
Hope the project features as it evolves.
For Fedora 36 instead of installing build-essential i give you the command to do in the terminal = sudo dnf group install "C Development Tools and Libraries" "Development Tools"
I quit right after 2:43 when he said "...but definitely install those dependencies..." I gotta go and learn how to install dependencies first.
I like most of your videos, but I think this one is IMO missing an opportunities a lot. This is just revoicing what you would enter into console, but if somebody is really new to linux and overall he has vague idea about file systems and how computers work, I think they will not pick up as much from the video as they would need. Maybe it will work for them for some projects, but if not, they may be stuck.
I would expect you in video like this (or maybe in "part 2" :D, some "principal" overview what does this stuff even mean) to explain what does actual git clone or tar xvf does, what are source files, why building is needed, and what is the result of build (binaries + data + config files) and what install process does (and maybe showing the classic `PREFIX=~/.local make install` to install binaries only for current user, etc..).
Thanks for the video bro! I am facing an issue with Apache Mesos, when I execute the configure script it always says "libz is required for Mesos to build" seems libz is not found. I installed Python2 and python3 and all dependencies as explained in Apache Mesos documentation, but no way. This happens with the source cloned from github, which is a slightly different version, however the downloadable .tar.gz file from apache website, after installing python2.7-dev I don't receive the libz error, but when I run "make", I receive a different error: gettid() ... which belongs to the grpc package. So, it's not being so easy for me to install Mesos on Ubuntu VM. Any help or suggestions are welcome! God bless!
there is often a bla-dev package for compiling against bla etc.
Yes, yes yes! I have a complaint thought- I had been compiling the Linux Kernel since the 1990s. It makes a huge difference. Sometimes I need to add obscure drivers or I want a lower-latency Kernel. However, I could not do it on Manjaro! It was next to impossible. The Kernel maintainer for that distro was like "Why would you ever need to do this?" And refused to help me. Whatever. So I went back to Xubuntu. There's so many things you can compile and create faster binaries.
I use this for cmake:
cmake .. -DCMAKE_CXX_FLAGS="-O3 -march=native" -DCMAKE_C_FLAGS="-O3 -march=native" -DCMAKE_C_FLAGS="-O3 -march=native"
This works for make and finds the CPU count:
make -j$(nproc)
Yeah, that's the biggest advantage to compiling from source, the ability to optimize it for your rig. I think he dropped the ball by not even mentioning that.
@@johnterpack3940 exactly! There were some games that would not play on my gf's old PC but once I compiled the Kernel and the SDL2 graphic libraries it then ran fine.
@@Joelmonterrey yup, I've seen the difference between generic and optimized builds. That's one of the reasons I'm not really a fan of package managers.
@@johnterpack3940 Don't you need a lot of time available to work without package managers?
@@tachobrenner I'm not suggesting anyone work without them. I'm merely saying they aren't always the best option. For the vast majority of daily use, package managers are just fine. But when you need every bit of performance you can get, you need to compile from source. Compiling a web browser would probably be a waste of time, unless you needed to enable/disable some specific feature. But compiling a video editor could save you hours of time over the course of a year by speeding up encoding or other functions.
Cudos!
What does cmake do? I have never used it.
By the way, those -git AUR packages are fantastic, I can install them easier.
@Ouroboros Does it do the same thing like ./configure?
Cmake auto generates makefiles to build projects based on a hint database. It is the successor to the configure script method. Easier generally is less flexible. There's a double edge to convenience. With great power comes great responsibility.
What if a program has no build instructions, no cmake, no .configure script, and was discontinued years ago? Then what?
(the program I want to compile is Quake II 3.24, an unofficial patch to the vanilla Quake II engine.)
I think there would be a lot of work to get that "patch" to build. It seems to be missing a file, and I've tried dropping that file in from other (working) quake repos and it's just a lost cause (for the 10 minutes I'm willing to mess with it). Too much has changed.
If it did work you'd build it like this: make -f makefile
Thank's a lot, the AUR so many time doesn't work..thus I build couple program from source..
but building program tutorial in google is for Debian based, not much for Arch based command line.
quite confusing to check the dependencies...
On Arch it's usually much easier to build something from sources than on Debian-based distros
Dude, cmake works well with a CMakeLists.txt file in the repository, you cannot just randomly use it 🙂
Sometimes, you have to compile the dependency, before compiling the final program, LOL
Yes, when you compiling mesa-git from AUR - you also need to have Clang/LLVM kitchen. But you cant compile it because of some fails. Also compiling firefox/chromium is a pain, because it fails always. Every monstrous combine as MinGW fails.
Best choice for it - havin' binary repo with git packages, or installing binary builds from AUR/PPA
Everything else, such a Linux kernel, Wine, KWin - compiles fine.
====
Also, AUR/makepkg installing and making all dependencies automatically.
Video starts : Me rushing to 1.5x.
GCC installed and login loop caused by Nvidia drivers resolved on Ubuntu.20.04. and thankfully 20.10 got GCC (build-essential) included at installation, at least some GCC.
Having this GCC done ( by updating and installing "build-essential" )Changing fr Novou or Updating Nvidia drivers is easy.
You know.. next step Cuda toolkit download ( they say it got driver in package., So why installing GPU drivers before? ) And CUDA Toolkit==> CudaDNN deep neural network in charge of those hundreds ..or thousands CUDA cores (TU116 anyone?) doing parallel computation at your GPU :) Fianly computer used to compute !! ENIAC would support :)
pretty sure you don't need sudo to install in the user .local directory aka the .local directory in your home directory
unless you meant the /usr directory
Usr is generally used but milage varies by project
@@ChrisTitusTech yeah true :3 btw i believe usr doesn't stand for user but i'm being pedantic 😂
@@fuseteam /usr stands for Unix System Resources :-)
@@igorthelight like I said :p
@@igorthelight nope it stands for universal system resources cause unix is dead
When a tutorial of docker?
I know that containers are not for new users, but with kitematic... is way easier to try out than using command line.
BTW: building sources from debian based distro: wiki.debian.org/es/BuildingTutorial
sudo apt-get build-dep package
sudo apt-get source --download-only package
fakeroot debian/rules binary
You forgot dependency/clean/update/remove... hell and how to easily manage all that and whatever /missing_hell I forgot.
I hate repos on git that doesn't say what dependencies they need.. It's no fun to start restart the building process like 20 times just because you don't know what dependencies you need.
Me: *compiles everything from source on dual core Intel celeron n2840
Yeah, NetBSD can be painful at times...
Yeah things have gone wrong and now I dont know what to do.........like other ppl said ya need to show what happens when its not all smooth running.
you look so tanned in the thumbnail...lol
jaunie I thought the same lol
I color corrected it a bit too much lol
I haven't seen your cats recently. Are they OK?
Please let me use signal (available for arch on aarch64) on my raspberry pi 64bit OS
Or on fedora, which is on x86-64 but the Linux package for that is Debian based.
I am persistent but this one irritated me. I can kinda see how Windows has some value, if only they weren't spyware.
"So nice to download the source and compile it.." - LOL, especially with packages like firefox, thundebrid... really so nice to compile it xD...Still, this is an important video for Linux newbies. However, the problem begins with "it does not always look the same". When I realized that it's rarely by the book, I stopped paying attention to it and avoid it as heaven. I either use AUR to build or look for binary. Rest is just too much and too confusing and time demanding.
"dual core, really crappy PC"
Well thanks 🥲
If it's a Gentoo box you don't need to see this video because if you are using Gentoo you know to compile shit from source that is the whole point of Gentoo
If only there were some distro with some sort of automated system for building obscure software from source... *ehm* Arch Linux *ehm*
What's the real benefits from doing this other than that's the we've always done it.
You are going outside the distribution's packaging system, sometimes you want to have a specific version of a program, but you have an older/newer in the distro or even your distro does not have it in the repositories.
But thats not the way Windows does it.
How can businesses include Spyware, or NSA Backdoors,
if you get the source and can pull that crap out of the program before you build it?
It's true ONLY if you read whole source code.
Do you? :-)
I know - someone sometimes read it and may find something suspicious. That's still better than closed sources.
@@igorthelight Going thru the whole Source is no different than reading the whole 2.7mb EULA when installing software.
Its not like folks would ask banks for loans, then later say the bank is cheating them by doing exactly as contract said they would do
@@rwbimbie5854 Agree :-)
I've never been able to build any program from source. There is always some dependency that breaks everything.
Same here. Usually the terminal comes up with explenation that i don't understand or to look at the log file which is even harder.
@@danieleg8758 Come to us for help. The dependency has a name, you install it along with the -dev package to get pass that error. Repeat process if another error pops up. After your third successful build from source, it becomes much easier. Go for help, even ask the developer for help if need to.
lost me at 2:13 "Created a build directory in my home obviously..."
You said you would show .tar install...
For us noobs, this wasn't much help. I hate to criticize but when you switched to the desktop, you already were in a directory labeled "build" and you inferred everyone knows to do that. I have no idea how you did that or why. I realize you have to balance your content to both noobs and seasoned linux users, but maybe a little more detail could help us noobs just jumping into the linux game. When the video stated it was about building programs from source, I thought it was going to be tar files, compiling and using .sh command and all that other alien lingo. Anyways, I'm just putting that out there. Love your work man!!!
Thanks for the feedback Ted. I'll redo this topic in the future to make it more noob friendly.
Where in the git clone github.com/nikp123/xava.git is the option that makes the xava folder to be placed in your build directory? Something am I missing or you skipped steps
You should also should show how to unistall/remove it
Years later, I still haven’t figured out why exactly I use Linux. I also have computers with MacOS and Windows for work, and though I still consider myself a relatively new user I work in Linux as much as possible. I haven’t had issues with MacOS or Windows from a stability or security standpoint, I find Linux in many times has its share of minor quirks you have to look past, and sometimes things like installing applications that aren’t in the repo are much more of a challenge. I guess I’m a masochist.
Thank you, however that wasn't helpful. I wanted a more puase and deeper explanation