apt commands

class reemote.commands.apt.update.Update(guard: bool = True, sudo: bool = False, su: bool = False)[source]

Bases: Command_update

Implements package index update using the apt package manager.

This class extends Command to execute the apt update command for updating package indexes.

guard

A boolean flag indicating whether the operation should be guarded.

sudo

A boolean flag to specify if sudo privileges are required.

su

A boolean flag to specify if the operation should run as su.

Examples:

yield Update()
class reemote.commands.apt.install.Install(packages: List[str], guard: bool = True, sudo: bool = False, su: bool = False)[source]

Bases: Command_install

Implements package installation using the apt package manager.

This class extends Command to execute the apt install -y command for installing packages.

packages

List of package names to be installed.

guard

A boolean flag indicating whether the operation should be guarded.

sudo

A boolean flag to specify if sudo privileges are required.

su

A boolean flag to specify if the operation should run as su.

Examples:

yield Install(packages=['vim', 'git'])
class reemote.commands.apt.add_ppa.Add_ppa(ppa: str = '', guard: bool = True, sudo: bool = False, su: bool = False)[source]

Bases: object

Handles adding a Personal Package Archive (PPA) to the system.

This class is responsible for configuring a PPA repository on a system. It supports additional options such as using elevated privileges with sudo or su. It also allows for a safety guard to control the execution of the repository addition.

ppa

The PPA repository string to be added.

Type:

str

guard

Whether to add an execution guard for the operation. Defaults to True.

Type:

bool

sudo

Indicates if the operation should be executed with sudo privileges. Defaults to False.

Type:

bool

su

Indicates if the operation should be executed with su privileges. Defaults to False.

Type:

bool

class reemote.commands.apt.remove_ppa.Remove_ppa(ppa: str = '', guard: bool = True, sudo: bool = False, su: bool = False)[source]

Bases: object

Represents a class for removing a Personal Package Archive (PPA) from the system’s package manager.

This class encapsulates information and actions required to remove a PPA from the system using specific configurations such as enabling guard checks, using sudo, and switching to a superuser.

ppa

The PPA repository identifier to be removed.

guard

A boolean flag to enable or disable guard checks during the operation.

sudo

A boolean flag indicating whether the operation should be executed with sudo privileges.

su

A boolean flag indicating whether the operation should be executed as a superuser.

class reemote.commands.apt.remove.Remove(packages: List[str], guard: bool = True, sudo: bool = False, su: bool = False)[source]

Bases: Command_remove

Implements package removal using the apt package manager.

This class extends Command to execute the apt remove -y command for removing packages.

packages

List of package names to be removed.

guard

A boolean flag indicating whether the operation should be guarded.

sudo

A boolean flag to specify if sudo privileges are required.

su

A boolean flag to specify if the operation should run as su.

Examples:

yield Remove(packages=['vim', 'git'])
class reemote.commands.apt.upgrade.Upgrade(guard: bool = True, sudo: bool = False, su: bool = False)[source]

Bases: Command_upgrade

Implements package upgrade using the apt package manager.

This class extends Command to execute the apt upgrade -y command for upgrading installed packages.

guard

A boolean flag indicating whether the operation should be guarded.

sudo

A boolean flag to specify if sudo privileges are required.

su

A boolean flag to specify if the operation should run as su.

Examples:

yield Upgrade()
class reemote.commands.apt.add_apt_key.Add_apt_key(comment: str = '', source: str = '', guard: bool = True, sudo: bool = True, su: bool = False)[source]

Bases: object

Handles adding an apt GPG key to the system.

This class is responsible for downloading and adding a GPG key for apt repositories. It supports additional options such as using elevated privileges with sudo or su.

source

The URL source of the GPG key.

Type:

str

guard

Whether to add an execution guard for the operation. Defaults to True.

Type:

bool

sudo

Indicates if the operation should be executed with sudo privileges. Defaults to True (typically required).

Type:

bool

su

Indicates if the operation should be executed with su privileges. Defaults to False.

Type:

bool

class reemote.commands.apt.remove_apt_key.Remove_apt_key(name: str = '', guard: bool = True, sudo: bool = True, su: bool = False)[source]

Bases: object

Handles removing an apt GPG key from the system.

This class is responsible for removing a GPG key from the system’s apt keyring. It supports additional options such as using elevated privileges with sudo or su.

name

A descriptive name for the key being removed, used to identify the keyring builtin.

Type:

str

guard

Whether to add an execution guard for the operation. Defaults to True.

Type:

bool

sudo

Indicates if the operation should be executed with sudo privileges. Defaults to True (typically required).

Type:

bool

su

Indicates if the operation should be executed with su privileges. Defaults to False.

Type:

bool