# Gerenciador de Pacote

## Arquivos de instalação

* DPKG
* RPM

Instalar dependências automaticamente:

```sh
$ sudo apt-get install -f
```

Download do VSCode Linux (\*.deb): <https://code.visualstudio.com/docs/?dv=linux64\\_deb>

```sh
$ sudo dpkg -i code_1.91.1-1720564633_amd64.deb
(Reading database ... 42159 files and directories currently installed.)
Preparing to unpack code_1.91.1-1720564633_amd64.deb ...
Unpacking code (1.91.1-1720564633) over (1.91.1-1720564633) ...
Setting up code (1.91.1-1720564633) ...
Processing triggers for shared-mime-info (2.1-2) ...
```

Desinstalar o VSCode:

```sh
$ sudo dpkg -r code
(Reading database ... 25672 files and directories currently installed.)
Removing code (1.91.1-1720564633) ...
Processing triggers for shared-mime-info (2.1-2) ...
```

## Repositório

* APT
* YUM

Atualizar repositórios existentes:

```sh
$ sudo apt update
Get:1 https://packages.microsoft.com/repos/code stable InRelease [3590 B]
Get:2 https://packages.microsoft.com/repos/code stable/main armhf Packages [18.1 kB]
Get:3 https://packages.microsoft.com/repos/code stable/main arm64 Packages [17.9 kB]
Get:4 https://packages.microsoft.com/repos/code stable/main amd64 Packages [17.9 kB]
Hit:5 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:6 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:7 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:8 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Fetched 57.5 kB in 2s (27.8 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
112 packages can be upgraded. Run 'apt list --upgradable' to see them.
```

Instalação do Node.js:

```sh
$ sudo apt install nodejs
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  javascript-common libc-ares2 libjs-highlight.js libnode72 nodejs-doc
Suggested packages:
  apache2 | lighttpd | httpd npm
The following NEW packages will be installed:
  javascript-common libc-ares2 libjs-highlight.js libnode72 nodejs nodejs-doc
0 upgraded, 6 newly installed, 0 to remove and 112 not upgraded.
Need to get 13.7 MB of archives.
After this operation, 54.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 javascript-common all 11+nmu1 [5936 B]
Get:2 http://archive.ubuntu.com/ubuntu jammy/universe amd64 libjs-highlight.js all 9.18.5+dfsg1-1 [367 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libc-ares2 amd64 1.18.1-1ubuntu0.22.04.3 [45.1 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 libnode72 amd64 12.22.9~dfsg-1ubuntu3.6 [10.8 MB]
Get:5 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 nodejs-doc all 12.22.9~dfsg-1ubuntu3.6 [2411 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 nodejs amd64 12.22.9~dfsg-1ubuntu3.6 [122 kB]
Fetched 13.7 MB in 2s (6271 kB/s)
Selecting previously unselected package javascript-common.
(Reading database ... 42159 files and directories currently installed.)
Preparing to unpack .../0-javascript-common_11+nmu1_all.deb ...
Unpacking javascript-common (11+nmu1) ...
Selecting previously unselected package libjs-highlight.js.
Preparing to unpack .../1-libjs-highlight.js_9.18.5+dfsg1-1_all.deb ...
Unpacking libjs-highlight.js (9.18.5+dfsg1-1) ...
Selecting previously unselected package libc-ares2:amd64.
Preparing to unpack .../2-libc-ares2_1.18.1-1ubuntu0.22.04.3_amd64.deb ...
Unpacking libc-ares2:amd64 (1.18.1-1ubuntu0.22.04.3) ...
Selecting previously unselected package libnode72:amd64.
Preparing to unpack .../3-libnode72_12.22.9~dfsg-1ubuntu3.6_amd64.deb ...
Unpacking libnode72:amd64 (12.22.9~dfsg-1ubuntu3.6) ...
Selecting previously unselected package nodejs-doc.
Preparing to unpack .../4-nodejs-doc_12.22.9~dfsg-1ubuntu3.6_all.deb ...
Unpacking nodejs-doc (12.22.9~dfsg-1ubuntu3.6) ...
Selecting previously unselected package nodejs.
Preparing to unpack .../5-nodejs_12.22.9~dfsg-1ubuntu3.6_amd64.deb ...
Unpacking nodejs (12.22.9~dfsg-1ubuntu3.6) ...
Setting up javascript-common (11+nmu1) ...
Setting up libc-ares2:amd64 (1.18.1-1ubuntu0.22.04.3) ...
Setting up libnode72:amd64 (12.22.9~dfsg-1ubuntu3.6) ...
Setting up libjs-highlight.js (9.18.5+dfsg1-1) ...
Setting up nodejs (12.22.9~dfsg-1ubuntu3.6) ...
update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode
Setting up nodejs-doc (12.22.9~dfsg-1ubuntu3.6) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.4) ...
```

Execução do Node.js:

```sh
$ node
Welcome to Node.js v12.22.9.
Type ".help" for more information.
>
```

Desinstalação do Node.js:

```sh
$ sudo apt remove nodejs
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  javascript-common libc-ares2 libjs-highlight.js libnode72 nodejs-doc
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  nodejs
0 upgraded, 0 newly installed, 1 to remove and 112 not upgraded.
After this operation, 929 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 42529 files and directories currently installed.)
Removing nodejs (12.22.9~dfsg-1ubuntu3.6) ...
Processing triggers for man-db (2.10.2-1) ...
```

Execução do Node.js:

```sh
$ node
-bash: /usr/bin/node: No such file or directory
```

Pesquisar pacotes:

```sh
$ sudo apt search node
```

Instalar novos repositórios:

```sh
$ sudo add-apt-repository ppa:kirillshkrogalev/ffmpeg-next
Repository: 'deb https://ppa.launchpadcontent.net/kirillshkrogalev/ffmpeg-next/ubuntu/ jammy main'
Description:
This PPA provides backported release ffmpeg for current releases Ubuntu (Trusty, Utopic, etc.)
More info: https://launchpad.net/~kirillshkrogalev/+archive/ubuntu/ffmpeg-next
Adding repository.
Press [ENTER] to continue or Ctrl-c to cancel.
Adding deb entry to /etc/apt/sources.list.d/kirillshkrogalev-ubuntu-ffmpeg-next-jammy.list
Adding disabled deb-src entry to /etc/apt/sources.list.d/kirillshkrogalev-ubuntu-ffmpeg-next-jammy.list
Adding key to /etc/apt/trusted.gpg.d/kirillshkrogalev-ubuntu-ffmpeg-next.gpg with fingerprint 1EC6DBC9AA41BD34B32CC5A15C50E96D8EFE5982
Hit:1 https://packages.microsoft.com/repos/code stable InRelease
Hit:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:3 https://ppa.launchpadcontent.net/kirillshkrogalev/ffmpeg-next/ubuntu jammy InRelease
Err:4 https://ppa.launchpadcontent.net/kirillshkrogalev/ffmpeg-next/ubuntu jammy Release
  404  Not Found [IP: 185.125.190.80 443]
Hit:5 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:6 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:7 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Reading package lists... Done
E: The repository 'https://ppa.launchpadcontent.net/kirillshkrogalev/ffmpeg-next/ubuntu jammy Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
```
