LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Better to install something using source, or package manager (https://www.linuxquestions.org/questions/linux-newbie-8/better-to-install-something-using-source-or-package-manager-4175474994/)

keldar89 08-28-2013 04:49 AM

Better to install something using source, or package manager
 
Hi there,

I have a very brief question which has always bugged me on Linux; is it better to install new software via the source (usually downloaded via the website), or from the system's package manager (I use Lubuntu - so apt-get).

The reason I ask this, is because the package manager does not always have the most up-to-date version of some software (I tend to find Java/NetBeans can drop behind a version or two quite quickly). And so sometimes I will install it from source which can be quite nitpicky.

However, it just doesn't feel right when I install from source, I'm guessing because it isn't centrally and automatically managed by the package manager. If I install it via the package manager, then at least that way I can easily remove it and have more control.

So, might be a silly question in the eyes of some, but is there a right/wrong way for this? Surely the package manager is there to be used, but why is it not always up-to-date? Is one preferred over the other and if so, then why?

Thanks.

yilez 08-28-2013 05:01 AM

If you don't use the package manager, it can sometimes become confused. Lets say you install java from Oracle's website and not from the package manager, then apt-get something that depends on java, it will probably download and install your distro's java anyway.

It is possible to make your own packages, but I find this more work than I want to spend. There are also other repositories out there that might contain more up to date versions of packages than your distro provides.

In my mind, I always use the package manager (if it exists) as it tends to avoid hassle later one. If I absolutely NEED a more up to date version, I tend to install it in a different location. Like /opt or a /home/yilez/local directory, so it doesn't interfere with the rest of my system.

95% of the time, the old versions of the package are fine anyway, so I rarely update.

Razaliel 08-28-2013 05:04 AM

Hi,

Install from the package manager is better because it automatically resolve dependencies which is not made by compiling the source. Sometimes the dependencies can be huge and you will not be able to resolve them by yourself. The package manager installs the software versions which are available in the repositories in /etc/apt/sources.list. They are not always up-to-date because some newer versions may not work with the current distribution version because it requirs unavailable newer dependencies and some other reasons.

If you want a distribution up-to-date, you can change to a rolling release like Debian sid or Arch Linux but these require a certain amount of skill because you might need to configure some things by hand and deal with bugs and unstability.

yilez 08-28-2013 05:10 AM

Razaliel adds some more points with dependencies and rolling release distributions. A few more user friendly rolling release distributions:

Mageia Cauldron
Fedora Rawhide
OpenSuse Tumbleweed

I tend to not like rolling release distributions. I have run both Gentoo and Arch in the past and while they are both fantastic, I like my packages to stay as they are when they are installed.

keldar89 08-28-2013 05:16 AM

Quote:

Originally Posted by Razaliel (Post 5017420)
Hi,

Install from the package manager is better because it automatically resolve dependencies which is not made by compiling the source. Sometimes the dependencies can be huge and you will not be able to resolve them by yourself. The package manager installs the software versions which are available in the repositories in /etc/apt/sources.list. They are not always up-to-date because some newer versions may not work with the current distribution version because it requirs unavailable newer dependencies and some other reasons.

If you want a distribution up-to-date, you can change to a rolling release like Debian sid or Arch Linux but these require a certain amount of skill because you might need to configure some things by hand and deal with bugs and unstability.

Awesome! Thanks all.

That was going to be my next question - by the looks of it, it seems that the package manager is the way to go. I'm setting up a new Linux VM and tried installing the JDK via the Java website which turned out to be horrendously difficult - so installed OpenJDK instead.

If a piece of software is out-of-date on the package manager, then is that something that has to be lived with? When does it get updated, and who by (and how regularly)?

Slowly getting to grips with Linux in comparison to Windows :).

Razaliel 08-28-2013 05:36 AM

Well, softwares are constantly "out-of-date" because the software developers always improve their product, but the old versions available in the Ubuntu repositories are still working well. When a version of Ubuntu is released, it has the software versions which were tested and approved by teams working for Debian and Ubuntu. For Ubuntu, a new version is available every 6 months and new software versions come with it. You can still install new versions of software via source like you did or via PPA.

yilez 08-28-2013 05:39 AM

Software tends to get fixed, but not updated. If your distro ships with python 2.6, you will only ever see python 2.6 on there. If you want 2.7 or 3.x, you will need to install a newer version of your distro.

there are 2 ways to look at this:

I install a long-term stable distribution. I can install any software from the repository and have a good idea that it will work. If it doesn't, it will get updates providing bugs are reported. On the downside, my distro might ship with Gimp 2.6. I want features from 2.8. This means looking for a package, making my own package, or installing from source, possibly affecting the rest of the system.

As a side note, I believe that MacOS gets around a lot of these issues by bundling dependencies into a package. Lets say a MacOS application requires SDL 2.0.0. Instead of installing SDL 2.0.0 as a system library for all programs to use, it will be in the application folder. This makes sure that your system stays stable, and allows you to use more modern software. It also bloats packages up somewhat. I've seen some Mac packages 3 times larger than the linux equivalent. I may have some of this wrong as I am not a Mac user.

Jenni 08-28-2013 06:08 AM

If you have a package manager that handles dependencies, you should probably use that. Installing software from source can cause issues with the dependency resolution as mentioned above.
If you don't have dependency resolution issues to deal with (Either by not using your package manager, or using Slackware, or taking steps to avoid it) Then it's really up to you to decide if you need anything special, like setting flags at compile time, or need a more up to date version than the package manager provides. If you don't need anything special like that, using the package manager is much easier and equally effective usually.

Berhanie 08-28-2013 06:18 AM

Quote:

If a piece of software is out-of-date on the package manager, then is that something that has to be lived with?
i would say, yes, on critical servers. for installations that are not critical, you can use third-party (i.e. unofficial) repositories that may have newer versions of packages for your distro.

Quote:

When does it get updated, and who by (and how regularly)?
the who is by the distro maintainers. the when depends on the distro and its goals, e.g. whether the distro strives to be cutting-edge or stable. even for fast-moving distros like fedora, new packages first have to go into a testing repository before they're made available to general users.

as an aside, there are two important issues solved by sticking to your distro's packages:

1. the software dependencies: you might install a new version of a package manually, but then run into problems when the package manager tries to bring in the older version as a dependency to something else. the distro maintainers presumably have worked out the dependencies among all the packages.

2. security: if you compile your own software, be prepared to update it when a vulnerability is found. this implies your having to check for vulnerabilities regularly. sometimes, updating is not so easy as installing, but you'd have to read the documentation which comes with the source code to know. it's easier to rely on the distro to keep up with security updates than to handle it yourself.

RockDoctor 08-28-2013 03:35 PM

Although I don't recommend it, you may be able to install a later version of a package in the appropriate format from another distro (for example, installing a foreign rpm on a Fedora system). Sometimes it works, but in my experience, it often causes many more problems than it solves. I've also used checkinstall to create an appropriate package from the source code, and then used the package manager to install the newly created package.


All times are GMT -5. The time now is 05:52 AM.