Package Managers
For information on various package managers -
Pacman
First, you should check to verify your pacman-mirrors
are configured to the nearest location. Do this manually by editing /etc/pacman.d/mirrorlist
, or run sudo pacman-mirrors -g
-
[kapper@kanjaro ~ ]$ sudo pacman-mirrors -g
INFO Downloading mirrors from repo.manjaro.org
::INFO User generated mirror list
::------------------------------------------------------------
::INFO Custom mirror file saved: /var/lib/pacman-mirrors/custom-mirrors.json
::INFO Using default mirror file
::INFO Querying mirrors - This may take some time
0.772 United_States : https://repo.ialab.dsu.edu/manjaro/
0.756 United_States : http://repo.ialab.dsu.edu/manjaro/
::INFO Writing mirror list
::United_States : https://repo.ialab.dsu.edu/manjaro/testing
::INFO Mirror list generated and saved to: /etc/pacman.d/mirrorlist
Now, you should have much faster download speeds when updating or grabbing packages.
To install a package, run sudo packman -Syu <package>
. For example, to install htop
, run sudo pacman -Syu htop
. This will not only install htop
, but first it will check that your package list and installed packages are up to date to ensure you get the latest version.
If you are used to the apt
package manager, this is basically like running sudo apt update && sudo apt upgrade
, pacman
can run these updates alongside every new package installation with the -Syu
parameters.
Partial Upgrade Cleanup
Sometimes a run of pacman -Syu
will complete normally, but later you may notice that certain packages were either upgraded incorrectly or not upgraded at all. One reason this may happen is a hiccup in PGP key validation by pacman during the upgrade. The commands below may help in fixing such a problem -
# Refresh all PGP keys installed on the system
sudo pacman-key --refresh-keys
# Reinstall all packages on the system
sudo pacman -Qqn | sudo pacman -S
These two commands will either print errors providing further information on the broken packages or complete and fix the broken packages. After running, you may need to reboot.
AUR Packages
AUR = arch user repository
Sometimes a package may exist within the community but not in any official repository. To manage these, we have AUR helpers.
This list of AUR helpers, AKA community / AUR packages, is useful in selecting the best tool to suit your needs.
Using yay, some basic commands are seen below -
# Search foreign package db for package
yay -q pycharm
# Will prompt for install with list of results and descriptions
# To upgrade yay alongside pacman, run the following
yay -S yay-bin
sudo pacman -Syu
yay -S yay
After installation, the /opt/<PackageName>
will contain the new files created for the installed package.
Apt
The apt package manager is fairly straightforward to work with in terms of its usage and help text, so I'll leave the basics up to apt -h
-
apt 1.6.12 (amd64)
Usage: apt [options] command
apt is a commandline package manager and provides commands for
searching and managing as well as querying information about packages.
It provides the same functionality as the specialized APT tools,
like apt-get and apt-cache, but enables options more suitable for
interactive use by default.
Most used commands:
list - list packages based on package names
search - search in package descriptions
show - show package details
install - install packages
remove - remove packages
autoremove - Remove automatically all unused packages
update - update list of available packages
upgrade - upgrade the system by installing/upgrading packages
full-upgrade - upgrade the system by removing/installing/upgrading packages
edit-sources - edit the source information file
See apt(8) for more information about the available commands.
Configuration options and syntax is detailed in apt.conf(5).
Information about how to configure sources can be found in sources.list(5).
Package and version choices can be expressed via apt_preferences(5).
Security details are available in apt-secure(8).
This APT has Super Cow Powers.
If any of the above confuses you, see man apt
For most, the default repositories that come with ubuntu or the distro of your choice would be enough, but some may choose to add more trusted sources who may have packages or drivers that would otherwise be unsupported. These sources are gneerally stored in /etc/apt/sources.list.d/
and we'll see how to back them up later.
Managing adding and removing ppas to your sources is seen below
# Add ppa
sudo add-apt-repository -y ppa:user/ppa
# Remove ppa
sudo add-apt-repository -r ppa:user/ppa
If you want to remove a ppa and all its related packages to ensure you don't create a conflic between dependencies, run the below commands
# Remove a ppa and its associated software
sudo ppa-purge user/ppa
# Alternatively we can use -o and -p to specify owner and ppa respectively
sudo ppa-purge -o user -p ppa
To backup all current sources
To restore a backup of previous sources
Mess something up or lose your sources.list
? See below for the default settings on various ubuntu releases
Ubuntu bionic 18.04
#deb cdrom:[Ubuntu 18.04 _Bionic_ - Build amd64 LIVE Binary 20190418-12:10]/ bionic main
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic universe
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner
deb http://security.ubuntu.com/ubuntu bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse
Ubuntu Focal Fossa 20.04
Following a sudo do-release-upgrade -d -f DistUpgradeViewGtk3
on Ubuntu 18.04 with the option Prompy=lts set within /etc/update-manager/release-upgrades
the sources are the following
# deb cdrom:[Ubuntu 18.04 _Bionic_ - Build amd64 LIVE Binary 20190418-12:10]/ bionic main
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ focal main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ focal-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ focal universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic universe
deb http://us.archive.ubuntu.com/ubuntu/ focal-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ focal multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://us.archive.ubuntu.com/ubuntu/ focal-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu focal partner
# deb-src http://archive.canonical.com/ubuntu bionic partner
deb http://security.ubuntu.com/ubuntu focal-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://security.ubuntu.com/ubuntu focal-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu focal-security multiverse
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse