Announcement

Collapse
No announcement yet.

apt vs apt-get

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • NoWorries
    replied
    After testing the apt options on Xenial, I have decided to just use:
    Code:
    sudo apt update; sudo apt full-upgrade
    I am surprised that in the development of the apt full-upgrade code, the listing of the packages by this command doesn't use the same code used in the apt list --upgradable command for listing the installed packages.

    I guess that one day "the penny will drop" and the developers will add this feature.
    Last edited by NoWorries; Dec 03, 2015, 02:21 AM.

    Leave a comment:


  • NoWorries
    replied
    Originally posted by oshunluvr View Post
    Yeah, I use apt-get for autoremove (alias "aremove").

    Re. the -y switch, I wasn't thinking about your actual request - I wrongly assumed you wanted no prompt, when you're asking for no output. I can't say for apt (haven't tested) but for apt-get, you can use -qq for error output only or -q for no output at all.

    Since you're using an alias anyway - no reason not to use apt-get with the -qq switch if it doesn't work with apt. The only benefit to using apt in this instance is color output, which you want to suppress anyway. So your new alias should be:

    sudo apt update; sudo apt list --upgradable; sudo apt-get -qq dist-upgrade
    I found that using the -qq switch removed the prompt. This is what happens as described in the man for apt-get
    -q, --quiet
    Quiet; produces output suitable for logging, omitting progress indicators. More q's will produce more quiet up to a maximum of 2. You can also use
    -q=# to set the quiet level, overriding the configuration file. Note that quiet level 2 implies -y; you should never use -qq without a no-action
    modifier such as -d, --print-uris or -s as APT may decide to do something you did not expect. Configuration Item: quiet.
    By using a single -q, I still get the install packages listed.

    It is nice to get the apt green listing of packages to be installed, but I find it unnecessary to have this repeated by either apt or apt-get. So I will remove the apt list --upgradable and just have either the apt or apt-get commands to do the upgrade.

    To test this out, I need updates which, unfortunately are rare with Wily, but mountainous with Xenial and a dribble with Vivid. Will let you know what I decide. Basically I do not need to be told twice what packages are going to be installed.

    Leave a comment:


  • oshunluvr
    replied
    Yeah, I use apt-get for autoremove (alias "aremove").

    Re. the -y switch, I wasn't thinking about your actual request - I wrongly assumed you wanted no prompt, when you're asking for no output. I can't say for apt (haven't tested) but for apt-get, you can use -qq for error output only or -q for no output at all.

    Since you're using an alias anyway - no reason not to use apt-get with the -qq switch if it doesn't work with apt. The only benefit to using apt in this instance is color output, which you want to suppress anyway. So your new alias should be:

    sudo apt update; sudo apt list --upgradable; sudo apt-get -qq dist-upgrade

    Leave a comment:


  • NoWorries
    replied
    Originally posted by oshunluvr View Post
    I believe the -y switch will work. Try:

    ...; sudo apt -y full-upgrade
    When I use the -y switch it still re-lists the packages and then proceeds to do the full-upgrade without approval.

    As I was running out of systems to test the apt command on, I used a Trusty system which had a new kernel update. I then could not find an autoremove equivalent for apt. I don't think it is viable to do a remove for each package listed

    Leave a comment:


  • oshunluvr
    replied
    I believe the -y switch will work. Try:

    ...; sudo apt -y full-upgrade

    Leave a comment:


  • NoWorries
    replied
    Originally posted by oshunluvr View Post
    The "--upgradeable" option is used with "sudo apt list" and only lists the upgrade-able files. It takes no other action. It's useful if you wish to see what will be upgraded by apt or apt-get prior to running upgrade.

    Also worth noting: while "dist-upgrade" is not technically listed as an option for apt, it does appear to work. This seems to be undocumented. "full-upgrade" is the correct option for apt as listed by man or help.
    Thanks for that, as I now get a progress line which is very handy in the case of Kubuntu 16.04 which this morning had 93 upgrades and 5 new packages. My command line is now:
    Code:
    sudo apt update; sudo apt list --upgradable; sudo apt full-upgrade
    The only visual problem remaining is that the full-upgrade also lists all the packages in the old format before the approval request. I suspect that there is an option which would not show this list. Any suggestions would be greatly appreciated.

    Leave a comment:


  • oshunluvr
    replied
    The "--upgradeable" option is used with "sudo apt list" and only lists the upgrade-able files. It takes no other action. It's useful if you wish to see what will be upgraded by apt or apt-get prior to running upgrade.

    Also worth noting: while "dist-upgrade" is not technically listed as an option for apt, it does appear to work. This seems to be undocumented. "full-upgrade" is the correct option for apt as listed by man or help.

    Leave a comment:


  • NoWorries
    replied
    I tend to use Konsole and just up-arrow to the line with the apt-get command as that is about the only command that I use with Konsole. On those occasions when I do other commands, it doesn't take long to get to the update line.

    I must say that I do like the output from the apt command but I always approve the packages for upgrade and there don't use the --upgradable option. What I now use is:
    Code:
    sudo apt update; sudo apt dist-upgrade

    Leave a comment:


  • heinkel_111
    replied
    While I am carefully calculating saved costs for keyboard replacement as a function of the number of times -getcan be avoided in the future, I would like to say that this is pretty much a hackers' improvement as most everyday package management can be accomplished via graphical frontends these days. Having said that I have still not really started to use that on a routine basis, as I find apt-get quite handy. I mean, it is not much I have to do, only sudo apt-get update and sudo apt-get upgrade on a regular basis, spiced with a few intermittent dist-upgrades.
    That is all I need to do as long as I stick to using software from the standard kubuntu repositiories because that software is almost always so nicely packaged that nothing more is needed. For which work I am very thankful, I'd like to add! <3
    All the rest is stuff you only need when you are tempted to meddle with the latest fanciest stuff from development versions in some ppa or even worse, downloaded off the net or something. You probably read on some forum how to do it, and then it got you into trouble so you need more powerful spells to get out of it.
    So just a word of warning in case any beginners read this: nah, these days you don't have to make life difficult for yourselves as long as you wait a little for those who make life easy for you...that fancy package may be standard in the next version or so.

    :-)

    sorry for screwing up with the fonts, still struggling to find the code in "advanced mode" editor here. There is no default font option and I don't recognize any but a few font names
    Last edited by heinkel_111; Nov 30, 2015, 02:14 PM. Reason: didn't look good!

    Leave a comment:


  • vsreeser
    replied
    Originally posted by oshunluvr View Post
    I do the same, except using "install" can get you into trouble as it's a linux command. I use "instal" (single el).

    I use alias update='sudo apt update; sudo apt list --upgradable' for update. The sceond command outputs a list of upgradeable files or states that you are up to date.
    I like the --upgradable Using this could let me know if I really need to do an update right now, or just wait. I'm paranoid. make an image of partition or drive before major updates. Only takes 10 minutes or so. about 10 to restore as well using clonezilla

    Leave a comment:


  • oshunluvr
    replied
    Originally posted by vsreeser View Post
    True. use them to skip typing. e.g. install='sudo apt-get install'
    guess I could just remove the -get
    I do the same, except using "install" can get you into trouble as it's a linux command. I use "instal" (single el).

    I use alias update='sudo apt update; sudo apt list --upgradable' for update. The sceond command outputs a list of upgradeable files or states that you are up to date.

    Leave a comment:


  • vsreeser
    replied
    Originally posted by claydoh View Post
    Naw, aliases are still good to have - I have one called upd8, which does an update and a full-upgrade. I be lazee
    True. use them to skip typing. e.g. install='sudo apt-get install'
    guess I could just remove the -get

    Leave a comment:


  • claydoh
    replied
    Naw, aliases are still good to have - I have one called upd8, which does an update and a full-upgrade. I be lazee

    Leave a comment:


  • Qqmike
    replied
    Ha! The work has been done, huh?

    Leave a comment:


  • vsreeser
    replied
    Looks like I won't need all those aliases I created to simplify anymore

    Leave a comment:

Users Viewing This Topic

Collapse

There are 0 users viewing this topic.

Working...
X