Команда обновления arch linux

System maintenance

Regular system maintenance is necessary for the proper function of Arch over a period of time. Timely maintenance is a practice many users get accustomed to.

Contents

Check for errors

Failed systemd services

Check if any systemd services have failed:

See systemd#Using units for more information.

Logfiles

The factual accuracy of this article or section is disputed.

Look for errors in the log files located at /var/log , as well as high priority errors in the systemd journal:

See systemd/Journal for more information.

See Xorg#Troubleshooting for information on where and how Xorg logs errors.

Backup

Create backups of important data at regular intervals. See Synchronization and backup programs for many alternative applications that may better suit your case. See Category:System recovery for other articles of interest.

It is encouraged to automate backups, see Autostarting#On time events.

Configuration files

Before editing any configuration files, create a backup so that you can revert to a working version in case of problems. Editors like vim and emacs can do this automatically, as well as tools like etckeeper which keep /etc in a version control system (VCS); see dotfiles#Tracking dotfiles directly with Git for more.

List of installed packages

Maintain a list of all installed packages so that if a complete re-installation is inevitable, it is easier to re-create the original environment.

Pacman database

Encryption metadata

System and user data

Upgrading the system

It is recommended to perform full system upgrades regularly via Pacman#Upgrading packages, to enjoy both the latest bug fixes and security updates, and also to avoid having to deal with too many package upgrades that require manual intervention at once. When requesting support from the community, it will usually be assumed that the system is up to date.

Make sure to have the Arch install media or another Linux «live» CD/USB available so you can easily rescue your system if there is a problem after updating. If you are running Arch in a production environment, or cannot afford downtime for any reason, test changes to configuration files, as well as updates to software packages, on a non-critical duplicate system first. Then, if no problems arise, roll out the changes to the production system.

If the system has packages from the AUR, carefully upgrade all of them.

pacman is a powerful package management tool, but it does not attempt to handle all corner cases. Users must be vigilant and take responsibility for maintaining their own system.

Read before upgrading the system

Before upgrading, users are expected to visit the Arch Linux home page to check the latest news, or alternatively subscribe to the RSS feed or the arch-announce mailing list. When updates require out-of-the-ordinary user intervention (more than what can be handled simply by following the instructions given by pacman), an appropriate news post will be made.

Before upgrading fundamental software (such as the kernel, xorg, systemd, or glibc ) to a new version, look over the appropriate forum to see if there have been any reported problems.

Users must equally be aware that upgrading packages can raise unexpected problems that could need immediate intervention; therefore, it is discouraged to upgrade a stable system shortly before it is required for carrying out an important task. Instead, wait to upgrade until there is enough time available to resolve any post-upgrade issues.

Avoid certain pacman commands

Avoid doing partial upgrades. In other words, never run pacman -Sy ; instead, always use pacman -Syu .

Generally avoid using the —overwrite option with pacman. The —overwrite option takes an argument containing a glob. When used pacman will bypass file conflict checks for files that match the glob. In a properly maintained system, it should only be used when explicitly recommended by the Arch developers. See the #Read before upgrading the system section.

Avoid using the -d option with pacman. pacman -Rdd package skips dependency checks during package removal. As a result, a package providing a critical dependency could be removed, resulting in a broken system.

Partial upgrades are unsupported

Arch Linux is a rolling release distribution. That means when new library versions are pushed to the repositories, the developers and Trusted Users rebuild all the packages in the repositories that need to be rebuilt against the libraries. For example, if two packages depend on the same library, upgrading only one package might also upgrade the library (as a dependency), which might then break the other package which depends on an older version of the library.

Читайте также:  The installation cannot continue as the installer file may be damaged adobe windows

That is why partial upgrades are not supported. Do not use:

  • pacman -Sy package
  • pacman -Sy followed by pacman -S package .
  • pacman -Syuw (Note that pacman -Syuw does imply the same risks like pacman -Sy , as it will update the pacman sync database without installing the newer packages.)

Always upgrade (with pacman -Syu ) before installing a package. Note that if pacman -Syu does not perform the upgrade because of an error, the end result is the same as running pacman -Sy . Therefore, the error must be resolved and the upgrade operation completed as soon as possible.

Be very careful when using IgnorePkg and IgnoreGroup for the same reason. If the system has locally built packages (such as AUR packages), users will need to rebuild them when their dependencies receive a soname bump.

If a partial upgrade scenario has been created, and binaries are broken because they cannot find the libraries they are linked against, do not «fix» the problem simply by symlinking. Libraries receive soname bumps when they are not backwards compatible. A simple pacman -Syu to a properly synced mirror will fix the problem as long as pacman is not broken.

The bash script checkupdates, included with the pacman-contrib package, provides a safe way to check for upgrades to installed packages without running a system update at the same time.

Act on alerts during an upgrade

When upgrading the system, be sure to pay attention to the alert notices provided by pacman. If any additional actions are required by the user, be sure to take care of them right away. If a pacman alert is confusing, search the forums and the recent news posts for more detailed instructions.

Deal promptly with new configuration files

When pacman is invoked, .pacnew and .pacsave files can be created. Pacman provides notice when this happens and users must deal with these files promptly. Users are referred to the Pacman/Pacnew and Pacsave wiki page for detailed instructions.

Also, think about other configuration files you may have copied or created. If a package had an example configuration that you copied to your home directory, check to see if a new one has been created.

Restart or reboot after upgrades

Upgrades are typically not applied to existing processes. You must restart processes to fully apply the upgrade.

The archlinux-contrib package provides a script called checkservices which runs pacdiff to merge .pacnew files then checks for processes running with outdated libraries and prompts the user if they want them to be restarted.

The kernel is particularly difficult to patch without a reboot. A reboot is always the most secure option, but if this is very inconvenient kernel live patching can be used to apply upgrades without a reboot.

Revert broken updates

If a package update is expected/known to cause problems, packagers will ensure that pacman displays an appropriate message when the package is updated. If experiencing trouble after an update, double-check pacman’s output by looking at /var/log/pacman.log .

At this point, only after ensuring there is no information available through pacman, there is no relative news on https://archlinux.org/, and there are no forum posts regarding the update, consider seeking help on the forum, over IRC, or by downgrading the offending package.

Check for orphans and dropped packages

After upgrading you may now have packages that are no longer needed or that are no longer in the official repositories.

Use pacman -Qtd to check for packages that were installed as a dependency but now, no other packages depend on them. If an orphaned package is still needed, it is recommended to change the installation reason to explicit. Otherwise, if the package is no longer needed, it can be removed.

Additionally, some packages may no longer be in the remote repositories, but they still may be on your local system. To list all foreign packages use pacman -Qm . Note that this list will include packages that have been installed manually (e.g., from the AUR). To exclude packages that are (still) available on the AUR, use the ancient-packages AUR tool.

Use the package manager to install software

Pacman does a much better job than you at keeping track of files. If you install things manually you will, sooner or later, forget what you did, forget where you installed to, install conflicting software, install to the wrong locations, etc.

  • Install packages from the official repositories using the method in the Pacman#Installing packages section.
  • If the program you desire is not available, check to see if someone has created a package in the AUR. Follow the method in that article for installation.
  • Lastly, if the program you want is not in the official repositories or in the AUR, learn how to create a package for it.

Choose open-source drivers

Always try open source drivers before resorting to proprietary drivers. Most of the time, open source drivers are more stable and reliable than proprietary drivers. Open source driver bugs are fixed more easily and quickly. While proprietary drivers can offer more features and capabilities, this can come at the cost of stability. To avoid this dilemma, try to choose hardware components known to have mature open source driver support with full features. Information about hardware with open source Linux drivers is available at linux-drivers.org.

Be careful with unofficial packages

Use precaution when using packages from the AUR or an unofficial user repository. Most are supplied by regular users and thus may not have the same standards as those in the official repositories. Avoid AUR helpers which automate installation of AUR packages. Always check PKGBUILDs for sanity and signs of mistake or malicious code before building and/or installing the package.

Читайте также:  Android синхронизация для windows

To simplify maintenance, limit the amount of unofficial packages used. Make periodic checks on which are in actual use, and remove (or replace with their official counterparts) any others. See pacman/Tips and tricks#Maintenance for useful commands. Following system upgrade, use rebuild-detector to identify any unofficial packages that may need to be rebuilt.

Update the mirrorlist

Update pacman’s mirrorlist, as the quality of mirrors can vary over time, and some might go offline or their download rate might degrade.

See mirrors for details.

Clean the filesystem

When looking for files to remove, it is important to find the files that take up the most disk space. Programs that help with this are found in:

Package cache

Remove unwanted .pkg files from /var/cache/pacman/pkg/ to free up disk space.

Unused packages (orphans)

Remove unused packages from the system to free up disk space and simplify maintenance.

Old configuration files

Old configuration files may conflict with newer software versions, or corrupt over time. Remove unneeded configurations periodically, particularly in your home folder and

/.config . For similar reasons, be careful when sharing home folders between installations.

Look for the following folders:

/.config/ — where apps stores their configuration

/.cache/ — cache of some programs may grow in size

/.local/share/ — old files may be lying there

To keep the home directory clean from temporary files created at the wrong place, it is a good idea to manage a list of unwanted files and remove them regularly, for example with rmshit.py.

rmlint can be used to find and optionally remove duplicate files, empty files, recursive empty directories and broken symlinks.

Old, broken symbolic links might be sitting around your system; you should remove them. Examples on achieving this can be found here and here. However, you should not blindly delete all broken symbolic links, as some of them serve a purpose [1].

To quickly list all the broken symlinks of your system, use:

Then inspect and remove unnecessary entries from this list.

Tips and tricks

The following tips are generally not required, but certain users may find them useful.

Use proven software packages

Arch’s rolling releases can be a boon for users who want to try the latest features and get upstream updates as soon as possible, but they can also make system maintenance more difficult. To simplify maintenance and improve stability, try to avoid cutting edge software and install only mature and proven software. Such packages are less likely to receive difficult upgrades such as major configuration changes or feature removals. Prefer software that has a strong and active development community, as well as a high number of competent users, in order to simplify support in the event of a problem.

Avoid any use of the testing repository, even individual packages from testing. These packages are experimental and not suitable for a stable system. Similarly, avoid packages which are built directly from upstream development sources. These are usually found in the AUR, with names including things like: «dev», «devel», «svn», «cvs», «git», etc.

Install the linux-lts package

The linux-lts package is an alternative Arch kernel package, and is available in the core repository. This particular kernel version has long-term support (LTS) from upstream, including security fixes and some feature backports. It is useful if you prefer the stability of less-frequent kernel updates or if you want a fallback kernel in case a new kernel version causes problems.

Источник

Help:Reading (Русский)

Поскольку подавляющее большинство статей в ArchWiki содержит указания, не совсем понятные для новых пользователей Arch Linux (или GNU/Linux в целом), было решено написать это краткое изложение основных процедур во избежание путаницы при чтении, а также для уменьшения количества повторений в самом содержании статей.

Contents

Организация

Большинство статей в ArchWiki не предоставляет целостного погружения в конкретную тему, они пишутся в соответствии с принципом DRY и предположением, что пользователь самостоятельно найдет и прочитает необходимые дополнительные материалы по тем темам, которые ему непонятны. Там, где это возможно, ссылки на такие материалы приведены в самих статьях при помощи специального форматирования, смотрите #Форматирование.

Вследствие такой организации, чтобы лучше усвоить материал, может потребоваться изучить несколько относящихся к теме источников. В частности, новые в Arch (или GNU/Linux в целом) пользователи должны читать большое количество статей даже при решении простых проблем. Прежде чем обращаться к другим пользователям за помощью, особенно важно изучить дополнительную информацию.

Форматирование

  • ссылка на раздел в текущей статье: #Организация
  • ссылка на другую статью ArchWiki
  • ссылка на внешний веб-ресурс)
  • ссылка на man-страницу: intro(1)
  • man-страница, доступная только без сети: foo(1)
  • ссылка на пакет, находящийся в официальных репозиториях: foobar
  • ссылка на пакет, находящийся в AUR: foobarAUR

Обычный пользователь или root

Есть строки написанные так:

А есть с другим префиксом:

Цифры или знак ( # ) указывает на то, что команда должна быть запущена от root, в то время как знак доллара ( $ ) показывает что команда должна быть запущена от имени обычного пользователя.

Заметьте следующее исключение:

В этом примере, знак # говорит что это не будет командой; вместо этого он должен быть отредактирован в файле. Так как в данном случае знак # означает комментарий. Комментарий может содержать пояснительный текст, который не будет выполняться соответствующей программой. Обозначение комментариев в скриптах Bash совпадает с PS1 суперпользователя.

Читайте также:  Movies and tv windows 10 что это

Дополнительным указанием на комментарий является заглавная буква после знака # . Обычно, команды Unix не написаны таким образом и в большинстве случаев они являются короткими аббревиатурами вместо полных Английских слов (например, Copy становится cp).

Несмотря на это, большинство статей даёт это легко распознать, уведомив читателя:

Добавить, создать, редактировать

Когда вам будет предложено добавить, создать или отредактировать один или несколько файлов, в этом случае предполагается использование одного из следующих методов.

Для создания или изменения текстовых файлов предлагается использовать текстовый редактор. Например, nano, команда для редактирования файла /etc/bash.bashrc :

Чтобы создать или перезаписать файл из терминала, проще использовать перенаправление выводаWikipedia:ru:Перенаправление_ввода-вывода. В следующем примере создается или перезаписывается содержимое файла /etc/hostname содержимым файла myhostname .

Также перенаправление вывода можно использовать для добавления строки в файл. В примере строка [custom-repo] добавляется в файл /etc/pacman.conf .

Когда просят создать каталог(и), используйте команду mkdir:

Сделать исполняемым

После создания файла предназначеного для запуска в виде скрипта (вручную или другой программой) необходимо сделать его исполняемым, например:

Для получения дополнительной информации смотрите chmod. Некоторые приложения, такие как файловый менеджер могут предоставлять графический интерфейс для настройки этого.

Source

Некоторые приложения, в частности командные оболочки, используют скрипты для их настройки: после их изменения, они должны быть sourced (прочитаны) чтобы принять изменения. Например, в случае с bash, это делается путём выполнения (вы также можете заменить source с . ):

Когда статья предложит изменить скрипт настроек, она не будет напоминать вам о выполнении команды source для файла, и только в некоторых случаях вам будет указан ссылкой этот раздел.

Установка пакетов

Когда статья предлагает установить какие-либо пакеты обычным способом, там не будут описаны подробные инструкции. Вместо них будут имена пакетов, которые нужно установить.

Приведенные ниже подразделы дают обзор общих процедур установки в зависимости от типа пакета.

Официальные пакеты

Для получения пакетов из официальных репозиториев вы увидите нечто похожее:

Это означает, что вы должны запустить:

Статья pacman содержит подробные инструкции как правильно управлять пакетами в Arch Linux.

Репозиторий пользователей Arch (AUR)

Для получения пакетов из AUR (Пользовательского Репозитория Arch) вы увидите примерно такое:

Это означает, что вы должны перейти по ссылке имя_пакета AUR , скачать архив PKGBUILD, распаковать его, проверить содержание, и запустить в этой же папке:

Статья Пользовательский репозиторий Arch содержит все подробные объяснения и лучшие методы работы с пакетами AUR.

Управление юнитами systemd

Когда статья говорит запустить, включить, остановить или перезапустить какой-то юнит systemd (например service (службу)), в статье не будут указаны подробные инструкции как это сделать, вместо этого вы будете читать примерно такое:

Это означает, что вы должны выполнить:

Ссылка Запустить приведёт вас к статье systemd, которая содержит все подробные пояснения по правильному использованию юнитов systemd в Arch Linux.

Общесистемные или пользовательские настройки

Важно помнить, что существуют два разных вида настроек в системе GNU/Linux. Общесистемная настройка влияет на всех пользователей. Поскольку общесистемные настройки расположены как правило в каталоге /etc , нужны права суперпользователя (root) чтобы их менять. Например, для применения настроек Bash которые затронут всех пользователей, должен быть изменён /etc/bash.bashrc .

Пользовательские настройки затрагивают только конкретного пользователя. Файл с точкой (.файл) используется для настроек конкретного пользователя. Например файл

/.bashrc является пользовательским (для конкретного пользователя) файлом настроек. Идея заключается в том, что каждый пользователь может задать свои собственные настройки, такие как псевдонимы (alias), функции и другие интерактивные черты, как строка приглашения (prompt), не затрагивая предпочтения других пользователей.

/ и $HOME представляют собой ярлыки для домашнего каталога пользователя, обычно /home/Имя_пользователя/ .

Общие файлы оболочек

Bash и другие Bourne-совместимые оболочки, как Zsh, также содержат зависимые исходные файлы, смотря какая оболочка представлена, оболочка входа или интерактивная оболочка. Для подробностей смотрите Bash (Русский)#Файлы настроек и Zsh (Русский)#Файлы Запуска/Завершения.

Псевдо-переменные в примерах кода

Некоторые блоки кода могут содержать так называемые псевдо-переменные, которые, как следует из названия, не являются фактическими переменными, используемые в коде. Вместо этого они представляют собой место для заполнения и должны быть вручную заменены на конкретный системный элемент конфигурации до того, как код может быть запущен или внедрён. Общие оболочки, такие как bash и zsh, обеспечивают автодополнение по табу (tab) для параметров общих команд, таких как systemctl.

В статьях, которые соответствуют Help:Style/Formatting and punctuation, псевдо-переменные оформлены курсивом. Например:

  • Включить dhcpcd@interface_name.service для сетевого интерфейса выявленного командой ip link .

В этом случае interface_name используется в качестве псевдо-переменной которую нужно заполнить в блоке юнита systemd. Все шаблоны юнитов systemd, опознаются знаком @ , требующим элемент конфигурации конкретной системы как аргумент. Смотрите Systemd (Русский)#Использование юнитов.

  • Команда dd if=data_source of=/dev/sdX bs=sector_size count=sector_number seek=partitions_start_sector может быть запущена от суперпользователя, чтобы уничтожить раздел с конкретными параметрами.

В этом случае псевдо-переменные используются для описания параметров, которые должны быть заменены на них. Подробное описание этих параметров, включая команду, рассматривается в разделе Securely wipe disk#Calculate blocks to wipe manually.

В случае файла примеров, вставляя псевдо-переменные в реальный файл настроек, можно испортить работу программы которая его использует.

Многоточие

В большинстве случаев многоточие ( . ) не является частью фактического содержимого файла или вывода кода, и используются вместо отображения кода или дополнительного текста, который не относится к обсуждаемой теме.

Например HOOKS=». encrypt . filesystems . » или:

Имейте в виду, что в некоторых случаях многоточие может быть значимой частью синтаксиса кода: внимательные пользователи смогут легко распознавать эти случаи по контексту.

Источник

Оцените статью