175 points · by JelteF · 10y ago · 74 comments
"The primary command line tool is aptitude. apt-get fulfills a similar purpose and although it is no longer the recommended primary tool some still use it."
If you prefer the apt-* commands: "You can also use Wajig, for an unified and more logical command-line interface to all package management functions." (Apparently, apt is the new Wajig, except that apt doesn't automagically sudo, which Wajig did.)
"The upgrade process for some previous releases recommended the use of aptitude for the upgrade. This tool is not recommended for upgrades from wheezy to jessie."
See https://www.debian.org/releases/stable/amd64/release-notes/c...
In contrast, pacman or guix are quite intuitive and feel better designed.
apt-cache search -n <regexp>
More generally apt-get and apt-cache are designed to be backward-compatible for use in scripts whereas apt is not[0]: SCRIPT USAGE AND DIFFERENCES FROM OTHER APT TOOLS
The apt(8) commandline is designed as an end-user tool and it may change behavior between versions. While it tries not to break backward compatibility this is not guaranteed either if a change seems beneficial for interactive use.
[0] http://manpages.ubuntu.com/manpages/xenial/en/man8/apt.8.htm... $ time ls -R /usr
real 0m7.570s
user 0m0.104s
sys 0m2.286s
$ time ls -R /usr > /dev/null
real 0m0.193s
user 0m0.036s
sys 0m0.154s
(edit: when will I grok HN markup?? cough support markdown cough) # all the below run in the same MATE desktop
# lxterm (from lxde - is easiest on my eye)
$ time ls -R /usr
real 0m19.974s
user 0m0.860s
sys 0m0.832s
# gnome terminal
$ time ls -R /usr
real 0m19.902s
user 0m0.800s
sys 0m0.776s
# xterm (yes, it really is 10x the speed)
$ time ls -R /usr
real 0m1.872s
user 0m0.856s
sys 0m0.800s
# rerun in the first terminal, and the time hasn't changed - still 19s
# now in lxterm redirecting to null
# (and xterm gives similar results here)
$ time ls -R /usr > /dev/null
real 0m0.418s
user 0m0.256s
sys 0m0.156s
All that prettification and rendering takes time; if you want raw speed, use xterm... or pipe output to /dev/null.Interestingly, 'time' on gterm and lxterm had tabs between the above field:value pairs (I had to reformat to show them nicely), but xterm used spaces. I don't know enough about the terminal underpinnings to guess as to why.
Whereas a status indicator isn't exactly pushing much data to the terminal. So, It shouldn't impact run time.
I switched to debian some time ago and it's interesting so many different commands are used for package management, this said I personally have an alias ap=sudo aptitude -t jessie-backports alias and use that as a command line interface for search/install, and run the full aptitude gui only when doing updates
https://pypi.python.org/pypi/apt-wrapper/
No prog bar but it handles all common tasks, ppa's, and elevates with sudo automatically. For example:
> pip install apt-wrapper
> apt in foobar apt-get -y update
apt-get -y upgrade
apt-get -y dist-upgrade
apt-get -y autoremove
I run that everyday.You can also set the update to happen automatically so that all you have to do is run upgrade.
> You can also set the update to happen automatically so that all you have to do is run upgrade.
I'm in "testing". Sometimes, even with "-y", I'm asked to validate some messages (often inside a vi prompt).
http://askubuntu.com/questions/3167/what-is-difference-betwe...
It cleans out unnecessary packages.
All the update does is download the latest available updates so it should not be prompting. My experience is that only upgrade/dist-upgrade will prompt.
I've got a VM running ubuntu 16.04-beta and it seems to be fine.
aptitude -y safe-upgrade
...which is less likely to break things. Every month or so I go into aptitude to manually sort things out that have gotten their dependencies wedged.Interesting. My use of aptitude is limited to "search" so far.
Did you see that?
Source: my previous life.
I tried it a bit but it's very (very) unstable :-)
I come from Fedora and have few months only on debian. Still a rookie.
Any terminal settings I need to adjust? I'm using OS X's Terminal.app, terminal declared as xterm-256color, via SSH, under zsh.