For those who aren’t aware of it, Ubuntu 14.04.3 already has a partially unified apt package. This is a welcome change to simplify the apt family of commands.

For example, the following command works:

$ sudo apt install leafpad

Other simplified commands:

$ apt install package(s) -> replaces apt-get install package $ apt remove package(s) -> replaces apt-get remove package $ apt search query -> replaces apt-cache search query $ apt show package(s) -> replaces apt-cache show package(s) $ apt update -> replaces apt-get update $ apt upgrade -> replaces apt-get upgrade $ apt list –installed -> replaces dpkg –get-selections | grep -v deinstall -> replaces dpkg -l $ apt list –upgradable (sudo not required) -> replaces apt-get -u upgrade –assume-no (sudo required) $ apt edit-sources -> replaces echo 'text' | sudo tee -a /etc/apt/sources.list -> replaces sudo nano /etc/apt/sources.list

However, the process is not complete. Options like autoremove doesn’t work yet.

The good news is, Linux Mint has been working on some python wrapper scripts to make this happen. The following work at the time of writing:

$ apt autoclean -> replaces apt-get install package $ apt autoremove -> replaces apt-get remove package $ apt purge package(s) -> replaces apt-get remove –purge package(s) $ apt depends package(s) -> replaces apt-cache depends package(s) $ apt rdepends package(s) -> replaces apt-rdepends package(s) $ apt policy package(s) -> replaces apt-cache policy package(s) $ apt held -> replaces dpkg –get-selections | grep hold $ apt hold package -> replaces echo package hold | sudo dpkg –set-selections $ apt unhold package -> replaces echo package install | sudo dpkg –set-selections $ apt download package (downloads the deb file of a package) -> replaces LC_ALL=C apt-cache depends package |grep -v “Conflicts:\|Replaces:”|awk ‘{print $NF}’|sed -e ‘s/[<>]//g’|xargs aptitude download -r

The scripts work great on Mint and we tried them out on Ubuntu. To get the scripts, run:

$ wget https://raw.githubusercontent.com/linuxmint/mintsystem/master/usr/local/bin/apt $ chmod +x apt $ sudo mv apt /usr/local/bin/aptr $ wget https://github.com/linuxmint/mintsystem/raw/master/usr/local/bin/highlight $ chmod +x highlight $ sudo mv highlight /usr/local/bin/

Note that we changed the file name to aptr to avoid conflicts.

Some options depend internally on aptitude or Mint package source specific files. For example:

$ aptr search leafpad sh: 1: aptitude: not found

However, most of the regular options work with this script.

Update

apt 1.1 comes with many unification features. Ubuntu 15.10 and 16.04 users can install it using:

$ sudo add-apt-repository ppa:deity/sid $ sudo apt-get update $ sudo apt-get install apt