Installing new software (Debian, Red Hat, Slackware)

Discussion in 'Beginner Tutorials' started by Rob, Jul 9, 2013.

  1. Rob

    Rob Administrator Staff Member

    Messages:
    575
    Likes Received:
    217
    Trophy Points:
    43
    Debian:
    There are various methods to installing new programs on a Debian system. I like to classify them according to your connection type.

    Code:
    dpkg
    This is the "classic" way of updating a Debian system. Typically, you could go to Debian's website or any one of its mirrors and download a package.

    Code:
    dpkg -i package.deb
    to install it.

    The main drawback to this is that you may find a package that you like but it may have dependencies (ie. other programs that it needs to make it run) and if you don't have those packages, then the install will fail.

    This is what the Debian people themselves have to say about this method:

    Many people find this approach much too time-consuming, since Debian evolves so quickly -- typically, a dozen or more new packages are uploaded every week. This number is larger just before a new major release. To deal with this avalanche, many people prefer to use automated programs.

    Despite what they say, the main advantage of dpkg, it seems to me, is that it is easy for people who have dial-up connections. This is because the alternative, automated programs they're talking about, which are dselect and apt-get are better for permanent connections (cable, xDSL, T1, T3). Let's talk about this method of installing new programs with Debian.

    Code:
    dselect
    When you use dselect you get a graphic user interface of sorts (not under X window, though) to guide you through the install of new programs.

    First you'll get asked for your preferred access method. That means, how you're going to get and install them. For example, if I were doing an install of Debian with CDs, then I would choose CD-ROM. But if I were updating, I would choose FTP

    Then you would choose the packages you want with a + sign. You can even put updates on hold (indicate that you want to update, but not actually do it) with a = sign. There may even be conflicts or dependency problems and 'dselect' will warn you about those.

    Then you start the process by choosing the install option.

    Debian will then configure the installed packages.

    Then you're on your way.

    As I said before, the main advantage to this is that any conflicts or dependency problems will be resolved right here. The Debian people point out that this is ideal for installs or large-scale upgrades. If that's the case, it seems that a slow and sometimes expensive dial-up connection would be less than ideal for this.

    Red Hat:
    The way you install a new program will depend primarily on two things:

    1) What distribution (version) of Linux are you using?
    2) What is the origin of the program that you want to install?

    RPM

    If you're using Red Hat or a distribution that bases itself on Red Hat, then you're going to use the RPM method. OK racing fans- RPM doesn't have anything to do with revolutions per minute. It stands for Red Hat PackageManager. This system takes the heartache out of installing programs under Linux, for the most part. You can go to the Red Hat website or any number of mirrors and get programs for Linux. Developers will almost always offer their programs in RPM format due to its popularity. I also want to note that RPM has also come to mean the package itself (as in \"I downloaded an RPM yesterday\").

    There are some basic commands you're going to need to know to take advantage of the RPM system.

    Code:
    rpm -i new_program.rpm
    This installs the program (-i option for install)

    Code:
    rpm -q program_name
    This \"queries\" your system to see if you've got a certain program installed. Let's say you hear there's a new version of the popular Internet browser Opera for Linux and you don't know if your Red Hat based distribution installs this by default or not. Before you download the RPM for Opera, you could type the command:
    Code:
    rpm -q opera
    If you do have the package installed, it would give you the version number:

    opera-11.62

    If you don't have the package installed, you will see:

    package opera is not installed

    If you don't have Opera installed, then you can download their RPM and run rpm -i opera_whatever_version.rpm as root and install the program.

    If you do have the program installed and the rpm -q opera command gives you a older version number and you want the newerone, then you have two options.

    One is to "uninstall" the older package and install a new one in its place. Not that this is the most efficient option. I just wanted to introduce you to the -e option for RPM. That is, to get rid of a program that you've installed, you would type rpm -e program_name. For example, if you've got Opera's beta version 7 and you've just downloaded the beta version 8, then you would first do:

    Code:
    rpm -e opera
    This gets rid of Opera from your system. Then you would type rpm -i opera_beta8.rpm (or whatever the package is actually called). That installs the new version.

    As I said, this is not the most efficient way to update packages. The usual way is to use the -U (as inUpdate command.

    You would type:
    Code:
    rpm -U opera_new_version.rpm
    and that would install the new version and remove the old version from your system.

    Those are the basic commands of the RPM install/update system in a nutshell.

    When you're using your windows manager, there are some very good tools for installing, updating and uninstalling RPMs that are graphically based. You can choose menu options to do all that we explained before instead of having to type the commands in the terminal. You may want to look into programs like Kpackage for KDE orGnome RPM for the GNOME enviroment. They may make these tasks a lot easier, especially if you're just starting out in the Linux world.

    Some words of caution on downloading RPMs

    Some of the most popular Linux distributions base their install and update prodedures on Red Hat's package management system. These include Mandrake and SuSE for example. Both of these companies create their own RPMs to be specifically installed on their systems. That means if you're using SuSE or Mandrake your best bet is to go to their respective \"official\" websites or mirrors and download their particular RPM and install it using the procedure outlined above or their specific tools. You may run into a problem if you installed an RPM for Red Hat on a SuSE system. Certain components in the package (like documentation or libraries) may get copied into a different directory than was intended for that system. Third party RPMs from reputable companies, like the Opera web browser in mentioned above, should install fine on any RPM based system. I have successfully installed this package (the same exact RPM file) on SuSE, Mandrake and Red Hat. I even converted this RPM to Debian (.deb) package format and successfully installed it in a computer running Debian. More on this conversion later in the show!

    Just a brief second word of caution. Getting and RPM doesn't necessarily mean that you're automatically (or "auto-magically") going to be able to install it. Many websites out there offer RPMs for download. The good ones usually include a list on that particular RPM's page of other programs or libraries that you need in order successfully install and use the program. If you see a list a mile long of "requirements" (those other programs and libraries you need), then you might want to ask yourself if you really want to try that program out.

    And here's just an editorial comment on my part about this type of thing as well. The big buzz word with Linux is "free". That's fine. You can theoretically get a distribution from the Internet along with programs and install it for free. (ie. no money down). I think, however, that time is money, to use the trite expression. Time might be even more valuable than money. (lost money might be re-earned but not lost time). When I first installed Linux oh so many years ago, updating and installing stuff was at times a frustrating experience. I suggest that newcomers to the Linux world buy (yes, I said buy) a good boxed set of a commercial distribution and then they'll have more programs than they would ever need, all installed and working properly along with a manual to tell you what to doin case something doesn't work.

    Code:
    yum
    Yum is a package manager that was developed by Duke University to improve the installation of RPMs. Yum searches numerous repositories for packages and their dependencies so they may be installed together in an effort to alleviate dependency issues. Red Hat Enterprise Linux 5 uses Yum to fetch packages and install RPMs and well as many Red Hat derivatives like CentOS and Fedora Core.

    Yum uses a configuration file at /etc/yum.conf.

    There are multiple ways by which you can install a repository on the system and install/update packages :

    Code:
    yum search package_name
    yum info package_name
    yum install package_name
    yum update package_name
    yum remove package_name
    Slackware:

    Slackware, known to the Linux world as \"Slack\", has the reputation of being, on one hand, a flexible distribution that allows you to do practically anything you want and, on the other hand, one that is for "experienced" Linux users only.

    A lot of these considerations are "politically" motivated. Slackware lacks some of the "smooth" and "slick" graphic installation packages that are becoming standard fare in commercial companies' offerings but in the end, if you're willing to just use the command line utilities, it's just as easily updated as any other major distribution.

    Slackware's package format

    Slackware packages come in *.tgz format. This a variation of the *.tar.gz format we've seen before. You can go to your favorite website and download new programs for your Slackware system and with a simple:

    Code:
    installpkg some_program.tgz
    you have your new program installed.

    If that particular package doesn't quite move you and inspire you too much, you can just remove it:

    Code:
    removepkg some_program.tgz
    You can also add the option -warn between the installpkg/removepkg command and instead of installing the package, it will tell you what new files are going to get added to your hard disk. That's a good option for the "I wonder if I want this" moments of your life.

    Upgrading packages

    You can upgrade programs to newer versions with this command:


    Code:
    upgradepkg a_new_version_of_something.tgz
    Using other package formats

    If you're using Slackware and you can't find a package your looking for in the *.tgz format, you can also grab on to an *.rpm and convert it.

    The way to do this is:

    Code:
    rpm2tgz some_package.rpm
    This takes the rpm in question and converts it to *.tgz format. Then you can use installpkg on the new file you've created to install it.

    GUI does not necessarily = GOOD

    Once again, there is a common misconception that just because something doesn't have a wonderful graphic interface that makes you say \"oooh\" and \"ahhhh\", it is somehow inferior. Don't let that missing GUI fool you here. A computer running Slackware is a tremendously flexible and configurable system. So what if you have to write things on a command line? That's what you've got a keyboard for, isn't it?

    Enjoy your Slack system!
    Saptarshi Nag and ryanvade like this.
  2. Wumiemie

    Wumiemie New Member

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hi, i have a question about 'yum', I want to install software 'A', but 'A' depends on 'B' 'C' 'D' and many other softwares, then 'yum' will install them all. One day I don't want to use software 'A' anymore, is there any solution to remove 'B' 'C' 'D' automatically instead of using "rpm -e B && rpm -e C && rpm -e D && ..."?
  3. ryanvade

    ryanvade Administrator Staff Member Staff Writer

    Messages:
    1,260
    Likes Received:
    428
    Trophy Points:
    83
    Code:
    yum remove "package name"
    is used to remove the program and its dependencies. HOWEVER, if those dependencies are needed for other programs, yum will not remove them. There is also
    Code:
    yum -remove-with-leaves 
    but this tool is not exactly nice...
  4. cronugs

    cronugs New Member

    Messages:
    16
    Likes Received:
    8
    Trophy Points:
    3
    Well written. But I think you left out debians main package management tool.

    These days dselect is considered archaic and for a lot of people quite confusing. Most Debian users, along with those running distros derived from Debian (Ubuntu, mint, raspbian etc.) would be most familiar with apt-get.

    Code:
    apt-get install package-name
    This will install or upgrade a package along with all it's dependencies.

    If you are searching to find the name of a package, or to see if its available in the repositories

    Code:
    apt-cache search package
    The nice thing about apt-get is that it can also update your entire system to the latest versions of all the software you have installed. It can also upgrade you to the next distribution release.

    Code:
    apt-get dist-upgrade
    apt-get is tremendously flexible and this doesn't even begin to scratch the surface of what it can do. But as Debians primary package management tool I think it's worth including here
    DevynCJohnson and lobo like this.
  5. ryanvade

    ryanvade Administrator Staff Member Staff Writer

    Messages:
    1,260
    Likes Received:
    428
    Trophy Points:
    83
    and aptitude
    https://wiki.debian.org/Aptitude
  6. mrasplund

    mrasplund New Member

    Messages:
    3
    Likes Received:
    1
    Trophy Points:
    3
    I am still fairly new to Linux. This may be a question for another place or time but this part of the tutorial looks to be about package management tools. So, would it not be worth a few comments on the basics of Git?
  7. lobo

    lobo Active Member

    Messages:
    130
    Likes Received:
    74
    Trophy Points:
    28
    Yes, i have agree with cronugs... in fact there is so much information missing from this guide that it's not that useful.

    rpm2tgz is not a recommended method of converting rpms to slackware packages, in fact I haven't seen it mentioned anywhere for several years. If something isn't available in slackware, then slackbuilds.org is by far the best place to go.

    pkgtool's ncurses interface and perhaps more importantly slackpkg are also omitted...

    @mrasplund: git is not a package manager, but a version/revision control system (like svn)
    mrasplund likes this.
  8. SuriyaKumar

    SuriyaKumar New Member

    Messages:
    15
    Likes Received:
    6
    Trophy Points:
    3
    good start for me!!!!! Thank a lot!!!
  9. shift14

    shift14 New Member

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    ok looks like you need to know how to program to use linux, no wonder i'm having problems trying to install software. your telling to write code, but you don't say where, as a text on my phone? on a typewriter?
  10. grim76

    grim76 Active Member Staff Writer

    Messages:
    177
    Likes Received:
    48
    Trophy Points:
    28
    One thing to add:

    yum localinstall <path_to_package>

    This will instal the package and add it to the DB for keeping track of installed packages.
  11. BigBangTheory

    BigBangTheory New Member

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    HELLO

    Can you help me please i have SUSE Linux Enterprise Desktop an i dont know how to install Wine . Can you help me ?
  12. grim76

    grim76 Active Member Staff Writer

    Messages:
    177
    Likes Received:
    48
    Trophy Points:
    28
    Please start your own thread. Hijacking someone's thread is bad forum etiquette.
  13. prabhu Ram Khadka

    prabhu Ram Khadka New Member

    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I am very new for LINUX how can i start?
  14. grim76

    grim76 Active Member Staff Writer

    Messages:
    177
    Likes Received:
    48
    Trophy Points:
    28
    Please start your own thread to ask questions. Do not hijack another thread.
  15. Fauzan

    Fauzan New Member

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Do you guys know where to download RedHat ? Because when I go to their official site I don't know which one I should download.
    Thanks.
  16. grim76

    grim76 Active Member Staff Writer

    Messages:
    177
    Likes Received:
    48
    Trophy Points:
    28
    When you purchase the software you can get links. Also you can request an evalution that will supply you with the ability to get the software.

Share This Page