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
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.
Contents
-
Sugestões para novos(as) usuários(as) do Debian sobre como não quebrar seus sistemas Debian
- Não crie um FrankenDebian
- Não use scripts de instalação de fabricantes de GPU
- Não sofra da síndrome das coisas novas e brilhantes
- 'make install' can conflict with packages
- Don't blindly follow bad advice
- Read The Fantastic Manuals
- Don't blindly remove software
- Read package descriptions before installing
- Take notes
- Some safer ways to install software not available in Debian Stable
- Less safe ways to install software not available in Debian Stable
- Get the most out of peer support resources
- See Also
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):
Versão Debian teste (testing) (atualmente trixie)
Versão Debian instável (unstable) (também conhecida por sid)
Ubuntu, Mint ou outros repositórios derivados não são compatíveis com o Debian!
- Ubuntu PPAs e outros repositórios criados para distribuir determinados aplicativos
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.
AtiHowTo tem instruções de como configurar os drivers livres e de código aberto para placas de vídeo ATI/AMD (em inglês).
NvidiaGraphicsDrivers tem instruções para instalar drivers proprietários da NVIDIA pela maneira Debian (em inglês).
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:
O Debian adiciona correções de segurança e correções de confiabilidade. Julgar o software comparando o número de versão do pacote no Debian com o número de versão do(a) autor(a) upstream não leva em consideração este fato.
Instalar software de lugares outros que não os repositórios oficiais do Debian não é coberto pelo time de segurança do Debian.
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:
The Debian documentation homepage: https://www.debian.org/doc/
The Debian Administrator's Handbook: https://debian-handbook.info/
The apropos command will help you find manual pages.
The man command for reading the manual pages for commands you don't understand.
Some software has a separate <package name>-doc package containing documentation.
Every Debian package installed on your system has a directory in /usr/share/doc that will often contain a README.Debian file with information about differences from the upstream version of the software along with additional documentation.
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:
apt-cache(8) commands:
apt-cache show <package name> to see information on a package
apt-cache policy <package name> to see version information for a package
apt-cache depends <package name> to dependencies of a package
aptitude(8) commands:
aptitude why <package name> to show incomplete reason why a package is installed
aptitude why-not <package name> to show reasons why a package cannot be installed
Use the --simulate option with apt-get(8) and aptitude, which like the other commands in this list does not need to be run as root:
apt-get --simulate remove <package name>
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.
Alternative instructions are available as a factoid from Debian IRC bot.
Also on IRC the judd bot provides the checkbackport command to provide some guidance as to whether backporting is possible by querying the UltimateDebianDatabase.
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:
systemd-container package for the systemd-nspawn and machinectl container commands
- flatpak - see below
- snap - see below
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:
- Research the issue on your own first, including reading documentation and using search engines.
Provide details and ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html.
- If you get frustrated don't take it out on the volunteers trying to help, even if they seem frustrated with you.
- Don't expect to be spoon fed, if you need to be guided through step by step it's a sign that you need to learn more on your own by reading documentation.
- If you know how to answer a question from another user, you are encouraged to contribute!
- On IRC especially:
Don't hit <enter> every few words it gets hard to follow.
- Wait around for a response, people often disappear just before someone answers their question.
Use https://paste.debian.net/ instead of pasting directly into the channel.
See Also
DebianSoftware -- The software available to Debian Stable users