Apt : Using it to install packages

Moderator: Forum moderators

Post Reply
User avatar
mikeslr
Posts: 2793
Joined: Mon Jul 13, 2020 11:08 pm
Has thanked: 173 times
Been thanked: 837 times

Apt : Using it to install packages

Post by mikeslr »

Several of our new Puppys now include (may depend on) the apt package manager. Bigpup has provided a list of commands that can be used with apt under Bookwormpup64. https://www.forum.puppylinux.com/viewtopic.php?t=8805

AFAIK, those should also apply to other Puppys where apt is available. Please correct the above assumption if I'm wrong. But it seemed logical to me that information about Apt should be found in one location rather than scattered throughout the Forum on threads pertaining to different Puppys.

Please use this thread to add other information about apt. For example, dimkr here, https://www.forum.puppylinux.com/viewto ... 857#p94857 has provided this link, https://deb-multimedia.org/ which provides instructions about how to enable apt to access a different repository.

@peebee : VoidPuppys' native package manager is vpm. But they also will, at least to some extent, respond to VoidLinux native command xpm. See, viewtopic.php?p=48576#p48576. While obviously the commands 'apt', 'vpm' and 'xpm' are different I wondered to what extent the arguments those commands took were identical. Perhaps those arguments could be noted here; or if significantly different a post such as bigpup's could be provided on the Voidpup's SubForum. Alternatively, if wiak or rockedge has already provided such a guide on the KLV-Airdale SubForum, a link to it could be had.

radky
Posts: 296
Joined: Fri May 28, 2021 2:14 am
Has thanked: 35 times
Been thanked: 262 times

Re: Apt : Using it to install packages

Post by radky »

Bookworm Pup64

Menu -> Help -> HOWTO use the APT Package Manager

User avatar
mikeslr
Posts: 2793
Joined: Mon Jul 13, 2020 11:08 pm
Has thanked: 173 times
Been thanked: 837 times

Re: Apt : Using it to install packages

Post by mikeslr »

Radky, what a brilliant idea, :thumbup: Help being more than just a Menu decoration.

Of course, it's of little use to those of us known to drive about aimlessly until the setting Sun provides a clue to orientation. :roll:

User avatar
mikeslr
Posts: 2793
Joined: Mon Jul 13, 2020 11:08 pm
Has thanked: 173 times
Been thanked: 837 times

Re: Apt : Using it to install packages

Post by mikeslr »

Radky's work is well thought out. But :( is not a complete explosition about Apt under Puppys. Puppys are not the distro they are woofed from. As this discourse reveals, it may sometimes be necessary close synaptic in order for Apt to accomplish your objective, https://www.forum.puppylinux.com/viewto ... 912#p94912 and the following 5 +/- posts.

This tread may yet prove useful for accumulating tips regarding the use of Apt.

User avatar
bigpup
Moderator
Posts: 6272
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 733 times
Been thanked: 1293 times

Re: Apt : Using it to install packages

Post by bigpup »

There are two types of commands in apt package manager.

apt

apt-get

What’s the Difference Between apt and apt-get?

Both apt and apt-get are command line tools. You can use them to manage software packages like applications and libraries.
Debian-based Linux operating systems use the Advanced Package Tool (APT) to manage Linux software packages.
The apt command line tool provides a higher-level user interface for end users with intuitive commands, resulting behaviors, and security features.
In contrast, the command apt-get is a low-level interface that communicates more closely with core Linux processes.
The apt command is a more user-friendly package manager than apt-get.

What are the similarities between apt and apt-get?

Both apt and apt-get are package manager tools for Debian-based Linux distributions (or distros) such as Debian, Ubuntu, Linux Mint, and elementary OS. Similar tools exist, like aptitude and synaptic, although apt-get and apt are the system default.

Next, we describe similarities between apt and apt-get.

Interface

Both the apt command line utility tool and the apt-get command line utility tool are accessible via the Linux command line interface (CLI). To use the Linux CLI, open a terminal window or virtual terminal window.

Documentation

For the official overview of the apt utility and apt-get utility, enter apt or apt-get at the command prompt. This gives you a list of the most common apt commands and apt-get commands.

For example, apt update or apt-get update update the list of available software packages from the official repositories. The apt command and apt-get command also have options listed after them. For example, apt update --quiet provides a less detailed print output of the apt update command to the terminal.

The most common tasks in apt and apt-get are to install, update, and remove software packages. Software packages may be applications, libraries, utilities, and tools.

The following table shows common command syntax between the two.

apt

apt-get

apt install <package_name>
apt remove <package_name>
apt purge <package_name>
apt upgrade <package_name>
apt update

apt-get install <package_name>
apt-get remove <package_name>
apt-get purge <package_name>
apt-get upgrade <package_name>
apt-get update

Key differences: apt vs. apt-get

The difference between apt and apt-get is not just that apt is a newer version of apt-get. The apt command was designed as a more user-friendly alternative to apt-get, combining the functionality of multiple package management tools for user convenience.

Next, we discuss other differences between apt and apt-get.

Release dates

In 1998, apt-get was released with the Debian 2.0 (Hamm) distribution, while apt was released in 2014 with the Debian 8 (Jessie) distribution. After 2014, apt replaced apt-get as the default package manager tool for all Debian-based Linux distros.

Search capabilities

Search for a package by name by using the apt search <package_name> command. This command gives a detailed description of all packages containing the searched package_name. This operation was not possible with apt-get. Instead you had to use the apt-cache command.

Dependency resolution

Any software package typically comes with a list of software dependencies, such as libraries or tools it needs to operate correctly. You have to install all dependencies before you can install the package.

Both apt and apt-get handle dependency resolution, however apt is far superior. It determines complex dependency chains where it installs packages in the correct order and recommends suggested packages to install.

Package versions on the file system

By default, the apt upgrade command removes old versions of installed or upgradeable packages on the system that are no longer needed when upgrading.

In contrast, the apt-get upgrade command does not. This efficiency can make apt upgrade better for freeing up system memory.

Printed outputs to the terminal

Both apt-get and apt print status information to the terminal, giving insight into what the system is doing after the input command. The apt command provides slightly more detailed information to the user, including a progress bar on each task.

How does apt replace apt-get?

The apt tool is now the default package management utility for Debian-based Linux distros, and it’s replaced both apt-get and apt-cache. Most apt-get commands are written the same in each new apt command.

However, in the past apt-get had to be used alongside apt-cache for certain commands. The following table shows how these few commands are now ported across to apt.

apt-cache...........................apt-get.................................apt

apt-cache search----------Not supported---------------apt search

apt-cache show------------Not supported----------------apt show

apt-cache policy------------Not supported---------------apt policy

You don’t need to replace apt-get commands with apt commands in any existing Linux scripts. They still operate as expected, and apt-get is still supported. Some of the functionality of the older apt-get commands is changed slightly in apt, so keeping apt-get in scripts helps ensure correct operations.

The average Linux user should use apt instead of apt-get unless the project or environment requires it.

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

gyrog
Posts: 594
Joined: Thu Oct 01, 2020 8:17 am
Location: Australia
Has thanked: 14 times
Been thanked: 180 times
Contact:

Re: Apt : Using it to install packages

Post by gyrog »

Is it posssible for apt to generate a list of installed files?
If so, how?

User avatar
mikeslr
Posts: 2793
Joined: Mon Jul 13, 2020 11:08 pm
Has thanked: 173 times
Been thanked: 837 times

Re: Apt : Using it to install packages

Post by mikeslr »

gyrog wrote: Sat Sep 02, 2023 1:37 pm

Is it posssible for apt to generate a list of installed files?
If so, how?

Does this help?
https://linuxize.com/post/how-to-list-i ... on-debian/
and I don't think the initial 'sudo' is needed. If not, the command would be
apt list --installed

The above post provides a lot more information. I'm not currently using a Puppy that has apt so can't test whether it also has the dpkg-query command. If it does, this suggestion would seem particularly useful:

Create a List of all Installed Packages

The following command will store the list of all installed packages on your Debian system to a file called packages_list.txt:

sudo dpkg-query -f '${binary:Package}\n' -W > packages_list.txt

Again the 'sudo' preface is probably not necessary.

See also, https://www.baeldung.com/linux/list-installed-packages

This post, https://stackdiary.com/tutorials/apt-li ... -packages/ suggests another useful variation:

apt list --installed --upgradable

gyrog
Posts: 594
Joined: Thu Oct 01, 2020 8:17 am
Location: Australia
Has thanked: 14 times
Been thanked: 180 times
Contact:

Re: Apt : Using it to install packages

Post by gyrog »

mikeslr wrote: Sat Sep 02, 2023 3:58 pm

Does this help?

Unfortunately, no.
I'm looking for a list of installed files, not packages.

dimkr
Posts: 1908
Joined: Wed Dec 30, 2020 6:14 pm
Has thanked: 36 times
Been thanked: 829 times

Re: Apt : Using it to install packages

Post by dimkr »

Look in /var/lib/dpkg/info.

gyrog
Posts: 594
Joined: Thu Oct 01, 2020 8:17 am
Location: Australia
Has thanked: 14 times
Been thanked: 180 times
Contact:

Re: Apt : Using it to install packages

Post by gyrog »

dimkr wrote: Sat Sep 02, 2023 4:57 pm

Look in /var/lib/dpkg/info.

Thanks for that info.
It would appear that this directory contains info for all installed packages, not just user-installed.
(I know I didn't ask for that distinction.)
But if a user installs a package, it's info should be in this directory in the savefolder.

Post Reply

Return to “Install”