45

I've heard that apt has a new fancy colour and progress bar feature, but that I have to manually enable it.

How do I do this?

Seth
  • 58,122
  • a quick add to let users know that you can use this out of the box with no further configuration required. Colours and progress bar enabled by default, just use apt instead of apt-get – Madivad Feb 25 '16 at 23:18

3 Answers3

51

For 14.04 and newer:

Make a file in: /etc/apt/apt.conf.d:

sudoedit /etc/apt/apt.conf.d/99progressbar

Then add these contents:

Dpkg::Progress-Fancy "1";

And save the file.

Then if your umask was not 0027, (i.e. it might also be 0023), then also set this new file's permissions to 644 (i.e. -rw-r--r--) as follows:

$ chmod 644 99progressbar

(Without this permission correction things like Debian's reportbug will stop working.)

Now enjoy apt progress bars in all their glory:

enter image description here

You can use them with these commands for a nice new apt experience:

apt update
apt install
apt upgrade

Run apt by itself for the list of commands. Colors are enabled by default for apt, and do not affect apt-get.

Colors:

You can also tweak the color of the progress bar by adding this as well:

Dpkg::Progress-Fancy::Progress-Bg "%1b[40m"; 

The colors are based on ANSI Color codes, look at this chart as a reference.

Sources:

Jorge Castro
  • 71,754
  • I am still using 13.10 (at least for the next week or two). Is this feature available in 13.10? – OSE Apr 09 '14 at 13:57
  • I am reasonably certain it is not in 13.10. – Jorge Castro Apr 09 '14 at 14:04
  • 8
    Is there any disadvantage to using apt instead of apt-get, etc? – mikeymop Apr 09 '14 at 16:10
  • 1
    That is a bit odd. I get the progress bar on apt-get upgrade, install and remove, but no colors in apt-get update, I have to use apt update. Very odd. – Seth Apr 09 '14 at 17:05
  • 2
    Hm. I'm on 13.10 and after applying this settings i see progress in both apt and apt-get as well as in dpkg. –  Apr 14 '14 at 13:09
  • What about 12.04? I've added a PPA to upgrade to the newest apt, but still can't see the color. – snowhawkyrf Apr 19 '14 at 07:34
  • @snowhawkyrf Depends what PPA you've added. Also, are you using apt-get or just apt? – Seth Apr 21 '14 at 21:41
  • @Seth I've tried the ppa:mvo/apt-src-ftparchive and added the 99progressbar file, now I can see the bar! Thanks. – snowhawkyrf Apr 27 '14 at 11:53
  • @mikeymop no, apt is the more user-friendly version of apt-get. They both offer essentially the same functionality. – xeruf May 11 '18 at 19:57
6

The -o option allows to change the behavior temporarily. I described it here:

It's just not an apt-get default, but also available for apt-get, run it with

-o Dpkg::Progress-Fancy="1"

for example

sudo apt-get -o Dpkg::Progress-Fancy="1" install alpine-pico
Byte Commander
  • 107,489
Ralf
  • 61
5

For default colors

In addition to Jorge Castro's excellent answer, you can add an extra line to the /etc/apt/apt.conf.d/99progressbar file:

Dpkg::Progress-Fancy "1";
APT::Color "1";

This will enable the default colors for apt. I found it by accident while reading the apt man page:

The apt command is meant to be pleasant for end users and does not need to be backward compatible like apt-get(8). Therefore some options are different:

  • The option DPkgPM::Progress-Fancy is enabled.

  • The option APT::Color is enabled.