Traduções: English - Français - Español - Català - Português (Brasil)

Sugestões para novos(as) usuários(as) do Debian sobre como não quebrar seus sistemas Debian

Caneca quebrada do Debian

O Debian é um sistema robusto e confiável, entretanto usuários(as) com acesso a root podem fazer quaisquer alterações que desejarem. Como tal, é muito fácil que novos(as) usuários(as) quebrem seus sistemas ao não fazerem as coisas da "maneira Debian". Esta página lista erros comuns cometidos por novos(as) usuários(as). Algumas das coisas listadas aqui podem ser feitas de modo seguro, mas somente se você tiver experiência suficiente para saber como consertar seu sistema quando as coisas derem errado.

O mote genérico para as sugestões aqui é que consequências não serão sempre imediatas e podem tornar impossíveis futuras atualizações sem uma completa reinstalação. Se uma atualização sem uma completa reinstalação é importante para você, tenha cuidado em não cometer os erros descritos abaixo.

Uma das principais vantagens do Debian é seu repositório central com muitos milhares de pacotes de software. Se você está chegando no Debian vindo(a) de outro sistema operacional, você pode estar acostumado(a) com a instalação de software que você encontra em sites web aleatórios. No Debian, a instalação de software de sites web aleatórios é um hábito ruim. É sempre melhor utilizar o software de repositórios oficiais do Debian sempre que possível. Os pacotes no repositório do Debian são conhecidos pelo bom funcionamento e pela instalação apropriada. Somente usar software de repositórios do Debian é também muito mais seguro do que instalar de sites web aleatórios que podem acumular malware e outros riscos de segurança.

Não crie um FrankenDebian

O Debian estável (stable) não deve ser combinado com outras versões sem o devido cuidado. Se você está tentando instalar software que não está disponível na versão estável atual do Debian, não é uma boa ideia adicionar repositórios de outras versões do Debian.

Antes de tudo, o comportamento padrão do apt-get upgrade é atualizar qualquer pacote instalado para a mais nova versão disponível. Se, por exemplo, você configura o repositório trixie em um sistema bookworm, o APT tentará atualizar quase todos os pacotes para trixie.

Isto pode ser mitigado ao se configurar o apt pinning para dar prioridade para pacotes da bookworm.

Contudo, mesmo instalando poucos pacotes de uma "futura" versão pode ser arriscado. Os problemas podem não acontecer imediatamente, mas na próxima vez em que você instalar as atualizações.

O motivo porque as coisas podem quebrar é que o software empacotado para uma versão do Debian é construído para ser compatível com o resto do software daquela versão. Por exemplo, instalar pacotes da trixie em um sistema bookworm também poderia instalar versões mais novas de bibliotecas centrais, incluindo libc6. Isto resulta em um sistema que não é teste (testing) ou estável (stable), mas uma mistura quebrada dos dois.

Os repositórios que podem criar um FrankenDebian se usados com o Debian estável (stable):

Alguns outros repositórios podem parecer seguros para usar já que eles somente contêm pacotes que não têm equivalente no Debian. Entretanto, não há garantias de que qualquer repositório não adicionará mais pacotes no futuro, resultando em quebra.

Finalmente, os pacotes nas versões oficiais do Debian passaram por testes exaustivos, frequentemente por meses, e somente pacotes adequados são permitidos em um lançamento. Por outro lado, os pacotes de fontes externas podem alterar arquivos pertencentes a outros pacotes, podem configurar o sistema de maneiras não esperadas, podem introduzir vulnerabilidades, causar problemas de licenciamento.

Uma vez que pacotes de fontes não oficiais são introduzidos em um sistema, pode ser difícil delimitar a causa da quebra, especialmente se ela acontece meses depois.

Não use scripts de instalação de fabricantes de GPU

O Debian inclui drivers livres e de código aberto que suportam a maioria das placas de vídeo. Os drivers livres fornecem a melhor integração com o resto do sistema Debian e funcionam muito bem para a maioria dos(as) usuários(as).

Se você absolutamente precisa ter drivers proprietários e de código fechado, não faça o download direto do site web do fabricante! Instalar drivers dessa forma somente funciona para o kernel atual, e após a próxima atualização do kernel seus drivers de vídeo não funcionarão até que eles sejam manualmente reinstalados.

Felizmente existe uma maneira Debian de instalar drivers de placa de vídeo usando os pacotes do repositório. Instalar os drivers da maneira Debian garantirá que os drivers continuem a funcionar após a atualização do kernel.

Não sofra da síndrome das coisas novas e brilhantes

A razão pela qual o Debian estável (stable) é tão confiável é porque o software é exaustivamente testado e têm seus bugs corrigidos antes de ser incluído. Isto significa que a versão mais recente do software frequentemente não está disponível nos repositórios estáveis (stable). Mas isso não significa que o software é muito antigo para ser útil!

Antes de tentar instalar a versão mais nova de algum software de algum lugar outro que não o repositório do Debian estável (stable), aqui estão algumas coisas para ter em mente:

Por favor, note que os bugs são encontrados em softwares existentes e que somente novas versões de um software podem introduzir novos bugs e vulnerabilidades.

Quando um lançamento entra no Debian e recebe correções contra bugs, o número de vulnerabilidades conhecidas e bugs constantemente diminuirá durante o ciclo de vida do pacote.

'make install' can conflict with packages

It's quite easy to compile software from source code tarballs downloaded from the software's website, but not always so easy to remove it later. Often the instructions that come with the source code include instructions to use commands like ./configure && make && make install.

When you install software this way, you will not be able to remove it with apt-get or Synaptic. The APT packaging system can only remove software that was installed by the APT packaging system. Even worse, software installed this way can sometimes conflict with the software packaged for Debian.

Software installed this way also does not benefit from security updates the way that Debian packages do. If you want to keep your system up to date without having to manually compile and reinstall for every update, stick to the Debian packages.

The make install script may make invalid assumptions about where the compiled binary and its associated files should exist in the filesystem and under what set of permissions / ownership it should run. Software installed this way could also replace important software vital to system and package maintenance, making it difficult to repair your system using standard Debian tools.

Don't blindly follow bad advice

Unfortunately there's a lot of bad advice on the Internet. Tutorials found on blogs, forums and other sites often include instructions that will break your system in subtle ways. Don't simply follow the first advice you find, or the tutorial that seems the easiest. Spend some time reading the documentation and compare the difference between tutorials.

It's better to take the time to figure out the correct way to do something first than spending even more time fixing a broken system later. You would not let some random stranger feed your baby; do not execute commands without first understanding what they do.

Blog and forum posts don't expire. Instructions that might have been safe a couple of years ago might not be safe to follow any more. When in doubt keep researching and read your version's documentation.

Read The Fantastic Manuals

Often reading a tutorial is only enough to get a general idea of how to install or use an application. Almost all of the software packaged for Debian has at least some documentation available. Some places to look:

Don't blindly remove software

Sometimes when you remove a package, the package manager needs to remove other packages too. This is because the additional packages depend on the package you're trying to remove.

If this happens, the package manager will show you a list everything that will be removed and ask for your confirmation. Make sure to read this list carefully! If you don't know what some of the packages to be removed are for, read the descriptions for each one. When in doubt, do more research. Some resources that can help you research packages:

Read package descriptions before installing

It is recommended to read the descriptions of packages before installing them. Sometimes software will have different packages available in the Debian repository, with each package configured a different way. Read the package descriptions and search for similar package names to make sure you get the one that you want.

This point can be especially important for packages that install kernel modules.

Take notes

It's easy to forget the steps you took to do something on your computer, especially several months later when you're trying to upgrade. Sometimes when you try several different ways of solving a problem, it's easy to forget which method was successful the next day!

It's a very good idea to take notes about the software you've installed and configuration changes you've made. When editing configuration files, it's also a very good idea to include comments in the file explaining the reason for the changes and the date they were made.

Some safer ways to install software not available in Debian Stable

Sometimes the need arises for installing software that is not packaged for Debian, or a newer version than is packaged for the stable release. Below are some ways to reduce the risks described above.

Backported packages

Newer versions of packages can often be found in the Debian Backports archive. These packages are not tested as extensively as packages including in a Debian stable release and should be installed in moderation.

More experienced users can make their own backports of the latest Debian software. self-backporting is usually safer than other approaches. When self-backporting fails it indicates that installing the software manually (with make install or an installer script for example) could compromise your Debian system.

Building from source

If you are building software from source obtained otherwise than from Debian, it's a good idea to build and run it as a normal user, within that user's home directory. If you keep sensitive, valuable, or non-replaceable data in your home directory, it might be a good idea to create another user account for this purpose.

automake and other build systems can install self-built software in non-standard locations. It is a bad idea to be root or use "sudo" to install self-built software into /usr/bin or the other standard locations where regular packages place files. It is almost always possible to instead install into your home directory instead. (Using ./configure --prefix=~/.local or similar.) If you understand how to edit Makefiles, then you can alter the makefile in such a way as to render make install useful for your system or add a prefix=~/.local option.

If you want to make the software available to all users, do not allow it to install itself to the /usr directory hierarchy, as only Debian packages are meant to create files there. Installing software to the /usr/local will make it available to all users, and will not interfere with the package manager. The stow package can be useful for managing software installed to /usr/local.

Less safe ways to install software not available in Debian Stable

Please note: Packages in official Debian releases have gone through extensive testing, often for months, and only fit packages are allowed in a release. On the other hand, software from external sources can introduce security, reliability and legal issues. Debian does not endorse the use of software from external sources.

Using chroot, containers, and virtual machines

Another strategy for using software not available in Debian stable is to run the software in a virtual Debian system contained in its on directory or image file. This allows software to be installed on the virtual Debian system without having any effect on the primary, or host, Debian system running your computer.

Debian includes a variety of tools that provide varying degrees of isolation from the host operating system. Some include:

Flatpak

Some applications and games are also available in the new Flatpak package format. Flatpaks can be installed locally by non-root users and do not interfere with the Debian package system. Flatpak applications can also run in a sandbox. A flatpak package is available for Debian since stretch. gnome-software can update and install Flatpak apps with the gnome-software-plugin-flatpak package installed. For more information see the FlatpakHowto wiki page.

Snap

Another alternative is the Snappy system developed by Canonical, the company providing support for Ubuntu. Snaps are essentially similar to Flatpaks but currently (2018-10-26) the central snapcraft repository has more applications packaged than Flathub.

Important note: Many users are wary of Snaps. Use at your own discretion. They update on their own schedule, and install files to nonstandard locations. It may not be wise to use a Snap without first understanding the reputation/limitations of Snap.

Get the most out of peer support resources

When looking for support it's important to remember that Debian is a volunteer project and people will be more inclined to help if you're polite and willing to put a little effort in yourself. Here are some general guidelines that will help you get help:

See Also


CategoryPackageManagement CategorySystemAdministration