Arch linux update system

Содержание
  1. System maintenance
  2. Contents
  3. Check for errors
  4. Failed systemd services
  5. Logfiles
  6. Backup
  7. Configuration files
  8. List of installed packages
  9. Pacman database
  10. Encryption metadata
  11. System and user data
  12. Upgrading the system
  13. Read before upgrading the system
  14. Avoid certain pacman commands
  15. Partial upgrades are unsupported
  16. Act on alerts during an upgrade
  17. Deal promptly with new configuration files
  18. Restart or reboot after upgrades
  19. Revert broken updates
  20. Check for orphans and dropped packages
  21. Use the package manager to install software
  22. Choose open-source drivers
  23. Be careful with unofficial packages
  24. Update the mirrorlist
  25. Clean the filesystem
  26. Package cache
  27. Unused packages (orphans)
  28. Old configuration files
  29. Broken symlinks
  30. Tips and tricks
  31. Use proven software packages
  32. Install the linux-lts package
  33. General recommendations
  34. Contents
  35. System administration
  36. Users and groups
  37. Privilege elevation
  38. Service management
  39. System maintenance
  40. Package management
  41. pacman
  42. Repositories
  43. Mirrors
  44. Arch Build System
  45. Arch User Repository
  46. Booting
  47. Hardware auto-recognition
  48. Microcode
  49. Retaining boot messages
  50. Num Lock activation
  51. Graphical user interface
  52. Display server
  53. Display drivers
  54. Desktop environments
  55. Window managers
  56. Display manager
  57. User directories
  58. Power management
  59. ACPI events
  60. CPU frequency scaling
  61. Laptops
  62. Suspend and hibernate
  63. Multimedia
  64. Sound system
  65. Networking
  66. Clock synchronization
  67. DNS security
  68. Setting up a firewall
  69. Network shares
  70. Input devices
  71. Keyboard layouts
  72. Mouse buttons
  73. Laptop touchpads
  74. TrackPoints
  75. Optimization
  76. Benchmarking
  77. Improving performance
  78. Solid state drives
  79. System services
  80. File index and search
  81. Local mail delivery
  82. Printing
  83. Appearance
  84. Fonts
  85. GTK and Qt themes
  86. Console improvements
  87. Tab-completion enhancements
  88. Aliases
  89. Alternative shells
  90. Bash additions
  91. Colored output
  92. Compressed files
  93. Console prompt
  94. Emacs shell
  95. Mouse support
  96. Session management

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.

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.

Читайте также:  Как удалить еще неустановленные обновления windows 10

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.

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.

Читайте также:  Почему не могу обновиться до windows 10

Источник

General recommendations

This document is an annotated index of popular articles and important information for improving and adding functionalities to the installed Arch system. Readers are assumed to have read and followed the Installation guide to obtain a basic Arch Linux installation. Having read and understood the concepts explained in #System administration and #Package management is required for following the other sections of this page and the other articles in the wiki.

Contents

System administration

This section deals with administrative tasks and system management. See Core utilities and Category:System administration for more.

Users and groups

A new installation leaves you with only the superuser account, better known as «root». Logging in as root for prolonged periods of time, possibly even exposing it via SSH on a server, is insecure. Instead, you should create and use unprivileged user account(s) for most tasks, only using the root account for system administration. See Users and groups#User management for details.

Users and groups are a mechanism for access control; administrators may fine-tune group membership and ownership to grant or deny users and services access to system resources. Read the Users and groups article for details and potential security risks.

Privilege elevation

For a list of applications to allow running commands or starting an interactive shell as another user (e.g. root), see List of applications/Security#Privilege elevation.

Service management

Arch Linux uses systemd as the init process, which is a system and service manager for Linux. For maintaining your Arch Linux installation, it is a good idea to learn the basics about it. Interaction with systemd is done through the systemctl command. Read systemd#Basic systemctl usage for more information.

System maintenance

Arch is a rolling release system and has rapid package turnover, so users have to take some time to do system maintenance. Read Security for recommendations and best practices on hardening the system.

Package management

This section contains helpful information related to package management. See FAQ#Package management and Category:Package management for more.

pacman

pacman is the Arch Linux package manager: it is highly encouraged to become familiar with it before reading any other articles.

See pacman/Tips and tricks for suggestions on how to improve your interaction with pacman and package management in general.

Repositories

See the Official repositories article for details about the purpose of each officially maintained repository.

If you plan on using 32-bit applications, you will want to enable the multilib repository.

The Unofficial user repositories article lists several other unsupported repositories.

You may consider installing the pkgstats service.

Mirrors

Visit the Mirrors article for steps on taking full advantage of using the fastest and most up to date mirrors of the official repositories. As explained in the article, a particularly good advice is to routinely check the Mirror Status page for a list of mirrors that have been recently synced.

Arch Build System

Ports is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.

The Arch Build System offers the same functionality by providing build scripts called PKGBUILDs, which are populated with information for a given piece of software: integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are parsed by makepkg, the actual program that generates packages that are cleanly manageable by pacman.

Every package in the repositories along with those present in the AUR are subject to recompilation with makepkg.

Arch User Repository

While the Arch Build System allows the ability of building software available in the official repositories, the Arch User Repository (AUR) is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the web interface or through the Aurweb RPC interface.

Booting

This section contains information pertaining to the boot process. An overview of the Arch boot process can be found at Arch boot process. See Category:Boot process for more.

Hardware auto-recognition

Hardware should be auto-detected by udev during the boot process by default. A potential improvement in boot time can be achieved by disabling module auto-loading and specifying required modules manually, as described in Kernel modules. Additionally, Xorg should be able to auto-detect required drivers using udev , but users have the option to configure the X server manually too.

Microcode

Processors may have faulty behaviour, which the kernel can correct by updating the microcode on startup. See Microcode for details.

Retaining boot messages

Once it concludes, the screen is cleared and the login prompt appears, leaving users unable to gather feedback from the boot process. Disable clearing of boot messages to overcome this limitation.

Num Lock activation

Num Lock is a toggle key found in most keyboards. For activating Num Lock’s number key-assignment during startup, see Activating numlock on bootup.

Graphical user interface

This section provides orientation for users wishing to run graphical applications on their system. See Category:Graphical user interfaces for additional resources.

Display server

Xorg is the public, open-source implementation of the X Window System (commonly X11, or X). It is required for running applications with graphical user interfaces (GUIs), and the majority of users will want to install it.

Wayland is a newer, alternative display server protocol and the Weston reference implementation is available.

Display drivers

The default modesetting display driver will work with most video cards, but performance may be improved and additional features harnessed by installing the appropriate driver for AMD or NVIDIA products.

Desktop environments

Although Xorg provides the basic framework for building a graphical environment, additional components may be considered necessary for a complete user experience. Desktop environments such as GNOME, KDE, LXDE, and Xfce bundle together a wide range of X clients, such as a window manager, panel, file manager, terminal emulator, text editor, icons, and other utilities. Users with less experience may wish to install a desktop environment for a more familiar environment. See Category:Desktop environments for additional resources.

Window managers

A full-fledged desktop environment provides a complete and consistent graphical user interface, but tends to consume a considerable amount of system resources. Users seeking to maximize performance or otherwise simplify their environment may opt to install a window manager alone and hand-pick desired extras. Most desktop environments allow use of an alternative window manager as well. Dynamic, stacking, and tiling window managers differ in their handling of window placement.

Display manager

Most desktop environments include a display manager for automatically starting the graphical environment and managing user logins. Users without a desktop environment can install one separately. Alternatively you may start X at login as a simple alternative to a display manager.

User directories

Well-known user directories like Downloads or Music are created by the xdg-user-dirs-update.service user service, that is provided by xdg-user-dirs and enabled by default upon install. If your desktop environment or window manager does not pull in the package, you can install it and run xdg-user-dirs-update manually as per XDG user directories#Creating default directories.

Power management

This section may be of use to laptop owners or users otherwise seeking power management controls. See Category:Power management for more.

Читайте также:  Linux для ноутбука samsung

See Power management for more general overview.

ACPI events

Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop’s lid. For the new (recommended) method using systemd, see Power management with systemd. For the old method, see acpid.

CPU frequency scaling

Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to more quiet system and prolongs the life of hardware. See CPU frequency scaling for details.

Laptops

For articles related to portable computing along with model-specific installation guides, please see Category:Laptops. For a general overview of laptop-related articles and recommendations, see Laptop.

Suspend and hibernate

Multimedia

Category:Multimedia includes additional resources.

Sound system

ALSA is a kernel sound system that should work out the box (it just needs to be unmuted). Sound servers such as PulseAudio and PipeWire can offer additional features and support more complex audio configuration.

See Professional audio for advanced audio requirements.

Networking

This section is confined to small networking procedures. See Network configuration for a full configuration guide and Category:Networking for related articles.

Clock synchronization

The Network Time Protocol (NTP) is a protocol for synchronizing the clocks of computer systems over packet-switched, variable-latency data networks. See Time synchronization for implementations of such protocol.

DNS security

For better security while browsing the web, paying online, connecting to SSH services and similar tasks consider using DNSSEC-enabled DNS resolver that can validate signed DNS records, and an encrypted protocol such as DNS over TLS, DNS over HTTPS or DNSCrypt. See Domain name resolution for details.

Setting up a firewall

A firewall can provide an extra layer of protection on top of the Linux networking stack. While the stock Arch kernel is capable of using Netfilter’s iptables and nftables, neither are enabled by default. It is highly recommended to set up some form of firewall. See Category:Firewalls for available guides.

Network shares

To share files among the machines in a network, follow the NFS or the SSHFS article.

Use Samba to join a Windows network. To configure the machine to use Active Directory for authentication, read Active Directory integration.

Input devices

This section contains popular input device configuration tips. See Category:Input devices for more.

Keyboard layouts

Non-English or otherwise non-standard keyboards may not function as expected by default. The necessary steps to configure the keymap are different for virtual console and Xorg, they are described in Keyboard configuration in console and Keyboard configuration in Xorg respectively.

Mouse buttons

Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in Mouse buttons.

Laptop touchpads

Many laptops use Synaptics or ALPS «touchpad» pointing devices. For these, and several other touchpad models, you can use either the Synaptics input driver or libinput; see Touchpad Synaptics and libinput for installation and configuration details.

TrackPoints

See the TrackPoint article to configure your TrackPoint device.

Optimization

This section aims to summarize tweaks, tools and available options useful to improve system and application performance.

Benchmarking

Benchmarking is the act of measuring performance and comparing the results to another system’s results or a widely accepted standard through a unified procedure.

Improving performance

The Improving performance article gathers information and is a basic rundown about gaining performance in Arch Linux.

Solid state drives

The Solid State Drives article covers many aspects of solid state drives, including configuring them to maximize their lifetimes.

System services

This section relates to daemons.

Most distributions have a locate command available to be able to quickly search files. Arch Linux provides several alternatives, see locate for details.

Desktop search engines provide a similar service, while better integrated into desktop environments.

Local mail delivery

A default setup does not provide a way to synchronize mail. A list of mail delivery agents is available in the Mail server article.

Printing

CUPS is a standards-based, open source printing system developed by Apple. See Category:Printers for printer-specific articles.

Appearance

This section contains frequently-sought «eye candy» tweaks for an aesthetically pleasing Arch experience. See Category:Eye candy for more.

Fonts

You may wish to install a set of TrueType fonts, as only unscalable bitmap fonts are included in a basic Arch system. There are several general-purpose font families providing large Unicode coverage and even metric compatibility with fonts from other operating systems.

A plethora of information on the subject can be found in the Fonts and Font configuration articles.

If spending a significant amount of time working from the virtual console (i.e. outside an X server), users may wish to change the console font to improve readability; see Linux console#Fonts.

GTK and Qt themes

A big part of the applications with a graphical interface for Linux systems are based on the GTK or the Qt toolkits. See those articles and Uniform look for Qt and GTK applications for ideas to improve the appearance of your installed programs and adapt it to your liking.

Console improvements

This section applies to small modifications that improve console programs’ practicality. See Category:Command-line shells for more.

Tab-completion enhancements

It is recommended to properly set up extended tab completion right away, as instructed in the article of your chosen shell.

Aliases

Aliasing a command, or a group thereof, is a way of saving time when using the console. This is especially helpful for repetitive tasks that do not need significant alteration to their parameters between executions. Common time-saving aliases can be found in Bash#Aliases, which are easily portable to zsh as well.

Alternative shells

Bash is the shell installed by default in an Arch system. The live installation media, however, uses zsh with the grml-zsh-config addon package. See Command-line shell#List of shells for more alternatives.

Bash additions

A list of miscellaneous Bash settings, history search and Readline macros is available in Bash#Tips and tricks.

Colored output

This section is covered in Color output in console.

Compressed files

Compressed files, or archives, are frequently encountered on a GNU/Linux system. Tar is one of the most commonly used archiving tools, and users should be familiar with its syntax (Arch Linux packages, for example, are simply zstd compressed tarballs). See Archiving and compression.

Console prompt

The console prompt ( PS1 ) can be customized to a great extent. See Bash/Prompt customization or Zsh#Prompts if using Bash or Zsh, respectively.

Emacs shell

Emacs is known for featuring options beyond the duties of regular text editing, one of these being a full shell replacement. Consult Emacs#Colored output issues for a fix regarding garbled characters that may result from enabling colored output.

Mouse support

Using a mouse with the console for copy-paste operations can be preferred over GNU Screen’s traditional copy mode. Refer to General purpose mouse for comprehensive directions. Note that you can already do this in terminal emulators with the clipboard.

Session management

Using terminal multiplexers like tmux or GNU Screen, programs may be run under sessions composed of tabs and panes that can be detached at will, so when the user either kills the terminal emulator, terminates X, or logs off, the programs associated with the session will continue to run in the background as long as the terminal multiplexer server is active. Interacting with the programs requires reattaching to the session.

Источник

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