Some Computer Hints

Ubuntu Software Management

Updating And Upgrading

To make updates from repositories run:

# apt update        ## update the package lists for upgrade
# apt upgrade       ## upgrade packages
# apt dist-upgrade  ## upgrade the kernel also

I generally use the following alias to manually check and install updates and remove old and unneeded packages:

alias upd='apt autoclean && apt autoremove && apt update \
 && apt dist-upgrade && cat /run/reboot-required* 2>/dev/null'

If there any errors during apt update, then run the following once:

# apt update -o Acquire::CompressionTypes::Order::=gz

To install a new package:

# apt install package-name

To just make a simulation run (without installing anything):

$ apt -s install package-name

To configure all (possibly) yet not configured packages:

# dpkg --configure -a

To list installed packages enter:

$ apt --installed list

To remove a package and for clean up use:

# apt remove --purge package-name
# apt autoremove
# apt autoclean

To remove residual configurations from old package releases:

# apt purge $(dpkg -l | grep '^rc ' | awk '{print $2}')

To upgrade to new Ubuntu release:

# do-release-upgrade

To list Ubuntu server components or tasks (a group of packages that will add a server functionality):

$ tasksel --list-tasks

To install a server task:

# tasksel install server-task

Note that tasksel is not installed by default.

Getting Information

To list files contained in an installed package:

$ dpkg -L package-name
$ dpkg-query -L package-name

To list files contained in a package that is not yet installed in your local system:

$ apt-file list package-name

To find out the name of the installed package that provides a file:

$ dpkg -S file-path

To find out the name of a package that is not yet installed in your local system and provides a file:

$ apt-file -F search file-path

Note: Remove -F to search for partial matches of file-path:

$ apt-file search partial-file-path

As a more complicated example; to see the installed version of the package providing a command (e.g. the GET command):

$ type GET                ## find the full path of the command
GET is hashed (/usr/bin/GET)
$ dpkg -S /usr/bin/GET    ## find the related package name
libwww-perl: /usr/bin/GET
$ dpkg -l libwww-perl     ## find the package version and description
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
ii  libwww-perl    6.67-1       all          simple and consistent interface to the world-wide web

Firmware Operations

For firmware updates; use

$ fwupdmgr get-devices

to get a list of updateable devices on your system, as supported by the Linux Vendor Firmware Service (LVFS);

$ fwupdmgr get-updates

to get a list of all available firmware updates; and

# fwupdmgr update

to update all firmware to latest versions available.