How to get apt-get


Page 1 of 5 12345 LastLast
Results 1 to 15 of 67

Thread: How to get apt-get

  1. #1
    Join Date
    Oct 2002
    Location
    Binghamton NY
    Posts
    2,435

    How to get apt-get

    For me, it's all about the package manager... and that means it's all about apt-get. When we get into those "best newbie distro" discussions, my fierce advocacy for Debian has always been based on the fact that Debian is the only distro I know that comes (with a net install) all loaded up and ready for apt-getting packages right from the get-go. Other distros are a little more complicated. Ubuntu, for example, requires a little editing of the source files. It's a one-time thing, and certainly not a lot of work (basically, you delete a few #'s) Like so much else, it's easy once you know how, but it's the knowing how that can be an obstacle for the newbie. And getting apt-get working does seem to be just a little bit different for every distro.

    So I thought that a "How to get apt-get" thread would be a real service to the up and coming newbies of the gnu generation. The idea is that everyone could talk about exactly how to get apt-get with their own particular distro. It not a lot of knowledge, but it's powerful knowledge that I think could stand to be gathered together and left in plain sight.

    To make the thread especially useful, we could all post our source lists in our threads, and spare everyone the bother of hunting down repositories.

    Before I start the ball rolling, I want to sugges that if anybody wants to contribute anything about other package managers (yum, slapt-get), in my opinion that would be perfectly cool.

    And now, the 1 minute apt tutorial:

    apt-get update
    apt-get upgrade
    apt-get install <package name>
    or
    apt-get install <package name> <package name> <package name> <package name>
    apt-cache search <keyword>

    and, of course:

    man apt-get

    always update before you upgrade, and make sure it hasn't been too long since you last upgraded before you install. The first time you upgrade, expect it to take awhile, but after that, it's usually pretty painless.

    With a debian-based distro, you may be prompted to answer some questions during the upgrade or install, and if you have no idea what the answer is, there's always a default answer, and I've never once regretted choosing it.

    How to get apt-get in CentOS:

    Ironically (well a little, maybe), with CentOS I get apt by using yum! I only tried using yum once and I had problems (one of the sources was down, whether permanently or temporarily I do not know.) but I found that I could use yum to get apt, just by using the sources that CentOS comes with. So as root I type

    yum install apt
    and the magic begins!

    (I'll talk about setting up the sources for apt in CentOS tomorrow. Right now I'm being called away.

    (later)

    Here is a link to a download on my website ( currently unmaintained, but soon to be reborn with a new, pro-linux mission) of a tar.gz archive of my apt directory for CentOS. You can copy the whole directory (assuming you haven't made any changes that you wouldn't want to lose) into /ect/, overwriting the current apt directory, or you can do more precise stuff with the individual files.

    NOTE: LINKS DON'T WORK! FORUM SOFTWARE DOESN'T LIKE MY URL!
    What a *****! This means I'm going to have to post a link to the link... which will be coming soon.
    ATTENTION MODS: If there's someway you can allow me to link to my site in here,
    (microbit*h.com), I promise that (at least by my hand) it will only turn up invisibly, as html, and not in printed text.
    Last edited by blackbelt_jones; 10-07-2005 at 12:23 PM.

  2. #2
    Join Date
    Oct 2002
    Location
    Republic of Texas
    Posts
    5,898
    so how about we start with YOUR sources.list?
    Need help in realtime? Visit us at #linuxnewbie on irc.libera.chat

    Few of us will do as much for our fellow man as he has done.
    --Andrew Morton on RMS

  3. #3
    Join Date
    Oct 2002
    Location
    Binghamton NY
    Posts
    2,435
    Of course. I posted the link above (after your request) and I'm posting it again here, to avoid unnecessary searching:

    http://micro*****.com/downloads/apt4centos,rhel.tar.gz

    That link should allow anyone to download an archived version of my /etc/apt/ folder from my CentOS system. Copy it to your system as you see fit.

    NOTE: LINKS DON'T WORK! FORUM SOFTWARE DOESN'T LINKE MY URL!
    What a *****! This means I'm going to have to post a link to the link... which will be coming soon.
    ATTENTION MODS: If there's someway you can allow me to link to my site in here,
    (microbit*h.com), I promise that (at least by my hand) it will only turn up invisibly, as html, and not in printed text.
    Last edited by blackbelt_jones; 10-07-2005 at 12:21 PM.

  4. #4
    Join Date
    Oct 2002
    Location
    Republic of Texas
    Posts
    5,898
    cool deal....once in awhile I throw some configs in a dir and save them to make a page with...one day you will do that too...
    Need help in realtime? Visit us at #linuxnewbie on irc.libera.chat

    Few of us will do as much for our fellow man as he has done.
    --Andrew Morton on RMS

  5. #5
    Join Date
    Oct 2002
    Location
    Binghamton NY
    Posts
    2,435
    Quote Originally Posted by je_fro
    cool deal....once in awhile I throw some configs in a dir and save them to make a page with...one day you will do that too...
    I keep things like my sources.list file for debian, my big compound apt-get command for customizing a fresh debian install-- and now my grub boot menu-- in my yahoo mailbox notepad. Storing things like that online can be incredibly handy.
    Last edited by blackbelt_jones; 10-07-2005 at 12:24 PM.

  6. #6
    Join Date
    Feb 2004
    Location
    Singapore
    Posts
    2,170
    regarding your first post in this thread, its really a good FUD.

    it works for you and many more people, but then its really not true.

    Examples against your assumption that only debian starts out well with apt-get are:
    1. archlinux and its pacman are configured before you even start
    2. gentoo and a host of other source-based with package-managers usually have comprehensive package managers with all those default settings already done
    3. RPM based distros also come with their own source lists that are seldom changed, or need to
    4. debian derivatives have some glitch or something, but they usually work right out of the box or else they wouldn't be there in the first place
    5. slackware is the special one --- it doesn't come with one, but you can always get their jewel swaret and others, including emerge for slackware and slapt-get

    and although apt-get is really good, there is no need to spread it. its already famous enough! And you really don't need to get apt-get if you already have it!

    ok, just take this with a bit of fun. I'm making a joke here
    Come under the reign of the Idiot King...
    Come to me ... I love linux!

    Registered Linux user: Idiot King #350544

  7. #7
    Join Date
    Oct 2002
    Location
    Binghamton NY
    Posts
    2,435

    Wink

    Quote Originally Posted by XiaoKJ
    regarding your first post in this thread, its really a good FUD.

    it works for you and many more people, but then its really not true.

    Examples against your assumption that only debian starts out well with apt-get are:
    1. archlinux and its pacman are configured before you even start
    2. gentoo and a host of other source-based with package-managers usually have comprehensive package managers with all those default settings already done
    3. RPM based distros also come with their own source lists that are seldom changed, or need to
    4. debian derivatives have some glitch or something, but they usually work right out of the box or else they wouldn't be there in the first place
    5. slackware is the special one --- it doesn't come with one, but you can always get their jewel swaret and others, including emerge for slackware and slapt-get

    and although apt-get is really good, there is no need to spread it. its already famous enough! And you really don't need to get apt-get if you already have it!

    ok, just take this with a bit of fun. I'm making a joke here
    I made no assumptions. I'm fully aware that there are distros that I have never used, hence the all-important "as far as I know":

    Quote Originally Posted by blackbelt_jones
    When we get into those "best newbie distro" discussions, my fierce advocacy for Debian has always been based on the fact that Debian is the only distro I know that comes (with a net install) all loaded up and ready for apt-getting packages right from the get-go.
    By the way... Gentoo? Arch Linux? Yeah, those are GREAT newbie distros!

    3. RPM based distros also come with their own source lists that are seldom changed, or need to
    Perhaps that's true of the better known RPM-based distros, but I know that are at least a few obscure exceptions. Like SuSE and RHEL.

    Anyway, the point of this thread is to even all this out in as many cases as possible. Here is where we can assemble the easy to use (but all too often hard to find) knowledge in one place. I'm convinced that a lot of geeks just don't understand how difficult finding practical linux information on Google can be for the newbie nongeek. If I know how to edit the /etc/apt/sources.lst file in Ubuntu, then the fact that debian comes with the list already edited doesn't matter as much. Not to dis debian at all, (heaven forfend!) but if it's about the five minues worth of work and not about the frustrating search for answers, this is actually a pretty dumb reason to pick a distro.

    To put another way, NOBODY is going to tell me that I didn't try and fret and struggle to find out how to use apt in Ubuntu, before I finally stumbled upon the answer. Maybe that's because I'm stupid-- but no matter how stupid you think I am, I'd like to see what I can do to make it easier for the next idiot who comes along.
    Last edited by blackbelt_jones; 10-07-2005 at 03:53 PM.

  8. #8
    Join Date
    Mar 2005
    Location
    UK
    Posts
    80
    I started with Mandrake...
    But after being told about Debian, I havent gone back!
    I love the way it updates EVERYTHING. Apart from stable to unstable, which for me, ended up as a disastrous display of errors, needing a re-install of stable from scratch.

    I still love apt-get though. Anyone seen the tee-shirt with "apt-get install life" on it?
    NotJustANewbie
    ------------------
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe." - Albert Einstein

  9. #9
    Join Date
    Apr 2004
    Location
    Athens, Greece
    Posts
    606
    don't use apt-get upgrade. It is known to break things. Use apt-get dist-uppgrade instead
    ---------------------------------------------------------------
    Linux user #355624 Debian Linux
    Latitude D810 --Pentium M 1.86Ghz , 1GB DDR II PC-4300. X600 ,15.4". SATA 60GB
    Home ssh / ftp server P 4 @ 2.8Ghz , 225gb 3 x maxtors
    =====www.kanotix.com=====

  10. #10
    Join Date
    Apr 2001
    Location
    SF Bay Area, CA
    Posts
    14,936
    Quote Originally Posted by DimGR
    Use apt-get dist-uppgrade instead
    Which uninstalls packages on you, when upgrading others.

    Or at least, it uninstalls ten tons of packages on one system I run (originally a Knoppix hdinstall, but I changed the sources.list to point only to Debian repositories) every time the C compiler tries to upgrade. It seems to have something to do with the way that gcc and cpp's versions have to match, and the fact that the versions I have are from unstable (the default repository is testing). Trying to dist-upgrade gcc will uninstall cpp instead of upgrading both of them, and tons of stuff depends on cpp (most X fonts, most of KDE, xawtv, a few Gnome libs, and some other packages I've forgotten now). So all that stuff is either removed, or the dependencies are broken.

    I'm sure there's a better solution than what I came up with (don't dist-upgrade, just upgrade, watch for "these packages have been held back", and try to install each of those packages to figure out why they've been held back), but I don't know what it would be.

    I don't want an upgrade to remove anything (except replaced packages).

  11. #11
    Join Date
    Oct 2002
    Location
    Binghamton NY
    Posts
    2,435
    Quote Originally Posted by DimGR
    don't use apt-get upgrade. It is known to break things. Use apt-get dist-uppgrade instead
    Are you sure? I thought that apt-get dist-upgrade is what you use when you want to move between debian versions... for example, from stable to testing.

    Well, regardless of that, I have to admit that this very thing did happen to me once, when I was running Mepis. After an upgrade, K3b stopped working. I considered it a consequence of the fact that mepis uses the unstable (sid) repositories. I've never know it to happen when running stable Debian-- or anything besides Sid, for that matter... but yes, you're right, it can happen.

  12. #12
    Join Date
    Jul 2002
    Location
    Tallahassee, FL
    Posts
    512
    Are you sure? I thought that apt-get dist-upgrade is what you use when you want to move between debian versions... for example, from stable to testing.
    All dist-upgrade does is turn on "smart" dependency resolution. This will make apt-get remove any deprecated packages rather than just upgrading everything to the latest version.

    It is used for moving between different versions. Like when sarge became stable. But it can also be useful when running testing and unstable, which are moving targets and packages can change depedencies frequently.
    Registered Linux User No. 321,742

    "At Harvard they have this policy where if you pass too many classes they ask you to leave."
    ---Richard M. Stallman

  13. #13
    Join Date
    Oct 2002
    Location
    Republic of Texas
    Posts
    5,898
    In my experience, dist-upgrade is what you DON'T want to do...
    Need help in realtime? Visit us at #linuxnewbie on irc.libera.chat

    Few of us will do as much for our fellow man as he has done.
    --Andrew Morton on RMS

  14. #14
    Join Date
    Apr 2004
    Location
    Athens, Greece
    Posts
    606
    i am talking about Debian Sid
    ---------------------------------------------------------------
    Linux user #355624 Debian Linux
    Latitude D810 --Pentium M 1.86Ghz , 1GB DDR II PC-4300. X600 ,15.4". SATA 60GB
    Home ssh / ftp server P 4 @ 2.8Ghz , 225gb 3 x maxtors
    =====www.kanotix.com=====

  15. #15
    Join Date
    Oct 2002
    Location
    Binghamton NY
    Posts
    2,435

    How to get apt-get for Debian Sarge (stable)

    Okay, back to what I had hoped would be the point of this thread. How to get apt-get with Debian Stable. As I said before, Sarge comes fully set up to apt-get when you install it off the net. That means that the online sources have already been added to the /etc/apt/sources.list file, and the system doesn't need to be updated or upgraded in order to install packages off the net. You're there, man.

    Lately, however, whenever I installed Debian, I would install the basic desktop system using tasksel with the first two debian disks. I would do this to avoid putting more than my share of strain on the debain mirrors. I would then edit the /etc/apt/sources.list to replicate a net install. I would use a text editor to create a file named sources.list which contained the following:

    deb http://debian.uchicago.edu/debian/ stable main
    deb-src http://debian.uchicago.edu/debian/ stable main

    deb http://security.debian.org/ stable/updates main

    and I would save the file to the folder: /etc/apt/, overwriting the sources.list file that was already in there, left over for the disk installation.

    Then I would get the system caught up by typing as root:

    apt-get update


    apt-get upgrade
    is customary, but probably not necessary for the stable version, which doesn't change much.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •