You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/15.md
+51-17Lines changed: 51 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,19 +35,33 @@ We'll be discussing the "package manager" used by the Debian and Ubuntu distribu
35
35
36
36
The configuration is done with files under the _/etc/apt_ directory, and to see where the packages you install are coming from, use `less` to view _/etc/apt/sources.list.d/ubuntu.sources_ where you'll see entries that specify repository URIs, suites, and components for your specific version:
37
37
38
+
```bash
38
39
Types: deb
39
40
URIs: http://archive.ubuntu.com/ubuntu/
40
41
Suites: noble noble-updates noble-backports
41
42
Components: main restricted universe multiverse
43
+
```
44
+
Debian and other Debian-based distributions still configure it directly on _/etc/apt/sources.list_ as one-liners but the parameters are the same:
45
+
46
+
* Type of package: `deb`
47
+
* URI (source): most commonly a web address to pull the packages from
48
+
* Suite: codename for the version of the distro, i.e., Ubuntu 24.04 is called Noble, 26.04 is Jammy, and so on.
49
+
* Components (the actual repo): what set of packages are you pulling from it, "main" or something extra
50
+
51
+
Example of an `sources.list` line, pulling `deb` packages from the `main` and `non-free-firmware` repositories for Debian 13 (trixie):
52
+
53
+
```bash
54
+
deb http://deb.debian.org/debian trixie main non-free-firmware
55
+
```
42
56
43
57
There's no need to be concerned with the exact syntax of this for now, but what’s fairly common is to want to add extra repositories - and this is what we'll deal with next.
44
58
45
59
## EXTRA REPOSITORIES
46
60
47
-
While there's an amazing amount of software available in the "standard" repositories (more than 3,000 for CentOS and ten times that number for Ubuntu), there are often packages not available - typically for one of two reasons:
61
+
Main repositories contain the core, essential packages required for the operating system to function, including the kernel, basic utilities, and critical libraries. And while there's an amazing amount of software available in the those repositories, there are often packages not available because they are considered _non-essential_. They will typically be categorized in distinct repositories based on:
48
62
49
-
* Stability - CentOS is based on RHEL (Red Hat Enterprise Linux), which is firmly focussed on stability in large commercial server installations, so games and many minor packages are not included
50
-
* Ideology - Ubuntu and Debian have a strong "software freedom" ethic (this refers to freedom, not price), which means that certain packages you may need are unavailable by default
63
+
* Stability: when new packages are first introduced, an `unstable` repo can act as a rolling release stream, whereas the official support is focused more on `stable` repos like `main` - where the packages are well-tested for bugs and conflicts.
64
+
* Ideology: if the software can be offered under a free license ([free as in freedom, not free as in beer](https://www.debian.org/intro/free)) or not; proprietary apps and non-free firmware usually get pushed to separated repositories.
51
65
52
66
So, next you’ll adding an extra repository to your system, and install software from it.
53
67
@@ -65,9 +79,7 @@ Instead, filter out just the packages names using `grep`, and count them using:
65
79
66
80
These are all the packages you could now install. Sometimes there are extra packages available if you enable extra repositories. Most Linux distros have a similar concept, but in Ubuntu, often the "Universe" and "Multiverse" repositories are disabled by default. These are hosted at Ubuntu, but with less support, and Multiverse: _"contains software which has been classified as non-free ...may not include security updates"_. Examples of useful tools in Multiverse might include the compression utilities `rar` and `lha`, and the network performance tool `netperf`.
67
81
68
-
To enable the "Multiverse" repository, follow the guide at:
69
-
70
-
*[Community wiki for command line](https://help.ubuntu.com/community/Repositories/CommandLine)
82
+
To enable the "Multiverse" repository, you can follow the [ubuntu community guide](https://help.ubuntu.com/community/Repositories/CommandLine), but you will basically just _add a register for that repo_ in your apt source file.
71
83
72
84
After adding this, update your local cache of available applications:
73
85
@@ -92,26 +104,48 @@ netperf:
92
104
93
105
## ADDING OTHER REPOSITORIES
94
106
95
-
Ubuntu also allows users to register an account and setup software in a Personal Package Archive (PPA) - typically these are setup by enthusiastic developers, and allow you to install the latest "cutting edge" software.
107
+
Software can still be provided in `deb` package format and not be available in any of the official sources, i.e., it doesn't come from Debian or Ubuntu servers. In those cases, two things are possible:
96
108
97
-
As an example, install and run the `neofetch` utility. When run, this prints out a summary of your configuration and hardware.
98
-
This is in the standard repositories, and `neofetch --version` will show the version. If for some reason you wanted to have a later version you could install a developer's Neofetch PPA to your software sources by:
109
+
* Only the `deb` package is provided, and you have to install it manually with `dpkg` (see below)
110
+
* The developer company provided a repository source and its [GPG signature key](https://askubuntu.com/a/179237) so you can add a register like this:
As always, after adding a repository, update your local cache of available applications:
121
+
Normally you will have instructions on how to download and verify the GPG signature (or just a script to do it for you). Again, use common sense and only download from respectable sources.
103
122
104
-
`sudo apt update`
123
+
On another note, [PPAs](https://askubuntu.com/questions/4983/what-are-ppas-and-how-do-i-use-them) (Personal Package Archives) used to be an alternative way to get extra packages that didn't make into official repos but became obsolete after the adoption of modern app stores like Snap and Flatpak.
124
+
125
+
## APT AND DPKG
126
+
127
+
So you downloaded a `.deb` file and you want to install it. Can I use `apt` to handle it?
The `apt` (Advanced Package Tool) is a high-level package manager that resolves dependencies, while `dpkg` (Debian Package) is a low-level tool that directly handles `.deb` files.
132
+
133
+
So, you can manually install a `deb` package with either of those options:
134
+
135
+
```bash
136
+
dpkg -i /path/to/package/name.deb
137
+
apt install /path/to/package/name.deb
138
+
```
105
139
106
-
Then install the package with:
140
+
## PACKAGES OUTSIDE THE DEBIAN/UBUNTU ECOSYSTEM
107
141
108
-
`sudo apt install neofetch`
142
+
But what if the application I want to use is not available for Debian/Ubuntu?
109
143
110
-
Check with `neofetch --version`to see what version you have now.
144
+
You still have a chance! Check if that app is available in **Snap** or **Flatpak**. Those formats are universal and cross-distribution, and each package has its dependencies self-contained. You will have to install Snap to be able to download from the [Snap Store](https://snapcraft.io/store) (centralized, developed by Canonical), or install Flatpak to pull packages from places like [FlatHub](https://flathub.org/) (decentralized, community-maintained ecosystem).
111
145
112
-
Check with `apt-cache show neofetch` to see the details of the package.
146
+
In any case, if the software you are installing is open source, you will most likely have the option to [install it from source](./17.md) as well.
113
147
114
-
When you next run "sudo apt upgrade" you'll likely be prompted to install a new version of `neofetch` - because the developers are sometimes literally making changes every day. (And if it's not obvious, when the developers have a bad day your software will stop working until they make a fix - that's the real "cutting edge"!)
148
+
DISCLAIMER: use a native package or build from source when you can. The self-contained apps from apps stores tend to generate performance and resource overhead.
0 commit comments