Linux.com

Home Linux Community Community Blogs

Community Blogs



Thoughts on Package Managers: Source vs. Binary

One of the things I love about Linux distros as opposed to Windows/MacOS is that we have package managers. On Windows, every piece of software comes with its own "package manager," and even when you uninstall them, they still do a lousy job cleaning up after themselves. Macs have "packages," but not much of a manager. Linux, though, has a wide variety of software that makes it easy to manage your installed programs. This is a series where I describe some of the attributes of package managers, and what I think should be in the Perfect Package Manager.

Today, I'm discussing one of the biggest differentiations between package managers: source packages vs. binary packages. Source package include a tarball of the application's source code, and instructions on building it. When you install the package, it builds and compiles everything on-site, then installs. Binary packages have everything already built, and installing the package just takes everything out of it.

When I first read about source packaging systems, I thought, "Wow! This sounds really great!" By building on source, you can make sure that everything is configured properly for your system, and exact more customization upon the package. It also makes Richard M. Stallman happy, what with his constant ranting about the importance of source code. (Note: I'm not making fun of RMS here. That comes later.)

After I installed and ran an upgrade of GoboLinux, though, I took a more realistic approach to source packages. Namely, installing a binary package compared to installing a source package is like using a computer vs. using a computer while you and the mouse and keyboard are immersed in a vat of molasses. In other words, it's slow. One person referred to Gentoo having a screensaver built in on the command line: GCC.

Having said that, binary packages have the immediate benefit of installing quickly. On my Arch Linux system, the 'Install' step of installing a package takes less than a second. Sometimes I don't even see the hash marks of the progress bar appear on my screen.

 

FOSS and the Free Market

One of the things I've heard people say about free/open source software like Linux (fortunately, not in person) is that it is communist/socialist. Admittedly, RMS linking to every left-wing cause in the world on his homepage doesn't help. In reality, though, free/open source software is the best way that software can be handled in a market economy.

There are two crucial terms here - excludable and rival in consumption. If a good is excludable, it is possible to stop people who have not paid from the good from using it or enjoying its benefits. For example, computers are excludable - if you sell computers, people can't use your computers for themselves without buying them from you. An example of a non-excludable good is a fireworks show - anyone within a few miles can watch and enjoy the fireworks.

If a good is rival in consumption (an more common version of this term is "rival" or "rivalrous", but "rival in consumption" is the way I learned it), one person using the good impairs or prevents others from using it simultaneously. For example, food is rival in consumption. If I eat a sandwich, you can't eat the sandwich, and if you can, it will be in a form that you will not want to eat it in. FM radio is not rival in consumption. Everyone in an eight-mile radius could be listening to the same station, and they would all listen to it the exact same as if they were the only one.

These categories can and do overlap - most goods that are one fall into the other. Fireworks shows and FM radio, two of my examples, are both non-excludable and non-rival - known as public goods - whereas my other two examples, computers and sandwiches, are both excludable and rival in consumption - private goods. It is possible for there to be excludable but non-rival goods (club goods - i.e. cable TV), and non-exclusive goods that are rival in consumption (common goods - i.e. fish in a lake).

Now that I've given everyone a lesson straight out of Economics 101, you may be wondering what the point is. The point is that software is merely computer data. Computer data is neither excludable - I can put a file on the Internet, and everyone in the world could download a copy while I still had mine - nor rival in consumption - two copies of the same data can be used at the same time. This means that computer data like software cannot be effectively sold for a profit.

This results in a situation known as a market failure. This is a situation where the free market, even in idealized conditions, cannot effectively determine a good result. There are two ways you can go with this situation.

The first way is to try and make software excludable and rival in consumption. This is done by taking software out of the sphere of goods and making it a service - i.e. we rent the license key to you, and you can use the software. The problem is, this doesn't always work. Computer data, despite being a public good, is still a good, so it is not very hard to pirate software. Repackaging goods as services is an example of exploiting the free market, and results in high prices, antitrust behavior, and an undesirable market outcome. It doesn't stop the market failure - just gives the people who created the software a bit more money for a while.

The other way is to not try and sell software itself for a profit. This is what free/open source software does. There's no monetary incentive to produce public goods, so we instead make it a community incentive and a volunteer effort. Because of this, we don't have to waste energy fighting an uphill battle against the market forces that make it hard or impossible to profit from software, and can instead focus on making our software the best it can be.

In addition, it's still possible to make money off it: as the Wikipedia article on public goods states, "since most of the benefit of a lighthouse accrues to ships using particular ports, lighthouse maintenance fees can often profitably be bundled with port fees." In other words, we can make money off incidental goods, like computers, or after real services like support, instead of the fake services of license keys.

In conclusion, the way the free market works makes it impractical to sell software itself. By taking software out of the market and into the hands of open source developers, we can let the market work the way it's supposed to.

 

NEWB's adventure's in Linux From Scratch

Well I'm back,

Yes, again.. already....:) I've basically used the first two days of this restart making small errors one after another. I made a small error during the install of expect  that cost me to remove the entire tools directory. Then when I tried to do it again I made a costly error that after installing glibc moving files around couldn't be fixed and as Im installing gcc for the 4 time in 2 days, I realized that binutils was the files that were screwed up when I was moving files in glibc. It seems that these first few files have alot in common.

The only Liberty I've taken is installing ccache as a gcc cache , otherwise everything is stock configure. As the manual points out , binutils, gcc,and glibc are better off not being "optimized" at all. basic configure. I'm planning on continuing till I get to expect complete. Leave the rest for another day.

 

 

NEWB's adventure's in Linux From Scratch

 Well,

 I'm back again on the same day figured out a way during playing with compiling kernels and it worked well there so I thought you'd like to know about it for LFS use. It's called "ccache" and I installed it by passing the --prefix=/tools option during ./configure and it installed in the /tools/bin dir.

  I impressed myself :))

I  got so brave that I tried some options while compiling binutils and gcc and glibc although not advised. Guess what?  while running "make test" on expect I got wierd errors .  Couldn't get a quick answer on the IRC lfs-support chat .I've removed all the contents of my tools directory.  Now , I'm starting over. All along I've removed my source and build directories so that was no issue. 

 ccache installed easily and I've started with binutils . 

 

Linux.com lacking a "digg"-type button

I just thought that I would point this out and see what others have to say.  

The one thing that I keep finding when reading through linux.com is that I'll find an article that I find great and I want to indicate it as something I enjoyed by a "digg"-type button, but all I have is a "Favorite" button. 

That said, I realize that there is a real Digg button, but that would mark the article up in the ranks on the actual digg site.

 Request:  Add a button that I can use to mark an article as worth reading.  (I can mod up comments, but why not articles?) 

 

More powerful Python testing techniques

Look at how the leading Python testing frameworks provide robust auto-discovery of your application tests. Make sure your applications are written right the first time, and that they stay working through months and years of further tweaks and improvements.
 

NEWB's adventure's in Linux From Scratch

Ouch!

 Started thinking for myself. Asked a question in an IRC support room and got barked at again. Good thing I've got a thick skin. When multiple people try to chat to you and sentences get crossed and they don't comprehend or you don't comprehend , seems you either get RTFM or some other not so friendly comment.

   Oddly enough, I got to the glibc build three times today because of user errors, once totally my fault not explicitly following the manual, the other, I forgot to install patches on glibc and already had it installed. BEWARE

They don't remind you about needed patches in the book/manual. I'm on my third attempt wish me luck! 

 

Spammers out from this Blog Area

As many of you I've decided to stop using this blog area until spam ends in this zone.

When linux.com renewed its layout I've used the Blog area to read opinions from other users and even publish some tech hints useful for myself and hopefully useful for someone else as well. I've sent few hints and some usernames to linux.com managers and they've replied back with appreciations for it.

They're now implementing a new spam filter as well as other things to keep spammers out and avoid blogs with tons of spam links, I'll look forward for this kind of improvements.

 

Sincerely 

 

Ben 

 

NEWB's adventure's in Linux From Scratch

 Back again,

   This time I've started a new LFS install,  The install of the binutils tools went rather well. However, I cannot say the same with Gcc. I first read the entry on the manual and assumed that my install would require that i build mpfr and gmp then install them in the gcc-build directory and then compile, after trying four or five times to get it to work, I had to go to IRC chat. Well, now configure would run you see I was supposed to untar mpfr and gmp then gcc. Then mv mpfr and gmp into gcc directory then cd to gcc-build directory. But from where I stand, it doesn't communcate that in the book??? Am I the only one?

 Currently, I'm building glibc. No problems as of yet.  Something that I will point out though. Once the day is through is how successful I am at stop/resume of the install. :) 

 

Working with filesystems using NFSV4 ACLs

Here's a great cheet sheet on managing NFSv4 ACLs on different filesystem with different commands. This article discusses and compares the different commands that you might use to migrate from one filesystem to another.
 

Getting HAL to allow Horizontal Scrolling

This is how I got it working on my little netbook.  Seems somehow more and more websites are being designed for larger than 1024 wide screens and so horizontal scrolling is becoming more of a need.

Two steps are needed 1st I edited Firefox and then I edited the files for HAL.  In the end we have to reboot the system because somehow the implemintation of X on a number of modern distro's (cough *buntu cough) are more windows like and so every change now requires a reboot. (CNTRL-ALT-BKSpace doesn't work, even when enabled) 

So on to the needed changes.  Open Fx (Firefox) and enter "about:config" (without the quotes) in the URL bar.  If this is the first time you have to promise the Mozilla gods that you'll be a good boy/girl and you are presented with a list of all of the configuration options Fx has.  Now in it's equivalant of a URL bar enter this:

mousewheel.horizscroll.withnokey.action

double click on the config line that is below the bar, and change the 0 to a 1.  Now you are done with Fx. 

Now on to getting it working in X.  Gone are the days of a single config file no matter how long.  Additionally some distro's (see above cough) have decided not to follow the FHS and have put the config files outside of /etc.  No problem despite attempts to hide them so that "dumb users" don't find them (tounge firmly in cheek on that btw) we can locate them.  

The correct place to find the file would be 

 /etc/hal/fdi/policy/

With *buntu and it's derivatives the file is in /usr/share

 /usr/share/hal/fdi/policy/20thirdparty/

The correct file we will edit will be *synaptic.fdi (where the full name can vary by distro) If you don't find it there then at a command line run this:

 locate synaptic | grep fdi

This should allow you to find the correct file.  Now let the editing begin.  open the file you found in your favorite editor. (remember to save a backup copy just in case of an "oh S***" moment, and to edit it as root).  With *ubuntu the file would look something like this: (The code here is edited so that the blog software doesn't pick it up as code, the real version uses angle braces instead of square ones. If you cut and paste be sure to make the required brace change or else it won't work and you may be left with a dead mouse cursor.)

[deviceinfo version="0.2"]
  [device]
    [match key="info.capabilities" contains="input.touchpad"]
        [merge key="input.x11_driver" type="string"]synaptics[/merge]
           [!-- Arbitrary options can be passed to the driver using
             the input.x11_options property since xorg-server-1.5. --]
        [!-- EXAMPLE:
        [merge key="input.x11_options.LeftEdge" type="string"]12[/merge]
        --]
    [/match]
  [/device]
[/deviceinfo]

The important part for us is the lines that start with 

[merge key...... 

We are going to add(or if it exists edit) the line 

 [merge key="input.x11_options.HorizEdgeScroll" type="string"]true[/merge]

Other distro's may have this line there already, and if horizontal scrolling didn't work in regular apps it will say "false" instead of "true".  Edit and change this and you are off and running.   In your *buntu system the file will now look like this:

[deviceinfo version="0.2"]
  [device]
    [match key="info.capabilities" contains="input.touchpad"]
        [merge key="input.x11_driver" type="string"]synaptics[/merge]
        [merge key="input.x11_options.HorizEdgeScroll" type="string"]true[/merge]
        [!-- Arbitrary options can be passed to the driver using
             the input.x11_options property since xorg-server-1.5. --]
        [!-- EXAMPLE:
        [merge key="input.x11_options.LeftEdge" type="string"]120[/merge]
        --]
    [/match]
  [/device]
[/deviceinfo]

Note: In an xml file anything between !-- and -- is a comment make sure you don't add lines in the middle of a comment.  

Now to get your mouse working right.  As mentioned on *buntu you probably need to reboot (cough), however the following procedure should work on all others.  As root restart the hal daemon (/etc/init.d/hal restart), with some you may additionally need to restart X (logout and use Cntrl-Alt-Backspace).  At this point enjoy the scrolling.

More config options for HAL do exist and one place I found a "list" is here in an article at thinkwiki.

 
Page 114 of 150

Upcoming Linux Foundation Courses

  1. LFD312 Developing Applications For Linux
    16 Feb » 20 Feb - Atlanta - GA
    Details
  2. LFD331 Developing Linux Device Drivers
    16 Feb » 20 Feb - San Jose - CA
    Details
  3. LFS220 Linux System Administration
    16 Feb » 19 Feb - Virtual
    Details

View All Upcoming Courses


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board