Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Aptly: Manage packages from the command line

    Reply
    aspidites | # 1 | 2009-12-26, 04:13 | Report

    And yes, the pun was intended.

    I got tired of having to use separate tools to manage my packages. As it stood before, I had to use apt-get to install and remove remote packages, apt-cache to search for and gather information about packages, and dpkg to install local packages (after of course making sure the dependencies were installed with apt-get).

    Since then, I've written a python script called aptly to allow me to take advantage of the most frequently options of the above tools. As an added bonus, aptly allows me to combine some of the above tools in one command without the use of "&&", grep, etc.

    Here are the current features:
    • Install local deb files with automatic dependency resolution
    • Install local and remote packages from the same command:
      Code:
      aptly --i remote_package local_deb
    • Get information about multiple packages at once
    • Quickly update and upgrade installed packages:
      Code:
      aptly -uU
    • Install multiple files simultaneously:
      Code:
      aptly -i pkg1 pkg2 pkg3
      or sequentially:
      Code:
      aptly -i pkg1 i- pkg2
    While I find this script helpful, I'm not sure if anyone else is interested, which is why I haven't built an official package yet. To try it out, download the *tar.gz archive and run:
    Code:
    tar -xvzf aptly-[version number].tar.gz
    cd ./aptly
    python ./apty --hep
    If you are tired of having to type "python", then you should give aptly executable permissions (as root):
    Code:
    chmod +x ./aptly
    Then you can just:
    Code:
    ./aptly --help
    BTW, the original development topic can be found here. I posted there originally because it was originally just a proof of concept and I hadn't expected to put as much effort into it as I have :-) (which albeit, still wasn't much)

    Edit | Forward | Quote | Quick Reply | Thanks
    Attached Files
    File Type: gz aptly-2009-12-28.1.tar.gz (15.1 KB, 120 views)

    Last edited by aspidites; 2009-12-30 at 07:29.
    The Following 6 Users Say Thank You to aspidites For This Useful Post:
    codeMonkey, iKneaDough, linuxeventually, NuMetal, pelago, qole

     
    codeMonkey | # 2 | 2009-12-26, 08:38 | Report

    Does it do any intelligent management of space? I know that if you're not careful with massive lists of things you want to install the cached files alone can fill up the rootfs.
    Does aptly download deb files the same way as apt-get or handle it itself - e.g. downloading to ~ ?
    And I'm assuming afterwards it'll remove the cached files? (especially if it downloads to the rootfs).

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to codeMonkey For This Useful Post:
    qole

     
    NuMetal | # 3 | 2009-12-26, 10:10 | Report

    Thanks for the tool!
    For me only unzip works with
    Code:
    tar -xvzf aptly-[VERSION].tar.gz

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to NuMetal For This Useful Post:
    aspidites

     
    aspidites | # 4 | 2009-12-26, 17:45 | Report

    codeMonkey, aptly wraps apt-get so there is no smart memory management. i will play with the idea and see what i can come up with. more than likely i will add an option to specify how full root should be before caching files in home.

    NuMetal, thanks. updated OP.

    update
    The only way I can think of to determine how much space in root a package will take up is to download the deb into ~/, run dpkg on it to get its file contents, then calculate the size of all files that would be installed into /. As such, I've decided to just add an option to allow you to choose where to save package files, optionally deleting them afterwards.

    When I have time, I'll add a config file so that you can have sane defaults for these kinds of things.

    update 2
    I implemented installing to a different cache. Details in the dev form about how much of a pain it has been, lol. Will release on next version. Is anyone actually using this thing?

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by aspidites; 2009-12-27 at 04:50.
    The Following 2 Users Say Thank You to aspidites For This Useful Post:
    Netweaver, qole

     
    aspidites | # 5 | 2009-12-28, 10:28 | Report

    I finally finished implementing custom cache directories (and it now plays nicely with other commands ;-)). This is also the first version to actually have a config file. I'll update the OP with the new package.

    Also, I think I'll start a garage page for this thing. Even if it isn't used by anyone else, it will be handy for me to have version control and a backup just in case something happens to my N900 or computer.

    BTW, while packages aren't removed automatically (to keep the cache clean, it is trivial add the option:
    Code:
    aptly -ic pkg1 pkg2...
    Or, if you are low on space in root...
    Code:
    aptly -Cic pkg1 pkg2...

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by aspidites; 2009-12-28 at 10:31.
    The Following User Says Thank You to aspidites For This Useful Post:
    qole

     
    aspidites | # 6 | 2010-01-02, 06:55 | Report

    Not only is a working versin of aptly now in aptly; but I have added a configuration option that allows you to have aptly automatically clean your cache directories every time it is run.

    Also, aptly is smart enough to ask you if you want to update before upgrading.

    Next I will be adding the ability to install packages based on selections from search results.

    Please give aptly a shot and tell me if anything is broken or missing, thamks.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to aspidites For This Useful Post:
    qole

     
    springah | # 7 | 2010-01-02, 07:09 | Report

    dude, awesome, keep it up

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to springah For This Useful Post:
    aspidites

     
    aspidites | # 8 | 2010-01-04, 03:03 | Report

    Work continues on Aptly. I was gonna wait until my day off to do any hacking, but I got inspired. This iteration removes a couple of module dependencies and adds numbered search results. It's not quite ready for prime time, as I still have to re-factor more code and colorize (yes, I found a way to do so that is faster than my prior attempts) output!.

    In lieu of a new package version, here is a screenshot:

    The above was generated by issuing the following:
    Code:
    aptly -s emulator

    Edit | Forward | Quote | Quick Reply | Thanks

     
vBulletin® Version 3.8.8
Normal Logout