TOTW: Apt

Discussion in 'Linux / Unix Discussion' started by Phoenix, Jul 15, 2004.

  1. Phoenix
    Honorary Member

    Phoenix 53656e696f7220 4d6f64

    5,749
    200
    246
    Those of you familier with debian will be well versed in the use of apt-get, debians package management utility

    those of you who use the more popular RedHat may not be aware that there is a port of this brilliant tool for red hat (most versions) including Fedora core 1 and 2

    if you have ever tried using yum or up2date and had various problems and dependancy issues you will love apt, apt handles all dependencies and can upgrade anything with a newer version on the fly (like windows update with application upgrades rather than security fixes!!)

    lets take a look at how it works

    First we need to get the apt program, using standard rpm before we can use its wonderful features to keep our system upto date :)
    Code:
    [root@localhost fs01]# rpm -ivh http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/1/apt/apt-0.5.15cnc6-0.1.fc1.fr.i386.rpm
    
    once this has completed with no errors your first thing to do is to run apt-get update this will update the list of available files and updates that apt can get (in relation to whats installed on your system)
    Code:
    [root@localhost fs01]# apt-get update
    Get:1 http://ayo.freshrpms.net fedora/linux/1/i386 release [1814B]
    Get:2 http://apt.sw.be fedora/1/en/i386 release [496B]
    Get:3 http://dries.studentenweb.org apt/fedora/fc1/i386 release [482B]
    Get:4 http://newrpms.sunsite.dk redhat/en/i386/fc1 release [495B]
    Fetched 3287B in 2s (1171B/s)
    Hit http://ayo.freshrpms.net fedora/linux/1/i386/freshrpms pkglist
    Hit http://ayo.freshrpms.net fedora/linux/1/i386/freshrpms release
    Hit http://ayo.freshrpms.net fedora/linux/1/i386/core pkglist
    Hit http://ayo.freshrpms.net fedora/linux/1/i386/core release
    Hit http://ayo.freshrpms.net fedora/linux/1/i386/updates pkglist
    Hit http://ayo.freshrpms.net fedora/linux/1/i386/updates release
    Hit http://apt.sw.be fedora/1/en/i386/dag pkglist
    Hit http://apt.sw.be fedora/1/en/i386/dag release
    Hit http://dries.studentenweb.org apt/fedora/fc1/i386/dries pkglist
    Hit http://dries.studentenweb.org apt/fedora/fc1/i386/dries release
    Hit http://newrpms.sunsite.dk redhat/en/i386/fc1/newrpms pkglist
    Hit http://newrpms.sunsite.dk redhat/en/i386/fc1/newrpms release
    Reading Package Lists... Done
    Building Dependency Tree... Done
    [root@localhost fs01]#
    
    dont worry if you dont get as many 'hits' or 'results' this is due to me having various extra repositories added rather than just the default


    now we can run apt-get upgrade which will run against the new lists we just generated and let us update any installed programs with new verssion
    Code:
    [root@localhost fs01]# apt-get upgrade
    Reading Package Lists... Done
    Building Dependency Tree... Done
    0 upgraded, 0 newly installed, 0 removed and 0 not upgraded.
    [root@localhost fs01]#
    
    unfortunatly I run it nightly in a script and so i have nothing new to get lol :)


    the best feature of apt is apt-get install which allows you to install anything listed in the apt repositroies with just a keyword
    lets take a look at apt-get install mplayer
    Code:
    [root@localhost fs01]# apt-get install mplayer
    Reading Package Lists... Done
    Building Dependency Tree... Done
    The following extra packages will be installed:
      compat-gcc compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel divx4linux faad2 lame
      libdvdcss libdvdread libfame libmad libpostproc lzo mplayer-fonts xvidcore
    The following NEW packages will be installed:
      compat-gcc compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel divx4linux faad2 lame
      libdvdcss libdvdread libfame libmad libpostproc lzo mplayer mplayer-fonts xvidcore
    0 upgraded, 16 newly installed, 0 removed and 0 not upgraded.
    Need to get 14.9MB of archives.
    After unpacking 44.6MB of additional disk space will be used.
    Do you want to continue? [Y/n] [b]Y[/b]
    Get:1 http://apt.sw.be fedora/1/en/i386/dag mplayer-fonts 1.1-2.0.dag [1038kB]
    Get:2 http://ayo.freshrpms.net fedora/linux/1/i386/core compat-gcc 7.3-2.96.118 [2437kB]
    Get:3 http://apt.sw.be fedora/1/en/i386/dag mplayer 1.0-0.10.pre4.1.fc1.dag [6132kB]
    Get:4 http://ayo.freshrpms.net fedora/linux/1/i386/core compat-libstdc++ 7.3-2.96.118 [1054kB]
    Get:5 http://ayo.freshrpms.net fedora/linux/1/i386/core compat-libstdc++-devel 7.3-2.96.118 [360kB]
    Get:6 http://ayo.freshrpms.net fedora/linux/1/i386/core compat-gcc-c++ 7.3-2.96.118 [1848kB]
    Get:7 http://ayo.freshrpms.net fedora/linux/1/i386/freshrpms faad2 2.0-1.fr [412kB]
    Get:8 http://ayo.freshrpms.net fedora/linux/1/i386/freshrpms lame 3.96-1.1.fc1.fr [587kB]
    Get:9 http://ayo.freshrpms.net fedora/linux/1/i386/freshrpms xvidcore 1.0.1-1.1.fc1.fr [243kB]
    Fetched 12.4MB in 2m23s (86.2kB/s)
    Committing changes...
    Preparing...                ########################################### [100%]
       1:compat-gcc             ########################################### [  6%]
       2:compat-libstdc++       ########################################### [ 13%]
       3:compat-libstdc++-devel ########################################### [ 19%]
       4:compat-gcc-c++         ########################################### [ 25%]
       5:divx4linux             ########################################### [ 31%]
       6:faad2                  ########################################### [ 38%]
       7:lame                   ########################################### [ 44%]
       8:libdvdcss              ########################################### [ 50%]
       9:libdvdread             ########################################### [ 56%]
      10:libfame                ########################################### [ 63%]
      11:libpostproc            ########################################### [ 69%]
      12:lzo                    ########################################### [ 75%]
      13:libmad                 ########################################### [ 81%]
      14:mplayer-fonts          ########################################### [ 88%]
      15:xvidcore               ########################################### [ 94%]
      16:mplayer                ########################################### [100%]
    Done.
    [root@localhost fs01]#
    
    notice the numerous dependancies required for mplayer, all got with ease using apt-get


    The last feature of apt-get i will discuss is apt-cache search which allows you to search through the item lists generated with apt-get update to find the name you might be required to use with apt-get install
    Code:
    [root@localhost fs01]# apt-cache search xvid
    mplayer - MPlayer, the Movie Player for Linux
    transcode - Linux video stream processing utility
    gstreamer-plugins - GStreamer Streaming-media framework plugins
    ogle - A DVD player that supports DVD menus.
    videolan-client - The VideoLAN client, also a very good standalone video player
    xvidcore - Free reimplementation of the OpenDivX video codec
    xvidcore-devel - Static library, headers and documentation of the XviD video codec
    xvidcore09 - Free reimplementation of the OpenDivX video codec.
    [root@localhost fs01]#
    
    so I know by looking at this i will need to run apt-get install xvidcore and NOT apt-get install xvid

    Apt has numerous other features that I am not going to discuss in this article, i will leave you to find those out yourself

    As Suse is an RPM based distro it MAY support apt, but this version i believe is configured for fedora core 1 (the one i listed in the rpm-ivh http..... part, I have not tested this on suse yet and will try and report back when I do, in the mean time a google search may help those of you running suse

    for those with a red hat version other than fedora core 1
    check out htt://www.freshrpms.net for other builds

    Just a final note

    apt-get install synaptic will install the graphical front end for apt-get, if you use the gui alot run that command to get the gui front end, and run it in X windows (its self explanatory but when i get a screen shot ill post it)

    Hope that helps a few of you red hatters :)
     
    Certifications: MCSE, MCITP, VCP
    WIP: > 0
  2. Phoenix
    Honorary Member

    Phoenix 53656e696f7220 4d6f64

    5,749
    200
    246
    Here is a bit more help for those of you who wish to use Synaptic front end for APT instead of the command line
    its pretty self explanitory but i took some screen shots for your benefit

    they are pretty large (1280x1024 so please bear that in mind when grabbing them)


    Here we open Synaptic for the first time
    Greetings

    The Refresh button works the same way as apt-get update by updating the file lists from the repositories
    Updating File Lists

    Synaptic works slighty different in installing programs than apt-get install rather than installing one app at a time you select all the apps you want, and hit apply, installing them all together
    Pick N Mix!

    This image shows us what is going to be installed once the apply button has been hit, you can chose to download packages only if you wish to use them at a later date
    Confirm Install

    Same as above with 'show details' clicked to show us version numbers of installed components
    Confirm Install (details)

    Download progress
    Self Explanitory

    Uprade system has two functions, default and smart, default is like doing a apt-get upgrade and upgrades programs you have installed without installing anything new, smart upgrade is akin to the command apt-get dist-upgrade which i didnt mention earlier as it can mess up systems and i dont feel its appropriate to discuss in a newbie tutorial :)
    System Upgrade button

    the Find box works much the same as apt-cache search does, in that it searches the list (which is always browsable here anyway) for a specified term, i have used xvid again like in my previous example, pressing the arrow again moves to the next result containing the string
    Synaptic Find Feature
     
    Certifications: MCSE, MCITP, VCP
    WIP: > 0
  3. nugget
    Honorary Member

    nugget Junior toady

    7,796
    71
    224
    Wow Phoenix, that is one great article. Keep them coming and I think you will have a lot of linux converts.:D
     
    Certifications: A+ | Network+ | Security+ | MCP (270,271,272,290,620) | MCDST | MCTS:Vista
    WIP: MCSA, 70-622,680,685
  4. Phoenix
    Honorary Member

    Phoenix 53656e696f7220 4d6f64

    5,749
    200
    246
    Feel free to donate expert points when they come back for all my lovely articles :P
     
    Certifications: MCSE, MCITP, VCP
    WIP: > 0
  5. nugget
    Honorary Member

    nugget Junior toady

    7,796
    71
    224
    I would if I could find out how to:!:
     
    Certifications: A+ | Network+ | Security+ | MCP (270,271,272,290,620) | MCDST | MCTS:Vista
    WIP: MCSA, 70-622,680,685
  6. AJ

    AJ 01000001 01100100 01101101 01101001 01101110 Administrator

    6,897
    182
    221
    Nugget, Phoenix already raised the expert points issue Here
     
    Certifications: MCSE, MCSA (messaging), ITIL Foundation v3
    WIP: Breathing in and out, but not out and in, that's just wrong
  7. nugget
    Honorary Member

    nugget Junior toady

    7,796
    71
    224
    Thanks AJ, I saw the question some time ago but never saw the response.

    Phoenix: awarded 20 Xpert Points[​IMG]
     
    Certifications: A+ | Network+ | Security+ | MCP (270,271,272,290,620) | MCDST | MCTS:Vista
    WIP: MCSA, 70-622,680,685
  8. Phoenix
    Honorary Member

    Phoenix 53656e696f7220 4d6f64

    5,749
    200
    246
    Lol i dont think that was the reply, but being i notice the expert points has now been REMOVED i guess si is busy testing the new reputation system! :)
     
    Certifications: MCSE, MCITP, VCP
    WIP: > 0
  9. SimonV
    Honorary Member

    SimonV Petabyte Poster Gold Member

    6,651
    180
    258
    Hopefully once I've completed the reputation system will be renamed and will function similar to the expert points. As I'm no php guru I'm going to have to get a little help with this but it will return. :biggrin

    Also the old forum is still alive in the CertForums basement so I should be able to tranfer the old points scores forward to the new system.
     
    Certifications: MOS Master 2003, CompTIA A+, MCSA:M, MCSE
    WIP: Keeping CF Alive...

Share This Page

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.