Gostaria de instalar o libuv em uma instância WSL do Ubuntu e preciso especificamente da versão 1.45.0 ou posterior.
Meu entendimento (a partir deste artigo tutorial ) é que o comando para descobrir quais versões de um pacote estão disponíveis para instalação é apt list | grep
:
$ apt list | grep libuv
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libuv1-dev/jammy,now 1.43.0-1 amd64 [installed]
libuv1/jammy,now 1.43.0-1 amd64 [installed,automatic]
libuvc-dev/jammy 0.0.6-1.1 amd64
libuvc-doc/jammy 0.0.6-1.1 all
libuvc0/jammy 0.0.6-1.1 amd64
... o que me leva a pensar que apenas 1.43.0-1 está disponível para instalação por apt-get
e que já está instalado.
Mas o site GitHub da libuv indica que existem versões mais recentes.
Como posso obter o libuv v1.45.0 (ou posterior) na minha instância do Ubuntu com apt-get
?
Embora minha necessidade imediata seja específica do libuv, na verdade quero aprender sobre este aspecto do ecossistema Unix/Linux em geral: qual é a relação entre drivers/pacotes/etc. que parecem ser "lançados" (por exemplo, de acordo com suas páginas do GitHub) versus o que está "disponível" para gerenciadores de pacotes, como apt-get
? O que os usuários devem fazer se quiserem uma versão mais recente de um pacote que não está disponível no gerenciador de pacotes? Eles deveriam baixar o código-fonte e compilar localmente?
Atualização : Por que preciso do 1.45.0, ou seja, por que preciso de uma versão mais avançada do que a disponível no meu gerenciador de pacotes?
Minha máquina Linux é um ambiente de desenvolvimento, onde preciso compilar para hospedar (ou seja, podemos desconsiderar a compilação cruzada para o contexto desta questão). O aplicativo que preciso compilar (não escrito por mim) depende de uv_timespec64_t
, que aparentemente foi introduzido na libuv v1.45.0 por este git merge/diff ).
Portanto, essa é a premissa desta questão: preciso compilar (para o host) um aplicativo que depende de um recurso de uma versão mais recente do libuv do que o gerenciador de pacotes da minha distribuição Linux oferece.
Atualização: Esta questão tem uma pergunta de acompanhamento relacionada aqui: Por que diferentes distros Linux têm diferentes formatos de pacotes (e gerenciadores de pacotes)?
Troncos e árvores
Embora @TechLoom tenha respondido sua pergunta sobre
libuv
, permita-me responder a sua pergunta sobre o ecossistema Linux. Vamos começar comAbra isso em uma nova guia do navegador e observe que existem 5 troncos principais:
Cada uma dessas ramificações e, portanto, todas as ramificações filhas são definidas principalmente pelo sistema de gerenciamento de pacotes em uso.
Now, as for how the ecosystem is connected. Each package manager is configured to connect only to its specified package tree, also called a repository. Debian-based systems connect to APT based trees, where you can download and install
.deb
files. Each of these package managers allows users to install custom trees. Ubuntu-based systems call them PPAs, or Personal Package Archives.Release Cycles
Each distribution, regardless of the package manger has a release cycle. Release cycles can be thought of as "locked repositories" or using the tree analogy: "healthy trees that don't grow anymore." The repositories only contain packages that belong to that certain release. In general, packages installed by the release are never altered, and only updated in rare cases i.e., when a critical bugfix is released (which is why you cannot find libuv-1.45 in the
jammy
release), but if you look inmantic
andnoble
, the next few codenames for Future Releases, you can see the package has been bumped (see Version Bumps below). Software like browsers and mail clients are generally released to thecontrib
(short for contributed) repository, which doesn't interfere with themain
repository. In Debian's terminology, I believe they call their contributed repositoryuniverse
, which fits rather well (every piece of user software under the sun can be put there). Each added package is compiled against the libraries and tools in themain
repository, packaged and uploaded to theuniverse
repository. This imitates the "locked repository" concept for software added by users or companies.In Ubuntu's case the release cycle generally occurs twice a year (once in April, and once in October, barring a minor version update [the 3rd version number]). You can see this by looking at the Ubuntu Release List. The accepted practice is to only use packages available in your release until that package is updated by the maintainer.
Note that some distributions use a rolling release model, specifically those that are source based. I can issue an update command on my source compiled Gentoo box, rebuild packages, and an hour later perform the same update and possibly update the same packages again.
Even our friends, or enemies depending on your preference, over at Microsoft have adopted a Release Model starting with Windows 10. The current release of Windows 11 is versioned as 23H2, or the 2nd half of 2023. The first major version of Windows 10 I remember was 1903, referring to March 2019. While Microsoft's "tree" isn't publicly available it is used to integrate updates based on bug fixes and user requests into future versions of Windows.
Why Version Locking Is Important
To understand why the locked concept is so important, imagine you owned a BMW anything. BMW's are mostly all hand built and hand tuned. Let's say that we decide we want to add Feature X from the 2025 model to our model we bought in 2023 without talking to BMW first.
I bolded that last bullet to tie all this together. In the above "upgrade" BMW is maintainer of the "locked repository." BMW owns or can access all the parts for most all of it's cars when asked. The special connector doesn't exist outside the tree. In the same way you can only add software or upgrades to your Ubuntu version, a.k.a. the cars in this story, if the software exists in the repository. Mixing repositories from different versions causes complete breakage. If Feature X needs to be added or upgraded in a previous version, the software is backported, and get's added to that particular version's
main
repository (the mechanic), and the version continues operating as intended (the car is repaired).Version Bumps
Os aumentos de versão, ou seja, passar de 1.43 para 1.45 geralmente são feitos da seguinte forma:
Lançamentos LTS
Para usuários que precisam de estabilidade, algumas distribuições usam o conceito de Long Term Service Release. Eles geralmente são preferidos em áreas com aplicativos de missão crítica, como servidor web, firewall ou controlador de domínio.
Você pode baixar o código-fonte na página do github.
https://github.com/libuv/libuv/releases
Em seguida, basta extrair o arquivo fonte, compilar o programa e instalá-lo. Todas as etapas estão na página do github.
https://github.com/libuv/libuv#build-instructions
Outra opção seria verificar se alguém possui um repositório para o projeto. Então você poderia usar "add-apt-repository" e depois usar o apt como quiser.