https://wiki.archlinux.org/api.php?action=feedcontributions&user=Zfjagann&feedformat=atomArchWiki - User contributions [en]2024-03-28T23:35:58ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Chef&diff=404050Chef2015-10-10T19:00:35Z<p>Zfjagann: Undo revision 404048 by Zfjagann (talk)</p>
<hr />
<div>[[Category:System administration]]<br />
[[Category:Web server]]<br />
[http://chef.io/ Chef] is a configuration management tool written in Ruby and Erlang. It uses a pure-Ruby, domain-specific language (DSL) for writing system configuration "recipes". Chef is used to streamline the task of configuring and maintaining a company's servers, and can integrate with cloud-based platforms such as Rackspace, Internap, Amazon EC2, Google Cloud Platform, OpenStack, SoftLayer, and Microsoft Azure to automatically provision and configure new machines. Chef contains solutions for both small and large scale systems, with features and pricing for the respective ranges.<br />
<br />
== Chef Development Kit ==<br />
<br />
[https://downloads.chef.io/chef-dk/ Chef Development Kit] (ChefDK) is a streamlined development and deployment workflow for Chef platform. It includes:<br />
<br />
* Chef<br />
* Berkshelf<br />
* Test Kitchen<br />
* ChefSpec<br />
* Foodcritic<br />
<br />
=== Installation ===<br />
<br />
Install the {{AUR|chef-dk}} package from AUR. This is the recommend installation method to get <code>chef-client</code>, <code>chef-solo</code>, <code>chef-zero</code>, <code>chef-apply</code> and <code>chef-shell</code> (typically for use on workstations).<br />
<br />
== Omnibus Chef Installer ==<br />
<br />
A monolithic package that provides Chef.<br />
<br />
=== Installation by Package ===<br />
<br />
Install the {{AUR|omnibus-chef}}{{Broken package link|{{aur-mirror|omnibus-chef}}}} package from AUR. If not using an AUR helper, first install the needed dependency, {{AUR|ruby-bundler}}.<br />
<br />
This package builds and installs an omnibus Makeself installer for Chef. If you choose not to run the installer upon installation of the package, you can run it any time:<br />
<br />
# /usr/local/bin/chef-installer<br />
<br />
=== Installing from Source ===<br />
<br />
<nowiki>$ git clone https://github.com/opscode/omnibus-chef.git</nowiki><br />
$ cd omnibus-chef<br />
<br />
Wipe out any previous installations and the omnibus cache:<br />
<br />
# rm -Rf /opt/chef/* /var/cache/omnibus/*<br />
<br />
Set up the directories and change the ownership to yourself so building as root is not required:<br />
<br />
# mkdir -p /opt/chef /var/cache/omnibus<br />
# chown -R "$USER:users" /opt/chef<br />
# chown -R "$USER:users" /var/cache/omnibus<br />
<br />
Run the following to build:<br />
<br />
$ bundle install --binstubs<br />
$ bundle exec omnibus clean chef<br />
$ bundle exec omnibus build chef<br />
<br />
After that, you may like to change the ownership of directories back to the system:<br />
<br />
# chown -R root:root /opt/chef<br />
# chown -R root:root /var/cache/omnibus<br />
<br />
A Makeself portable installer will be created, e.g. chef-11.8.2_0.arch.3.12.6-1-ARCH.sh.<br />
Run this executable to install chef.<br />
<br />
=== Uninstallation ===<br />
<br />
Remove all installation files manually:<br />
<br />
# rm -Rf /opt/chef<br />
<br />
You can also ensure the omnibus cache is removed:<br />
<br />
# rm -Rf /var/cache/omnibus<br />
<br />
== Other Installation Methods ==<br />
<br />
{{Note|Do not use these methods. It is recommended to install ChefDk or use the Omnibus installer method (see above). This section is included only for completeness-sake.}}<br />
<br />
=== By Package ===<br />
<br />
Install the {{AUR|ruby-chef}} package from AUR.<br />
<br />
=== By RubyGem ===<br />
<br />
This is one of easiest ways to install Chef, but it is highly not recommended. If you already have gem versions of the dependencies installed to the system you could run into conflicts.<br />
<br />
Ensure you first [[pacman|install]] the {{Pkg|ruby}} package from the [[official repositories]]. This also provides RubyGems.<br />
<br />
Next, install the Chef RubyGem:<br />
<br />
# gem install chef</div>Zfjagannhttps://wiki.archlinux.org/index.php?title=Chef&diff=404048Chef2015-10-10T18:52:05Z<p>Zfjagann: Removed link to missing chef package.</p>
<hr />
<div>[[Category:System administration]]<br />
[[Category:Web server]]<br />
[http://chef.io/ Chef] is a configuration management tool written in Ruby and Erlang. It uses a pure-Ruby, domain-specific language (DSL) for writing system configuration "recipes". Chef is used to streamline the task of configuring and maintaining a company's servers, and can integrate with cloud-based platforms such as Rackspace, Internap, Amazon EC2, Google Cloud Platform, OpenStack, SoftLayer, and Microsoft Azure to automatically provision and configure new machines. Chef contains solutions for both small and large scale systems, with features and pricing for the respective ranges.<br />
<br />
== Chef Development Kit ==<br />
<br />
[https://downloads.chef.io/chef-dk/ Chef Development Kit] (ChefDK) is a streamlined development and deployment workflow for Chef platform. It includes:<br />
<br />
* Chef<br />
* Berkshelf<br />
* Test Kitchen<br />
* ChefSpec<br />
* Foodcritic<br />
<br />
=== Installation ===<br />
<br />
Install the {{AUR|chef-dk}} package from AUR. This is the recommend installation method to get <code>chef-client</code>, <code>chef-solo</code>, <code>chef-zero</code>, <code>chef-apply</code> and <code>chef-shell</code> (typically for use on workstations).<br />
<br />
== Omnibus Chef Installer ==<br />
<br />
A monolithic package that provides Chef.<br />
<br />
=== Installation by Package ===<br />
<br />
Install the {{AUR|chef-dk}} package from AUR. If not using an AUR helper, first install the needed dependency, {{AUR|ruby-bundler}}.<br />
<br />
This package builds and installs an omnibus Makeself installer for Chef. If you choose not to run the installer upon installation of the package, you can run it any time:<br />
<br />
# /usr/local/bin/chef-installer<br />
<br />
=== Installing from Source ===<br />
<br />
<nowiki>$ git clone https://github.com/opscode/omnibus-chef.git</nowiki><br />
$ cd omnibus-chef<br />
<br />
Wipe out any previous installations and the omnibus cache:<br />
<br />
# rm -Rf /opt/chef/* /var/cache/omnibus/*<br />
<br />
Set up the directories and change the ownership to yourself so building as root is not required:<br />
<br />
# mkdir -p /opt/chef /var/cache/omnibus<br />
# chown -R "$USER:users" /opt/chef<br />
# chown -R "$USER:users" /var/cache/omnibus<br />
<br />
Run the following to build:<br />
<br />
$ bundle install --binstubs<br />
$ bundle exec omnibus clean chef<br />
$ bundle exec omnibus build chef<br />
<br />
After that, you may like to change the ownership of directories back to the system:<br />
<br />
# chown -R root:root /opt/chef<br />
# chown -R root:root /var/cache/omnibus<br />
<br />
A Makeself portable installer will be created, e.g. chef-11.8.2_0.arch.3.12.6-1-ARCH.sh.<br />
Run this executable to install chef.<br />
<br />
=== Uninstallation ===<br />
<br />
Remove all installation files manually:<br />
<br />
# rm -Rf /opt/chef<br />
<br />
You can also ensure the omnibus cache is removed:<br />
<br />
# rm -Rf /var/cache/omnibus<br />
<br />
== Other Installation Methods ==<br />
<br />
{{Note|Do not use these methods. It is recommended to install ChefDk or use the Omnibus installer method (see above). This section is included only for completeness-sake.}}<br />
<br />
=== By Package ===<br />
<br />
Install the {{AUR|ruby-chef}} package from AUR.<br />
<br />
=== By RubyGem ===<br />
<br />
This is one of easiest ways to install Chef, but it is highly not recommended. If you already have gem versions of the dependencies installed to the system you could run into conflicts.<br />
<br />
Ensure you first [[pacman|install]] the {{Pkg|ruby}} package from the [[official repositories]]. This also provides RubyGems.<br />
<br />
Next, install the Chef RubyGem:<br />
<br />
# gem install chef</div>Zfjagannhttps://wiki.archlinux.org/index.php?title=Pacman&diff=379752Pacman2015-06-22T18:33:52Z<p>Zfjagann: Removed reference to whoneeds and pactree since pacman provides the information in Qi</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Package management]]<br />
[[ar:Pacman]]<br />
[[cs:Pacman]]<br />
[[da:Pacman]]<br />
[[de:Pacman]]<br />
[[el:Pacman]]<br />
[[es:Pacman]]<br />
[[fr:Pacman]]<br />
[[id:Pacman]]<br />
[[it:Pacman]]<br />
[[ja:Pacman]]<br />
[[ko:Pacman]]<br />
[[lt:Pacman]]<br />
[[nl:Pacman]]<br />
[[pl:Pacman]]<br />
[[pt:Pacman]]<br />
[[ro:Pacman]]<br />
[[ru:Pacman]]<br />
[[sr:Pacman]]<br />
[[sv:Pacman]]<br />
[[tr:pacman]]<br />
[[uk:Pacman]]<br />
[[zh-CN:Pacman]]<br />
[[zh-TW:Pacman]]<br />
{{Related articles start}}<br />
{{Related|Downgrading packages}}<br />
{{Related|Improve pacman performance}}<br />
{{Related|pacman GUI Frontends}}<br />
{{Related|pacman Rosetta}}<br />
{{Related|pacman tips}}<br />
{{Related|pacman package signing}}<br />
{{Related|FAQ#Package Management}}<br />
{{Related|pacman-key}}<br />
{{Related|Pacnew and Pacsave files}}<br />
{{Related|List of Applications/Utilities#Package management}}<br />
{{Related|Arch Build System}}<br />
{{Related|Official repositories}}<br />
{{Related|Arch User Repository}}<br />
{{Related articles end}}<br />
<br />
The [https://www.archlinux.org/pacman/ pacman] [[Wikipedia:Package management system|package manager]] is one of the major distinguishing features of Arch Linux. It combines a simple binary package format with an easy-to-use [[Arch Build System|build system]]. The goal of ''pacman'' is to make it possible to easily manage packages, whether they are from the [[official repositories]] or the user's own builds.<br />
<br />
''pacman'' keeps the system up to date by synchronizing package lists with the master server. This server/client model also allows the user to download/install packages with a simple command, complete with all required dependencies.<br />
<br />
''pacman'' is written in the C programming language and uses the ''.pkg.tar.xz'' package format.<br />
<br />
{{Tip|The official {{Pkg|pacman}} package also contains other useful tools, such as '''makepkg''', '''pactree''', '''vercmp''', and [[#Partial upgrades are unsupported|checkupdates]]. Run {{ic|pacman -Ql pacman <nowiki>|</nowiki> grep bin}} to see the full list.}}<br />
<br />
== Configuration ==<br />
<br />
''pacman'''s settings are located in {{ic|/etc/pacman.conf}}. This is the place where the user configures the program to work in the desired manner. In-depth information about the configuration file can be found in [https://www.archlinux.org/pacman/pacman.conf.5.html man pacman.conf].<br />
<br />
=== General options ===<br />
<br />
General options are in the {{ic|[options]}} section. Read the [[man page]] or look in the default {{ic|pacman.conf}} for information on what can be done here.<br />
<br />
==== Skip package from being upgraded ====<br />
<br />
To have a specific package skipped when [[#Upgrading packages|upgrading]] the system, specify it as such:<br />
<br />
IgnorePkg=linux<br />
<br />
For multiple packages use a space-separated list, or use additional {{ic|IgnorePkg}} lines. Also, glob patterns can be used. If you want to skip packages just once, you can also use the {{ic|--ignore}} option on the command-line - this time with a comma-separated list.<br />
<br />
It will still be possible to upgrade the ignored packages using {{ic|pacman -S}}: in this case ''pacman'' will remind you that the packages have been included in an {{ic|IgnorePkg}} statement.<br />
<br />
==== Skip package group from being upgraded ====<br />
<br />
As with packages, skipping a whole package group is also possible:<br />
<br />
IgnoreGroup=gnome<br />
<br />
==== Skip files from being installed to system ====<br />
<br />
To always skip installation of specific directories list them under {{Ic|NoExtract}}. For example, to avoid installation of [[systemd]] units use this:<br />
<br />
NoExtract=usr/lib/systemd/system/*<br />
<br />
=== Repositories ===<br />
<br />
This section defines which [[Official repositories|repositories]] to use, as referred to in {{ic|/etc/pacman.conf}}. They can be stated here directly or included from another file (such as {{ic|/etc/pacman.d/mirrorlist}}), thus making it necessary to maintain only one list. See [[Mirrors]] article for mirror configuration.<br />
<br />
{{hc|/etc/pacman.conf|2=<br />
#[testing]<br />
#SigLevel = PackageRequired<br />
#Include = /etc/pacman.d/mirrorlist<br />
<br />
[core]<br />
SigLevel = PackageRequired<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
[extra]<br />
SigLevel = PackageRequired<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
#[community-testing]<br />
#SigLevel = PackageRequired<br />
#Include = /etc/pacman.d/mirrorlist<br />
<br />
[community]<br />
SigLevel = PackageRequired<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
# If you want to run 32 bit applications on your x86_64 system,<br />
# enable the multilib repositories as required here.<br />
<br />
#[multilib-testing]<br />
#SigLevel = PackageRequired<br />
#Include = /etc/pacman.d/mirrorlist<br />
<br />
#[multilib]<br />
#SigLevel = PackageRequired<br />
#Include = /etc/pacman.d/mirrorlist<br />
<br />
# An example of a custom package repository. See the pacman manpage for<br />
# tips on creating your own repositories.<br />
#[custom]<br />
#SigLevel = Optional TrustAll<br />
#Server = file:///home/custompkgs}}<br />
<br />
{{Warning|Care should be taken when using the ''testing'' repository. It is in active development and updating may cause some packages to stop working. People who use the ''testing'' repository are encouraged to subscribe to the [https://mailman.archlinux.org/mailman/listinfo/arch-dev-public arch-dev-public mailing list] for current information.}}<br />
<br />
=== Package security ===<br />
<br />
''pacman'' 4 supports package signatures, which add an extra layer of security to the packages. The default configuration, {{ic|1=SigLevel = Required DatabaseOptional}}, enables signature verification for all the packages on a global level: this can be overridden by per-repository {{ic|SigLevel}} lines as shown above. For more details on package signing and signature verification, take a look at [[pacman-key]].<br />
<br />
== Usage ==<br />
<br />
What follows is just a small sample of the operations that ''pacman'' can perform. To read more examples, refer to [https://www.archlinux.org/pacman/pacman.8.html man pacman]. For an introduction, see [[pacman - An Introduction]].<br />
<br />
{{Tip|For those who have used other Linux distributions before, there is a helpful [[Pacman Rosetta]] article. ''pacman'' operates at a lower level compared to e.g. ''yum'' or ''apt'': this requires more attention from users, but it also empowers them with better control over their systems.}}<br />
<br />
=== Installing packages ===<br />
<br />
{{Note|Packages often have a series of [[PKGBUILD#optdepends|optdepends]] that, while not mandatory, provide additional functionality. You may refer to this information at will by [[#Querying package databases]].}}<br />
<br />
{{Warning|1=When installing packages, do '''not''' refresh the package list without [[#Upgrading packages|upgrading]] the system (i.e. {{ic|pacman -Sy ''package_name''}}); this can lead to dependency issues. See [[#Partial upgrades are unsupported]] and https://bbs.archlinux.org/viewtopic.php?id=89328.}}<br />
<br />
==== Installing specific packages ====<br />
<br />
To install a single package or list of packages (including dependencies), issue the following command:<br />
<br />
# pacman -S ''package_name1'' ''package_name2'' ...<br />
<br />
To install a list of packages with regex (see [[pacman tips#Operations and Bash syntax]] and [https://bbs.archlinux.org/viewtopic.php?id=7179 this forum thread]):<br />
<br />
# pacman -S $(pacman -Ssq ''package_regex'')<br />
<br />
Sometimes there are multiple versions of a package in different repositories, e.g. ''extra'' and ''testing''. To install the former version, the repository needs to be defined in front:<br />
<br />
# pacman -S extra/''package_name''<br />
<br />
==== Installing package groups ====<br />
<br />
Some packages belong to a group of packages that can all be installed simultaneously. For example, issuing the command:<br />
<br />
# pacman -S gnome<br />
<br />
will prompt you to select the packages from the {{Grp|gnome}} group that you wish to install.<br />
<br />
Sometimes a package group will contain a large amount of packages, and there may be only a few that you do or do not want to install. Instead of having to enter all the numbers except the ones you do not want, it is sometimes more convenient to select or exclude packages or ranges of packages with the following syntax:<br />
<br />
Enter a selection (default=all): 1-10 15<br />
<br />
which will select packages 1 through 10 and 15 for installation, or:<br />
<br />
Enter a selection (default=all): ^5-8 ^2<br />
<br />
which will select all packages except 5 through 8 and 2 for installation.<br />
<br />
To see what packages belong to the gnome group, run:<br />
<br />
# pacman -Sg gnome<br />
<br />
Also visit https://www.archlinux.org/groups/ to see what package groups are available.<br />
<br />
{{Note|If a package in the list is already installed on the system, it will be reinstalled even if it is already up to date. This behavior can be overridden with the {{ic|--needed}} option.}}<br />
<br />
=== Removing packages ===<br />
<br />
To remove a single package, leaving all of its dependencies installed:<br />
<br />
# pacman -R ''package_name''<br />
<br />
To remove a package and its dependencies which are not required by any other installed package:<br />
<br />
# pacman -Rs ''package_name''<br />
<br />
To remove a package, its dependencies and all the packages that depend on the target package:<br />
<br />
{{Warning|This operation is recursive, and must be used with care since it can remove many potentially needed packages.}}<br />
<br />
# pacman -Rsc ''package_name''<br />
<br />
To remove a package, which is required by another package, without removing the dependent package:<br />
<br />
# pacman -Rdd ''package_name''<br />
<br />
''pacman'' saves important configuration files when removing certain applications and names them with the extension: ''.pacsave''. To prevent the creation of these backup files use the {{ic|-n}} option:<br />
<br />
# pacman -Rn ''package_name''<br />
<br />
{{Note|''pacman'' will not remove configurations that the application itself creates (for example "dotfiles" in the home folder).}}<br />
<br />
=== Upgrading packages ===<br />
<br />
''pacman'' can update all packages on the system with just one command. This could take quite a while depending on how up-to-date the system is. This command can synchronize the repository databases ''and'' update the system's packages (excluding 'local' packages that are not in the configured repositories):<br />
<br />
# pacman -Syu<br />
<br />
{{Warning|Instead of immediately updating as soon as updates are available, users must recognize that due to the nature of Arch's rolling release approach, an update may have unforeseen consequences. This means that it is not wise to update if, for example, one is about to deliver an important presentation. Rather, update during free time and be prepared to deal with any problems that may arise.}}<br />
<br />
''pacman'' is a powerful package management tool, but it does not attempt to handle all corner cases. Read [[The Arch Way]] if this causes confusion. Users must be vigilant and take responsibility for maintaining their own system. '''When performing a system update, it is essential that users read all information output by ''pacman'' and use common sense.''' If a user-modified configuration file needs to be upgraded for a new version of a package, a ''.pacnew'' file will be created to avoid overwriting settings modified by the user. ''pacman'' will prompt the user to merge them. These files require manual intervention from the user and it is good practice to handle them right after every package upgrade or removal. See [[Pacnew and Pacsave files]] for more info.<br />
<br />
{{Tip|Remember that ''pacman'''s output is logged in {{ic|/var/log/pacman.log}}.}}<br />
<br />
{{Tip|You can use a log viewer such as {{AUR|wat-git}} to search the pacman logs.}}<br />
<br />
Before upgrading, it is advisable to visit the [https://www.archlinux.org/ Arch Linux home page] to check the latest news (alternatively subscribe to the [https://www.archlinux.org/feeds/news/ RSS feed], [https://mailman.archlinux.org/mailman/listinfo/arch-announce/ arch-announce mailing list], or follow [https://twitter.com/archlinux @archlinux] on Twitter), 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.<br />
<br />
If one encounters problems that cannot be solved by these instructions, make sure to search the forum. It is likely that others have encountered the same problem and have posted instructions for solving it.<br />
<br />
==== Partial upgrades are unsupported ====<br />
<br />
Arch Linux is a rolling release, and new [[Wikipedia:Library (computing)|library]] versions will be pushed to the repositories. The developers and Trusted Users will rebuild all the packages in the repositories that need to be rebuilt against the libraries. If the system has locally installed packages (such as [[AUR]] packages), users will need to rebuild them when their dependencies receive a [[Wikipedia:soname|soname]] bump.<br />
<br />
This means that partial upgrades are '''not supported'''. Do not use {{ic|pacman -Sy package}} or any equivalent such as {{ic|pacman -Sy}} and then {{ic|pacman -S package}}. Always upgrade before installing a package -- particularly if ''pacman'' has refreshed the sync repositories. Be very careful when using {{ic|IgnorePkg}} and {{ic|IgnoreGroup}} for the same reason.<br />
<br />
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 [[Wikipedia:soname|soname]] bumps when they are '''not backwards compatible'''. A simple {{ic|pacman -Syu}} to a properly synced mirror will fix the problem as long as ''pacman'' is not broken.<br />
<br />
The bash script '''checkupdates''', included with the pacman package, provides a safe way to check for upgrades to installed packages without running a system update at the same time.<br />
<br />
=== Querying package databases ===<br />
<br />
''pacman'' queries the local package database with the {{ic|-Q}} flag; see:<br />
<br />
$ pacman -Q --help<br />
<br />
and queries the sync databases with the {{ic|-S}} flag; see:<br />
<br />
$ pacman -S --help<br />
<br />
''pacman'' can search for packages in the database, searching both in packages' names and descriptions:<br />
<br />
$ pacman -Ss ''string1'' ''string2'' ...<br />
<br />
To search for already installed packages:<br />
<br />
$ pacman -Qs ''string1'' ''string2'' ...<br />
<br />
To display extensive information about a given package:<br />
<br />
$ pacman -Si ''package_name''<br />
<br />
For locally installed packages:<br />
<br />
$ pacman -Qi ''package_name''<br />
<br />
Passing two {{ic|-i}} flags will also display the list of backup files and their modification states:<br />
<br />
$ pacman -Qii ''package_name''<br />
<br />
To retrieve a list of the files installed by a package:<br />
<br />
$ pacman -Ql ''package_name''<br />
<br />
For packages not installed, use [[pkgfile]].<br />
<br />
To verify the presence of the files installed by a package:<br />
<br />
$ pacman -Qk ''package_name''<br />
<br />
Passing the {{ic|k}} flag twice will perform a more thorough check.<br />
<br />
One can also query the database to know which package a file in the file system belongs to:<br />
<br />
$ pacman -Qo ''/path/to/file_name''<br />
<br />
To list all packages no longer required as dependencies (orphans):<br />
<br />
$ pacman -Qdt<br />
<br />
To list all packages explicitly installed and not required as dependencies:<br />
<br />
$ pacman -Qet<br />
<br />
To list a dependency tree of a package:<br />
<br />
$ pactree ''package_name''<br />
<br />
To list all the packages depending on an ''installed'' package, use the {{ic|Qi}} flag and look at the {{ic|Required By}} field:<br />
<br />
$ pacman -Qi ''package_name''<br />
<br />
See [[pacman tips]] for more examples.<br />
<br />
=== Cleaning the package cache ===<br />
<br />
''pacman'' stores its downloaded packages in {{ic|/var/cache/pacman/pkg/}} and does not remove the old or uninstalled versions automatically, therefore it is necessary to deliberately clean up that folder periodically to prevent such folder to grow indefinitely in size.<br />
<br />
The built-in option to remove all the cached packages that are not currently installed is:<br />
<br />
# pacman -Sc<br />
<br />
{{Warning|<br />
* Only do this if certain that the installed packages are stable and that a [[downgrade]] will not be necessary, since it will remove all of the old versions from the cache folder, leaving behind only the versions of the packages that are currently installed. Having older versions of packages comes in handy in case a future upgrade results in a broken system, and if they are removed from the cache the only way to retrieve them is through an alternative source of deprecated packages such as the [[Arch Rollback Machine]].<br />
* It is also possible to completely empty the cache folder with {{ic|pacman -Scc}}, but doing it is considered bad practice, as, in addition to the above, it also prevents from reinstalling a package directly from the cache folder in case of need, thus forcing to redownload it. You should never use it unless there is a desperate need for more disk space.<br />
}}<br />
<br />
Because of the above limitations, it is recommended to use an alternative, dedicated script to have more control over which and how many packages are deleted from the cache:<br />
<br />
* The ''paccache'' command, provided by the {{Pkg|pacman}} package itself, by default deletes all the cached versions of each package except for the most recent 3: {{bc|$ paccache -r}} Used this way, however, ''paccache'' will ''not'' check whether a package is still installed or not, thus leaving the uninstalled packages in the cache. For removing all the cached versions of uninstalled packages, you will have to run it a second time with: {{bc|$ paccache -ruk0}} See {{ic|paccache -h}} for more options.<br />
* Alternatively, use {{AUR|pkgcacheclean}} from the [[AUR]]:<br />
:{{bc|# pkgcacheclean}}<br />
* Another option is {{AUR|pacleaner}} from the [[AUR]]: to check packages to sweep except the 3 most recent:<br />
:{{bc|$ pacleaner -m}}<br />
:To check uninstalled packages:<br />
:{{bc|$ pacleaner -u}}<br />
:Use it as root with the {{ic|--delete}} option to actually remove the packages. Default options such as the number of packages to keep or the path of the cache can be fine tuned in a configuration file.<br />
<br />
=== Additional commands ===<br />
<br />
Upgrade the system and install a list of packages (one-liner):<br />
<br />
# pacman -Syu ''package_name1'' ''package_name2'' ...<br />
<br />
Download a package without installing it:<br />
<br />
# pacman -Sw ''package_name''<br />
<br />
Install a 'local' package that is not from a remote repository (e.g. the package is from the [[AUR]]):<br />
<br />
# pacman -U /path/to/package/package_name-version.pkg.tar.xz<br />
<br />
{{Tip|To keep a copy of the local package in ''pacman'''s cache, use:<br />
# pacman -U file:///path/to/package/package_name-version.pkg.tar.xz<br />
}}<br />
<br />
Install a 'remote' package (not from a repository stated in ''pacman'''s configuration files):<br />
<br />
# pacman -U <nowiki>http://www.example.com/repo/example.pkg.tar.xz</nowiki><br />
<br />
=== General notes ===<br />
<br />
{{Warning|Take care when using the {{ic|--force}} switch because it can cause major problems if used improperly. It is highly recommended to ''only'' use this option when the Arch news instructs the user to do so.}}<br />
<br />
''pacman'' always lists packages to be installed or removed and asks for permission before it takes action. To inhibit the {{ic|-S}}, {{ic|-U}} and {{ic|-R}} actions, {{ic|-p}} can be used. <br />
<br />
''pacman'' ships with a number of other utilities that can make interacting with your system much simpler. Each utility can be invoked with the {{ic|--help}} switch to print command options. To see the full list, run:<br />
<br />
$ pacman -Ql pacman | awk -F"[/ ]" '/\/usr\/bin/ {print $5}'<br />
<br />
== Troubleshooting ==<br />
<br />
=== Package updates have broken my system ===<br />
<br />
Arch Linux is a rolling-release cutting-edge distribution. Package updates are available as soon as they are deemed stable enough for general use. However, updates sometimes require user intervention: configuration files may need to be updated, optional dependencies may change, etc.<br />
<br />
The most important tip to remember is to not "blindly" update Arch systems. Always read the list of packages to be updated. Note whether "critical" packages are going to be updated ({{Pkg|linux}}, {{Pkg|xorg-server}}, and so on). If so, it is usually a good idea to check for any news at https://www.archlinux.org/ and scan recent forum posts to see if people are experiencing problems as a result of an update.<br />
<br />
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 the log ({{ic|/var/log/pacman.log}}).<br />
<br />
At this point, '''only after ensuring there is no information available through ''pacman'', there is no relative news on https://www.archlinux.org/, and there are no forum posts regarding the update''', consider seeking help on the forum, over [[IRC]], or [[Downgrading packages|downgrading the offending package]].<br />
<br />
=== A package update was released, but pacman says the system is up to date ===<br />
<br />
''pacman'' mirrors are not synced immediately. It may take over 24 hours before an update is available to you. The only options are be patient or use another mirror. [https://www.archlinux.org/mirrors/status/ MirrorStatus] can help you identify an up-to-date mirror.<br />
<br />
=== "Failed to commit transaction (conflicting files)" error ===<br />
<br />
If you see the following error: [https://bbs.archlinux.org/viewtopic.php?id=56373]<br />
<br />
error: could not prepare transaction<br />
error: failed to commit transaction (conflicting files)<br />
''package'': ''/path/to/file'' exists in filesystem<br />
Errors occurred, no packages were upgraded.<br />
<br />
Why this is happening: ''pacman'' has detected a file conflict, and by design, will not overwrite files for you. This is a design feature, not a flaw.<br />
<br />
The problem is usually trivial to solve. A safe way is to first check if another package owns the file ({{ic|pacman -Qo ''/path/to/file''}}). If the file is owned by another package, [[Reporting bug guidelines|file a bug report]]. If the file is not owned by another package, rename the file which 'exists in filesystem' and re-issue the update command. If all goes well, the file may then be removed.<br />
<br />
If you had installed a program manually without using ''pacman'' or a frontend, for example through {{ic|make install}}, you have to remove it and all its files and reinstall properly using ''pacman''. See also [[Pacman tips#Identify files not owned by any package]].<br />
<br />
Every installed package provides a {{ic|/var/lib/pacman/local/''$package-$version''/files}} file that contains metadata about this package. If this file gets corrupted, is empty or goes missing, it results in {{ic|file exists in filesystem}} errors when trying to update the package. Such an error usually concerns only one package. Instead of manually renaming and later removing all the files that belong to the package in question, you may exceptionally run {{ic|pacman -S --force $package}} to force ''pacman'' to overwrite these files.<br />
<br />
{{Warning|Take care when using the {{ic|--force}} switch (for example {{ic|pacman -Syu --force}}) as it can cause major problems if used improperly. It is highly recommended to only use this option when the Arch news instructs the user to do so.}}<br />
<br />
=== "Failed to commit transaction (invalid or corrupted package)" error ===<br />
<br />
Look for ''.part'' files (partially downloaded packages) in {{ic|/var/cache/pacman/pkg}} and remove them (often caused by usage of a custom {{ic|XferCommand}} in {{ic|pacman.conf}}).<br />
<br />
# find /var/cache/pacman/pkg/ -iname "*.part" -exec rm {} \;<br />
<br />
=== "Failed to init transaction (unable to lock database)" error ===<br />
<br />
When ''pacman'' is about to alter the package database, for example installing a package, it creates a lock file at {{ic|/var/lib/pacman/db.lck}}. This prevents another instance of ''pacman'' from trying to alter the package database at the same time.<br />
<br />
If ''pacman'' is interrupted while changing the database, this stale lock file can remain. If you are certain that no instances of ''pacman'' are running then delete the lock file:<br />
<br />
# rm /var/lib/pacman/db.lck<br />
<br />
=== "Not found in sync db" error upon installing a package ===<br />
<br />
Firstly, ensure the package actually exists (and watch out for typos!). If certain the package exists, your package list may be out-of-date or your repositories may be incorrectly configured. Try running {{ic|pacman -Syyu}} to force a refresh of all package lists and upgrade.<br />
<br />
=== "Target not found" error upon installing a package ===<br />
<br />
Firstly, ensure the package actually exists (and watch out for typos). If certain the package exists, your package list may be out of date or your repositories may be incorrectly configured. Try running {{ic|pacman -Syyu}} to force a refresh of all package lists and upgrade.<br />
<br />
It could also be that the repository containing the package is not enabled on your system, e.g. the package could be in the ''multilib'' repository, but ''multilib'' is not enabled in your ''pacman.conf''.<br />
<br />
=== The same package is upgraded repeatedly ===<br />
<br />
{{Note|''pacman'' version 3.4 should display an error in case of duplicate entries, which should make this note obsolete.}}<br />
<br />
This is due to duplicate entries in {{ic|/var/lib/pacman/local/}}, such as two {{ic|linux}} instances. {{ic|pacman -Qi}} outputs the correct version, but {{ic|pacman -Qu}} recognizes the old version and therefore will attempt to upgrade.<br />
<br />
The solution is to delete the offending entry in {{ic|/var/lib/pacman/local/}}.<br />
<br />
=== pacman crashes during an upgrade ===<br />
<br />
In the case that ''pacman'' crashes with a "database write" error while removing packages, and reinstalling or upgrading packages fails thereafter, do the following:<br />
<br />
# Boot using the Arch install media.<br />
# Mount your root filesystem.<br />
# Update the pacman database and upgrade via {{ic|pacman -Syyu}}.<br />
# Reinstall the broken package via {{ic|pacman -r /path/to/root -S package}}.<br />
<br />
=== Search for a package that contains a specific file ===<br />
<br />
Install [[pkgfile]] which uses a separate database with all files and their associated packages.<br />
<br />
=== pacman is broken beyond repair ===<br />
<br />
{{Accuracy|Any broken dependency of ''pacman'' also breaks ''pacman'', but many dependencies are not mentioned (run {{ic|<nowiki>pactree -l pacman | sort -u | cut -f 1 -d ' '</nowiki>}} to see them all). The info below is likely just a specific case where only two dependencies were broken.}}<br />
<br />
In the case that ''pacman'' is broken beyond repair, manually download the necessary packages ({{Pkg|openssl}}, {{Pkg|libarchive}}, and {{Pkg|pacman}}) and extract them to root. The ''pacman'' binary will be restored along with its default configuration file. Afterwards, reinstall these packages with ''pacman'' to maintain package database integrity. Additional information and an example (outdated) script that automates the process is available in [https://bbs.archlinux.org/viewtopic.php?id=95007 this] forum post.<br />
<br />
=== "Unable to find root device" error after rebooting ===<br />
<br />
Most likely your initramfs got broken during a kernel update (improper use of ''pacman'''s {{ic|--force}} option can be a cause). You have two options; first, try the ''Fallback'' entry:<br />
<br />
{{Tip|In case you removed this entry for whatever reason, you can always press the {{ic|Tab}} key when the bootloader menu shows up (for Syslinux) or {{ic|e}} (for GRUB or gummiboot), rename it {{ic|initramfs-linux-fallback.img}} and press {{ic|Enter}} or {{ic|b}} (depending on your bootloader) to boot with the new parameters.}}<br />
<br />
Once the system starts, run this command (for the stock {{Pkg|linux}} kernel) either from the console or from a terminal to rebuild the initramfs image:<br />
<br />
# mkinitcpio -p linux<br />
<br />
If that does not work, from a current Arch release (CD/DVD or USB stick), run:<br />
<br />
{{Note|If you do not have a current release or if you only have some other "live" Linux distribution laying around, you can [[chroot]] using the old fashion way. Obviously, there will be more typing than simply running the {{ic|arch-chroot}} script.}}<br />
<br />
# mount /dev/sdxY /mnt # Your root partition.<br />
# mount /dev/sdxZ /mnt/boot # If you use a separate /boot partition.<br />
# arch-chroot /mnt<br />
# pacman -Syu mkinitcpio systemd linux<br />
<br />
{{Note|If ''pacman'' fails with {{ic|Could not resolve host}}, please [[Network_configuration#Check_the_connection|check your internet connection]].}}<br />
<br />
Reinstalling the kernel (the {{Pkg|linux}} package) will automatically re-generate the initramfs image with {{ic|mkinitcpio -p linux}}. There is no need to do this separately.<br />
<br />
Afterwards, it is recommended that you run {{ic|exit}}, {{ic|umount /mnt/{boot,} }} and {{ic|reboot}}.<br />
<br />
{{Note|If you cannot enter the arch-chroot or chroot environment but need to re-install packages you can use the command {{ic|pacman -r /mnt -Syu foo bar}} to use ''pacman'' on your root partition.}}<br />
<br />
=== Signature from "User <email@gmail.com>" is unknown trust, installation failed ===<br />
<br />
Follow [[pacman-key#Resetting all the keys]]. Or you can try to either:<br />
* update the known keys, i.e. {{ic|pacman-key --refresh-keys}};<br />
* or manually upgrade {{Pkg|archlinux-keyring}} package first, i.e. {{ic|pacman -S archlinux-keyring}}.<br />
<br />
=== Request on importing PGP keys ===<br />
<br />
If [[Installation guide|installing]] Arch with an outdated ISO, you are likely prompted to import PGP keys. Agree to download the key to proceed. If you are unable to add the PGP key successfully, update the keyring or upgrade {{Pkg|archlinux-keyring}} (see [[#Signature from "User <email@gmail.com>" is unknown trust, installation failed|above]]).<br />
<br />
=== Signature from "User <email@archlinux.org>" is invalid, installation failed ===<br />
<br />
When the system time is faulty, signing keys are considered expired (or invalid) and signature checks on packages will fail with the following error:<br />
<br />
error: ''package'': signature from "User <email@archlinux.org>" is invalid<br />
error: failed to commit transaction (invalid or corrupted package (PGP signature))<br />
Errors occured, no packages were upgraded.<br />
<br />
Make sure to correct the [[time]], for example with {{ic|ntpd -qg}} run as root, and run {{ic|hwclock -w}} as root before subsequent installations or upgrades.<br />
<br />
=== "Warning: current locale is invalid; using default "C" locale" error ===<br />
<br />
As the error message says, your locale is not correctly configured. See [[Locale]].<br />
<br />
=== pacman does not honor proxy settings ===<br />
<br />
Make sure that the relevant environment variables ({{ic|$http_proxy}}, {{ic|$ftp_proxy}} etc.) are set up. If you use ''pacman'' with [[sudo]], you need to configure sudo to [[sudo#Environment variables|pass these environment variables to pacman]].<br />
<br />
=== How do I reinstall all packages, retaining information on whether something was explicitly installed or as a dependency? ===<br />
<br />
To reinstall all the native packages: {{ic|<nowiki>pacman -Qnq | pacman -S -</nowiki>}} (the {{ic|-S}} option preserves the installation reason by default).<br />
<br />
You will then need to reinstall all the foreign packages, which can be listed with {{ic|pacman -Qmq}}.<br />
<br />
=== "Cannot open shared object file" error ===<br />
<br />
It looks like previous ''pacman'' transaction removed or corrupted shared libraries needed for pacman itself.<br />
<br />
To recover from this situation you need to unpack required libraries to your filesystem manually. First find what package contains the missed library and then locate it in the ''pacman'' cache ({{ic|/var/cache/pacman/pkg/}}). Unpack required shared library to the filesystem. This will allow to run ''pacman''.<br />
<br />
Now you need to [[#Installing specific packages|reinstall]] the broken package. Note that you need to use {{ic|--force}} flag as you just unpacked system files and ''pacman'' does not know about it. ''pacman'' will correctly replace our shared library file with one from package.<br />
<br />
That's it. Update the rest of the system.<br />
<br />
=== Freeze of package downloads ===<br />
<br />
Some issues have been reported regarding network problems that prevent ''pacman'' from updating/synchronizing repositories. [https://bbs.archlinux.org/viewtopic.php?id&#61;68944] [https://bbs.archlinux.org/viewtopic.php?id&#61;65728] When installing Arch Linux natively, these issues have been resolved by replacing the default ''pacman'' file downloader with an alternative (see [[Improve pacman performance]] for more details). When installing Arch Linux as a guest OS in [[VirtualBox]], this issue has also been addressed by using ''Host interface'' instead of ''NAT'' in the machine properties.<br />
<br />
=== Failed retrieving file 'core.db' from mirror ===<br />
<br />
If you receive this error message with correct [[mirrors]], try setting a different [[Resolv.conf|name server]].<br />
<br />
== See also ==<br />
<br />
* [https://www.archlinux.org/pacman/ Pacman's homepage]<br />
* [https://www.archlinux.org/pacman/libalpm.3.html libalpm(3) Manual Page]<br />
* [https://www.archlinux.org/pacman/pacman.8.html pacman(8) Manual Page]<br />
* [https://www.archlinux.org/pacman/pacman.conf.5.html pacman.conf(5) Manual Page]<br />
* [https://www.archlinux.org/pacman/repo-add.8.html repo-add(8) Manual Page]</div>Zfjagannhttps://wiki.archlinux.org/index.php?title=Talk:VLAN&diff=368265Talk:VLAN2015-04-02T16:54:56Z<p>Zfjagann: Added note about interface naming</p>
<hr />
<div>For my system with a Sun Cassini Quad-NIC the command <br />
<pre>ip link set dev eth0.100 up</pre><br />
doesn't work, it always says "Network unreachable". I think this has to be<br />
<pre>ip link set dev eth0 up</pre><br />
as you have to up the interface, not the VLAN.<br />
[[User:Tomtom|Tomtom]] ([[User talk:Tomtom|talk]]) 20:10, 9 May 2014 (UTC)<br />
:Sounds OK to up a VLAN device, but it should probably be created first.<br />
:I would try<br />
:<pre>ip link add link eth0 name eth0.100 type vlan id 100</pre><br />
:before the "up".<br />
:<pre>ip link set dev eth0.100 up</pre><br />
:Seems to work with similar commands on my config.<br />
:[[User:RegisC|RegisC]] ([[User talk:RegisC|talk]]) 21:24, 11 May 2014 (UTC)<br />
<br />
=== Interface Naming ===<br />
I think it'd be helpful to replace the interface names (e.g. <code>eth0</code>) with new systemd device names (e.g. <code>wwp0s20u4c2i12</code>).<br />
The new names are definitely more verbose, but more accurately reflect the current state of networking on Arch systems.<br />
[[User:Zfjagann|Zeal J.]] ([[User talk:Zfjagann|talk]]) 16:54, 2 April 2015 (UTC)</div>Zfjagannhttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_X1_Carbon_(Gen_2)&diff=365982Lenovo ThinkPad X1 Carbon (Gen 2)2015-03-18T18:10:44Z<p>Zfjagann: Adding note about how to use multiple external monitors.</p>
<hr />
<div>[[Category:Lenovo]]<br />
{{Related articles start}}<br />
{{Related|Lenovo ThinkPad X1 Carbon}}<br />
{{Related|Lenovo ThinkPad X1 Carbon (Gen 3)}}<br />
{{Related articles end}}<br />
<br />
== Model description ==<br />
<br />
Lenovo ThinkPad X1 Carbon, Gen 2 (X1C).<br />
Comes without optical drive. There is also a touch version.<br />
Has UEFI BIOS with BIOS-legacy fallback mode.<br />
<br />
To ensure you have this version, try running ''dmidecode'':<br />
# dmidecode -t system | grep Version<br />
Version: ThinkPad X1 Carbon 2nd<br />
<br />
{{tip| A great resource for thinkpads is http://www.thinkwiki.org/wiki/ThinkWiki}}<br />
<br />
=== Legacy-BIOS ===<br />
<br />
{{Expansion|TODO}}<br />
<br />
=== UEFI ===<br />
<br />
Installing the system from an [[Archboot]] device just works.<br />
<br />
Alteratively, to manually install using {{ic|efibootmgr}} (see [[Unified Extensible Firmware Interface#efibootmgr]]), you can run this:<br />
<br />
# efibootmgr -c -d /dev/sda -p 1 -l /EFI/arch_grub/grubx64.efi -L "Arch"<br />
<br />
This assumes that you are using [[GRUB]] with /dev/sda1 as your ESP. If you are using a different partition change the arguments to {{ic|-d}} and {{ic|-p}} arguments. <br />
<br />
{{Note|<br />
This may not work from the [[archiso|Archiso]] image, in which case you will need to use the EFI shell built into the archiso image.<br />
<br />
Reboot the computer and drop into the EFI shell at the menu, then run these commands:<br />
<br />
> bcfg boot add 0 fs0:\EFI\arch_grub\grubx64.efi "Arch"<br />
<br />
Make sure you are using the correct disk ({{ic|fs0}}) and bootloader location ({{ic|\EFI\arch_grub\grubx64.efi}}).<br />
}}<br />
<br />
== Hardware ==<br />
<br />
Almost everything works out of the box. Most of the hardware is based on the Intel Lynx Point reference design.<br />
<br />
=== Power Management ===<br />
<br />
The [[kernel modules|kernel module]] {{ic|thinkpad_acpi}} picks up most of the sensors. The kernel module {{ic|tp_smapi}} is not currently supported. PCIe ASPM does not currently work.<br />
<br />
[[Udev]] does not not notify whenever battery discharges by 1%, but it does notify at 80%, 20%, 5%, 4% and 0%. To take advantage of this, see (Suspend On Low Battery [[Laptop#suspend_on_low_battery_level]])<br />
<br />
=== Wake From Suspend ===<br />
<br />
Wake from suspend can be buggy with earlier versions of the bios, see:<br />
[http://linux-thinkpad.10952.n7.nabble.com/Gen-2-Haswell-X1-Carbon-suspend-to-RAM-hang-td21039.html]<br />
<br />
This can be solved by flashing the bios to a version >=1.13. Look here for Lenovo's bios versions:<br />
[http://support.lenovo.com/en_GB/downloads/detail.page?DocID=DS039783]<br />
<br />
A guide how to make a bootable BIOS key drive can be found here:<br />
[http://positon.org/lenovo-thinkpad-bios-update-with-linux-and-usb]<br />
<br />
And some fairly old help from lenovo here:<br />
[http://www.thinkwiki.org/wiki/BIOS_Upgrade#Using_grub4dos_.28also_for_Linux.29]<br />
<br />
If the function keys fail to wake after suspend, ensure you have a kernel version >=3.15.<br />
<br />
If you build your own kernels, make sure to either enable TPM (Trusted Platform Module) drivers or disable the Security Chip in the BIOS.<br />
<br />
=== Keyboard ===<br />
<br />
On kernel 3.14 and lower the adaptive panel at the top of the keyboard is locked to function mode.<br />
<br />
From kernel 3.15, Home mode is also available which allows access to screen brightness and other controls.<br />
<br />
If you wish to remap keys to get back to a sane keyboard layout, you can use either xmodmap or xkb. The difference is largely user preference.<br />
<br />
==== Remapping keys using xmodmap ====<br />
<br />
To get the tilde key back to a sane location on the keyboard you can use xmodmap [[Xmodmap]] to remap Shift-Esc to '~'.<br />
Install {{Pkg|xorg-xmodmap}} and generate a custom key map:<br />
$ xmodmap -pke > ~/.Xmodmap<br />
Then edit your key map:<br />
{{hc|~/.Xmodmap|<nowiki><br />
...<br />
keycode 9 = Escape asciitilde Escape<br />
...<br />
</nowiki>}}<br />
Make sure xmodmap loads your new keymap on login:<br />
{{hc|~/.xinitrc|<nowiki><br />
...<br />
if [ -s ~/.Xmodmap ]; then<br />
xmodmap ~/.Xmodmap<br />
fi<br />
...<br />
</nowiki>}}<br />
<br />
==== Remapping keys using xkb ====<br />
{{Accuracy|This is not the intended usage of [[XKB]], these changes will be lost on every update of {{Pkg|xkeyboard-config}} package which owns the files.}}<br />
<br />
===== Backtick (`) and Tilde (~) =====<br />
To get the backtick/tilde back to a normal location, add the following definition for the Escape button:<br />
<br />
{{hc|/usr/share/X11/xkb/symbols/pc|<nowiki><br />
key <ESC> { [ grave, asciitilde ] };<br />
</nowiki>}}<br />
<br />
===== Home and End =====<br />
You may also wish to remap the 'Home' and 'End' button back to Caps Lock, or Escape. Change the lines for HOME and END as follows:<br />
<br />
{{hc|/usr/share/X11/xkb/symbols/pc|<nowiki><br />
key <HOME> { [ Caps_Lock ] };<br />
key <END> { [ Caps_Lock ] };<br />
</nowiki>}}<br />
<br />
or to make 'Home' and 'End' be Escape:<br />
<br />
{{hc|/usr/share/X11/xkb/symbols/pc|<nowiki><br />
key <HOME> { [ Escape ] };<br />
key <END> { [ Escape ] };<br />
</nowiki>}}<br />
<br />
===== BackSpace and Delete =====<br />
<br />
If you find yourself accidentally hitting the delete key instead of backspace, you may wish to make both backspace and delete be 'BackSpace', while functioning as 'Delete' when you hold down shift:<br />
<br />
{{hc|/usr/share/X11/xkb/symbols/pc|<nowiki><br />
key <BKSP> { [ BackSpace, Delete ] };<br />
key <DELE> { [ BackSpace, Delete ] };<br />
</nowiki>}}<br />
<br />
=== Trackpad ===<br />
<br />
To enable Trackpad support you need to install {{Pkg|xf86-input-synaptics}}.<br />
<br />
==== Lock-ups on click ====<br />
There are significant issues with the trackpad locking up on click. This is due to the trackpad operating in buggy PS/2 mode.<br />
<br />
One alternative is to abandon the trackpad completely and use the trackpoint. Make sure xf86-input-synaptics is not installed - the trackpad will still register button one mouse clicks. Using xbindkeys [[Xbindkeys]] and {{Pkg|xdotool}}, right button clicks can be mapped to some other event. For example:<br />
<br />
{{hc|~/.xbindkeysrc|<nowiki><br />
# Emit a right click on Alt + trackpad click<br />
"xdotool click 3"<br />
Mod1 + b:1 + Release<br />
</nowiki>}}<br />
<br />
==== Tweaking trackpad behavior ====<br />
The behavior of the trackpad by default can be contrary to your expectations, particularly if you are coming from an OS X style trackpad. The following settings can help significantly:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/99-x1carbon.conf|<nowiki><br />
# Copy this to /etc/X11/xorg.conf.d/99-x1carbon.conf<br />
Section "InputClass"<br />
Identifier "X1 carbon stuff"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Driver "synaptics"<br />
<br />
# Enable two finger scrolling vertically, disable horizontally<br />
Option "VertTwoFingerScroll" "1"<br />
Option "HorizTwoFingerScroll" "0"<br />
<br />
# No scrolling along the edge<br />
Option "VertEdgeScroll" "0"<br />
Option "HorizEdgeScroll" "0"<br />
<br />
Option "LockedDrags" "0"<br />
Option "FingerPress" "1"<br />
<br />
# Turn off the blasted corners as buttons<br />
Option "RTCornerButton" "0"<br />
Option "RBCornerButton" "0"<br />
Option "LTCornerButton" "0"<br />
Option "LBCornerButton" "0"<br />
<br />
# Ignore "taps" and listen for "clicks"<br />
Option "TapButton1" "0"<br />
Option "TapButton2" "0"<br />
Option "TapButton3" "0"<br />
Option "ClickFinger1" "1" # Left click one finger<br />
Option "ClickFinger2" "3" # Right click two fingers<br />
Option "ClickFinger3" "0" # Three finger click disabled<br />
<br />
Option "TapAndDragGesture" "0"<br />
<br />
# No circular scrolling<br />
Option "CircularScrolling" "0"<br />
EndSection<br />
</nowiki>}}<br />
<br />
If you are using gnome-shell, you may need to tell the settings app not to overwrite our changes:<br />
<br />
gsettings set org.gnome.settings-daemon.plugins.mouse active false<br />
<br />
=== Keyboard backlight ===<br />
<br />
Works out of the box. there is a button on the soft keyboard to toggle it between off, low, and high brightness.<br />
<br />
=== Audio ===<br />
Sound works out of the box. Uses the snd_hda_intel kernel module.<br />
<br />
You may need to add default sound card options to the module.<br />
<br />
In /etc/modprobe.d/alsa-base.conf include the following line:<br />
<br />
options snd_hda_intel index=1<br />
<br />
=== Network ===<br />
<br />
==== Wired ====<br />
<br />
There is a small port on the right side for Ethernet. An adaptor is required.<br />
<br />
==== Wireless ====<br />
<br />
Works out of the box. The module {{ic|iwlwifi}} should be automatically loaded by [[udev]].<br />
<br />
{{hc|$ lspci|<br />
Network controller: Intel Corporation Wireless 7260 (rev 83)<br />
}}<br />
<br />
=== Display ===<br />
<br />
==== Touchscreen ====<br />
<br />
Works out of the box as single touch. The hardware is multitouch, but current stable drivers only support left-click mouse emulation.<br />
<br />
==== GPU ====<br />
<br />
The video card installed is an integrated Intel Haswell GPU. See [[intel]] for more info.<br />
<br />
==== HiDPI ====<br />
<br />
Since the display has such a high pixel density, you might encounter problems. See here: [[HiDPI]]<br />
<br />
==== Xbindkeys ====<br />
For alternative window managers (Fluxbox, etc..), try installing [[xbindkeys]] and adding the following to {{ic|~/.xbindkeysrc}}<br />
<br />
{{bc|<br />
"xbacklight -dec 5"<br />
XF86MonBrightnessDown<br />
"xbacklight -inc 5"<br />
XF86MonBrightnessUp<br />
}}<br />
<br />
=== KMS ===<br />
Get [[Kernel_mode_setting|KMS]] working by adding i915 to the modules line<br />
{{hc|/etc/mkinitcpio.conf|2=<br />
MODULES="i915"<br />
}}<br />
<br />
Then regenerate your [[mkinitcpio|initramfs]]:<br />
# mkinitcpio -p linux<br />
<br />
=== Webcam ===<br />
Works out of the box.<br />
<br />
=== Fingerprint Reader ===<br />
The fingerprint reader is a Validity Sensors model (138a:0017) also used on the Thinkpad X240 and T440. ThinkFinger does NOT support this reader.<br />
<br />
This fingerprint reader requires libfprint to be build from the current git (https://github.com/ars3niy/fprint_vfs5011.git ) as yet no stable fprint release supports it. <br />
<br />
=== WWAN (Mobile broadband) ===<br />
The SIM-card must be inserted in the back of the laptop.<br />
<br />
This is usually a Sierra Wireless EM7345. It uses the cdc_mbim kernel module from kernel 3.14 forward. Since Gnome 3.14.1 it works with NetworkManager after installing modemmanager.<br />
<br />
=== GPS ===<br />
<br />
This is provided by the Sierra Wireless EM7345. mbim_gpsd is required as well as a udev rule.<br />
<br />
Untested<br />
<br />
=== Bluetooth ===<br />
<br />
Works out of the box after enabling bluetooth.service.<br />
<br />
== Other hardware ==<br />
<br />
=== Docking ===<br />
This model comes with a OneLink dock port, next to the power adaptor. Out of the box, it is covered with a rubber cap that can be removed easily. Tested with OneLink Pro dock.<br />
<br />
==== Audio ====<br />
Audio works out of the box, but presents as a separate sound card.<br />
<br />
==== Video ====<br />
The dock has DisplayPort and DVI on the back, and either work, but only one at a time.<br />
<br />
{{Note|<br />
It is possible to use two external external monitors with the dock, but, as mentioned above, the dock will only run one. To run the second external monitor you should connect the monitor to the mini-display port directly on the laptop.<br />
}}<br />
<br />
==== Other ports ====<br />
All other ports on the dock work as expected.</div>Zfjagannhttps://wiki.archlinux.org/index.php?title=Talk:Lenovo_ThinkPad_X1_Carbon_(Gen_2)&diff=347625Talk:Lenovo ThinkPad X1 Carbon (Gen 2)2014-12-02T09:14:41Z<p>Zfjagann: </p>
<hr />
<div>=== EFI Not Installing Correctly ===<br />
<br />
Regarding [[Lenovo_ThinkPad_X1_Carbon_(Gen_2)#UEFI]], this was demonstrated on 2 different ThinkPad X1 Carbon computers. When the EFI boot option was created with {{ic|efibootmgr}} ([[Unified Extensible Firmware Interface#efibootmgr]]), it would disappear when the flash drive (archiso) was removed.<br />
<br />
I'm not entirely sure why this was happening since the EFI boot options should be stored on the MOBO nvram, not the flash drive. I was able to work around it by installing the option from the EFI shell, as described in here.<br />
<br />
[[User:Zfjagann|Zfjagann]] ([[User talk:Zfjagann|talk]]) 09:13, 2 December 2014 (UTC)</div>Zfjagannhttps://wiki.archlinux.org/index.php?title=Talk:Lenovo_ThinkPad_X1_Carbon_(Gen_2)&diff=347624Talk:Lenovo ThinkPad X1 Carbon (Gen 2)2014-12-02T09:13:21Z<p>Zfjagann: explaining why efibootmgr does not work correctly.</p>
<hr />
<div>=== EFI Not Installing Correctly ===<br />
<br />
Regarding [[Lenovo_ThinkPad_X1_Carbon_(Gen_2)#UEFI]], this was demonstrated on 2 different ThinkPad X1 Carbon computers. When the EFI boot option was created with [[efibootmgr|Unified Extensible Firmware Interface#efibootmgr]], it would disappear when the flash drive (archiso) was removed.<br />
<br />
I'm not entirely sure why this was happening since the EFI boot options should be stored on the MOBO nvram, not the flash drive. I was able to work around it by installing the option from the EFI shell, as described in here.<br />
<br />
[[User:Zfjagann|Zfjagann]] ([[User talk:Zfjagann|talk]]) 09:13, 2 December 2014 (UTC)</div>Zfjagannhttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_X1_Carbon_(Gen_2)&diff=347621Lenovo ThinkPad X1 Carbon (Gen 2)2014-12-02T09:09:04Z<p>Zfjagann: Added additional details for UEFI installation on non-archboot installations</p>
<hr />
<div>[[Category:Lenovo]]<br />
This page describes the second generation X1 Carbon. For information regarding the first generation X1 Carbon, see [[Lenovo ThinkPad X1 Carbon]].<br />
<br />
== Model description ==<br />
<br />
Lenovo ThinkPad X1 Carbon, Gen 2 (X1C).<br />
Comes without optical drive. There is also a touch version.<br />
Has UEFI BIOS with BIOS-legacy fallback mode.<br />
<br />
To ensure you have this version, try running ''dmidecode'':<br />
# dmidecode -t system | grep Version<br />
Version: ThinkPad X1 Carbon 2nd<br />
<br />
{{tip| A great resource for thinkpads is<br />
http://www.thinkwiki.org/wiki/ThinkWiki}}<br />
<br />
=== Legacy-BIOS ===<br />
<br />
TODO<br />
<br />
=== UEFI ===<br />
<br />
Installing the system from an [[Archboot]] device just works.<br />
<br />
Alteratively, to manually install using {{ic|efibootmgr}} (see [[Unified Extensible Firmware Interface#efibootmgr]]), you can run this:<br />
<br />
# efibootmgr -c -d /dev/sda -p 1 -l /EFI/arch_grub/grubx64.efi -L "Arch"<br />
<br />
This assumes that you are using [[GRUB]] with /dev/sda1 as your ESP. If you are using a different partition change the arguments to {{ic|-d}} and {{ic|-p}} arguments. <br />
<br />
{{Note|<br />
This may not work from the [[archiso|Archiso]] image, in which case you will need to use the EFI shell built into the archiso image.<br />
<br />
Reboot the computer and drop into the EFI shell at the menu, then run these commands:<br />
<br />
> bcfg boot add 0 fs0:\EFI\arch_grub\grubx64.efi "Arch"<br />
<br />
Make sure you are using the correct disk ({{ic|fs0}}) and bootloader location ({{ic|\EFI\arch_grub\grubx64.efi}}).<br />
}}<br />
<br />
== Hardware ==<br />
<br />
Almost everything works out of the box. Most of the hardware is based on the Intel Lynx Point reference design.<br />
<br />
==== Power Management ====<br />
<br />
The [[kernel modules|kernel module]] {{ic|thinkpad_acpi}} picks up most of the sensors. The kernel module {{ic|tp_smapi}} is not currently supported. PCIe ASPM does not currently work.<br />
<br />
[[Udev]] does not not notify whenever battery discharges by 1%, but it does notify at 80%, 20%, 5%, 4% and 0%. To take advantage of this, see (Suspend On Low Battery [https://wiki.archlinux.org/index.php/Laptop#suspend_on_low_battery_level])<br />
<br />
==== Wake From Suspend ====<br />
<br />
Wake from suspend can be buggy with earlier versions of the bios, see:<br />
[http://linux-thinkpad.10952.n7.nabble.com/Gen-2-Haswell-X1-Carbon-suspend-to-RAM-hang-td21039.html]<br />
<br />
This can be solved by flashing the bios to a version >=1.13. Look here for Lenovo's bios versions:<br />
[http://support.lenovo.com/en_GB/downloads/detail.page?DocID=DS039783]<br />
<br />
A guide how to make a bootable BIOS key drive can be found here:<br />
[http://positon.org/lenovo-thinkpad-bios-update-with-linux-and-usb]<br />
<br />
And some fairly old help from lenovo here:<br />
[http://www.thinkwiki.org/wiki/BIOS_Upgrade#Using_grub4dos_.28also_for_Linux.29]<br />
<br />
If the function keys fail to wake after suspend, ensure you have a kernel version >=3.15.<br />
<br />
If you build your own kernels, make sure to either enable TPM (Trusted Platform Module) drivers or disable the Security Chip in the BIOS.<br />
<br />
==== Keyboard ====<br />
<br />
On kernel 3.14 and lower the adaptive panel at the top of the keyboard is locked to function mode.<br />
<br />
From kernel 3.15, Home mode is also available which allows access to screen brightness and other controls.<br />
<br />
To get the tilde key back to a sane location on the keyboard you can use xmodmap [https://wiki.archlinux.org/index.php/Xmodmap] to remap Shift-Esc to '~'.<br />
Install {{Pkg|xorg-xmodmap}} and generate a custom key map:<br />
$ xmodmap -pke > ~/.Xmodmap<br />
Then edit your key map:<br />
{{hc|~/.Xmodmap|<nowiki><br />
...<br />
keycode 9 = Escape asciitilde Escape<br />
...<br />
</nowiki>}}<br />
Make sure xmodmap loads your new keymap on login:<br />
{{hc|~/.xinitrc|<nowiki><br />
...<br />
if [ -s ~/.Xmodmap ]; then<br />
xmodmap ~/.Xmodmap<br />
fi<br />
...<br />
</nowiki>}}<br />
<br />
==== Trackpad ====<br />
<br />
To enable Trackpad support you need to install {{Pkg|xf86-input-synaptics}}.<br />
There are significant issues with the trackpad locking up on click. This is due to the trackpad operating in buggy PS/2 mode.<br />
<br />
One alternative is to abandon the trackpad completely and use the trackpoint. Make sure xf86-input-synaptics is not installed - the trackpad will still register button one mouse clicks. Using xbindkeys [https://wiki.archlinux.org/index.php/Xbindkeys] and {{Pkg|xdotool}}, right button clicks can be mapped to some other event. For example:<br />
<br />
{{hc|~/.xbindkeysrc|<nowiki><br />
# Emit a right click on Alt + trackpad click<br />
"xdotool click 3"<br />
Mod1 + b:1 + Release<br />
</nowiki>}}<br />
<br />
=== Keyboard backlight ===<br />
<br />
Works out of the box. there is a button on the soft keyboard to toggle it between off, low, and high brightness.<br />
<br />
=== Audio ===<br />
Sound works out of the box. Uses the snd_hda_intel kernel module.<br />
<br />
You may need to add default sound card options to the module.<br />
<br />
In /etc/modprobe.d/alsa-base.conf include the following line:<br />
<br />
options snd_hda_intel index=1<br />
<br />
=== Network ===<br />
<br />
==== Wired ====<br />
<br />
There is a small port on the right side for Ethernet. An adaptor is required.<br />
<br />
==== Wireless ====<br />
<br />
Works out of the box. The module {{ic|iwlwifi}} should be automatically loaded by [[udev]].<br />
<br />
{{hc|$ lspci|<br />
Network controller: Intel Corporation Wireless 7260 (rev 83)<br />
}}<br />
<br />
=== Display ===<br />
<br />
==== Touchscreen ====<br />
<br />
Works out of the box as single touch. The hardware is multitouch, but current stable drivers only support left-click mouse emulation.<br />
<br />
==== GPU ====<br />
<br />
The video card installed is an integrated Intel Haswell GPU. See [[intel]] for more info.<br />
<br />
==== HiDPI ====<br />
<br />
Since the display has such a high pixel density, you might encounter problems. See here: [[HiDPI]]<br />
<br />
==== Xbindkeys ====<br />
For alternative window managers (Fluxbox, etc..), try installing [[xbindkeys]] and adding the following to {{ic|~/.xbindkeysrc}}<br />
<br />
{{bc|<br />
"xbacklight -dec 5"<br />
XF86MonBrightnessDown<br />
"xbacklight -inc 5"<br />
XF86MonBrightnessUp<br />
}}<br />
<br />
=== KMS ===<br />
Get [[Kernel_mode_setting|KMS]] working by adding i915 to the modules line<br />
{{hc|/etc/mkinitcpio.conf|2=<br />
MODULES="i915"<br />
}}<br />
<br />
Then regenerate your [[mkinitcpio|initramfs]]:<br />
# mkinitcpio -p linux<br />
<br />
=== Webcam ===<br />
Works out of the box.<br />
<br />
=== Fingerprint Reader ===<br />
The fingerprint reader is a Validity Sensors model (138a:0017) also used on the Thinkpad X240 and T440.<br />
<br />
This fingerprint reader requires libfprint to be build from the current git as yet no stable fprint release supports it.<br />
<br />
=== WWAN (Mobile broadband) ===<br />
The SIM-card must be inserted in the back of the laptop.<br />
<br />
This is usually a Sierra Wireless EM7345. It uses the cdc_mbim kernel module from kernel 3.14 forward. Since Gnome 3.14.1 it works with NetworkManager after installing modemmanager.<br />
<br />
=== GPS ===<br />
<br />
This is provided by the Sierra Wireless EM7345. mbim_gpsd is required as well as a udev rule.<br />
<br />
Untested<br />
<br />
=== Bluetooth ===<br />
<br />
Works out of the box after enabling bluetooth.service.<br />
<br />
== Other hardware ==<br />
<br />
=== Docking ===<br />
This model comes with a OneLink dock port, next to the power adaptor. Out of the box, it is covered with a rubber cap that can be removed easily. Tested with OneLink Pro dock.<br />
<br />
==== Audio ====<br />
Audio works out of the box, but presents as a separate sound card.<br />
<br />
==== Video ====<br />
The dock has DisplayPort and DVI on the back, and either work, but only one at a time.<br />
<br />
==== Other ports ====<br />
All other ports on the dock work as expected.</div>Zfjagannhttps://wiki.archlinux.org/index.php?title=Archiso&diff=305404Archiso2014-03-18T06:01:35Z<p>Zfjagann: </p>
<hr />
<div>[[Category:Live Arch systems]]<br />
[[ar:Archiso]]<br />
[[el:Archiso]]<br />
[[es:Archiso]]<br />
[[fr:Archiso]]<br />
[[it:Archiso]]<br />
[[nl:Archiso]]<br />
[[ru:Archiso]]<br />
[[uk:Archiso]]<br />
'''Archiso''' is a small set of bash scripts capable of building fully functional Arch Linux based live CD and USB images. It is the tool used to generate the official CD/USB images, however it is a very generic tool and it could potentially be used to generate anything from rescue systems, install disks, to special interest live CD/DVD/USB systems, and who knows what else. Simply put, if it involves Arch on a shiny coaster, it can do it. The heart and soul of Archiso is mkarchiso. All of its options are documented in its usage output, so its direct usage won't be covered here. Instead, this wiki article will act as a guide for rolling your own live media in no time!<br />
<br />
== Setup ==<br />
<br />
{{Note|It is recommended to act as root in all the following steps. If not, it is very likely to have problems with false permissions later.}}<br />
Before we begin, we need to [[pacman|install]] {{Pkg|archiso}} from the [[official repositories]]. Alternatively, {{AUR|archiso-git}} can be found in the [[AUR]].<br />
<br />
Create a directory to work within, this is where all the modifications to the live image will take place: {{ic|~/archlive}} should do fine.<br />
$ mkdir ~/archlive<br />
<br />
The archiso scripts that were installed to the host system earlier now need to be copied over into the newly created directory you will be working within.<br />
<br />
Archiso comes with two "profiles": ''releng'' and ''baseline''.<br />
<br />
If you wish to create a fully customised live version of Arch Linux, pre-installed with all your favourite programs and configurations, use ''releng''.<br />
<br />
If you just want to create the most basic live medium, with no pre-installed packages and a minimalistic configuration, use ''baseline''.<br />
<br />
So, depending on your needs, execute the following, replacing 'PROFILE' with either '''releng''' or '''baseline'''.<br />
# cp -r /usr/share/archiso/configs/'''PROFILE'''/ ~/archlive<br />
<br />
If you are using the ''releng'' profile to make a fully customised image, then you can proceed onto [[#Configure our live medium]].<br />
<br />
If you are using the ''baseline'' profile to create a bare image, then you won't be needing to do any customisations and can proceed onto [[#Build the ISO]].<br />
<br />
== Configure our live medium ==<br />
<br />
This section details configuring the image you will be creating, allowing you to define the packages and configurations you want your live image to contain.<br />
<br />
Change into the directory we created earlier (~/archlive/releng/ if you have been following this guide), you will see a number of files and directories; we are only concerned with a few of these, mainly: <br />
packages.* - this is where you list, line by line, the packages you want to have installed, and<br />
the root-image directory - this directory acts as an overlay and it is where you make all the customisations.<br />
<br />
Generally, every admininistrative task that you would normally do after a fresh install except for package installation can be scripted into {{ic|~/archlive/releng/root-image/root/customize-root-image.sh}}. It has to be written from the perpective of the new environment, so / in the script means the root of the live-iso which is created.<br />
<br />
=== Installing packages ===<br />
<br />
You will want to create a list of packages you want installed on your live CD system. A file full of package names, one-per-line, is the format for this. This is '''''great''''' for special interest live CDs, just specify packages you want in packages.both and bake the image.<br />
The packages.i686 and packages.x86_64 files allow you to install software on just 32bit or 64bit, respectively.<br />
<br />
I recommend installing "rsync" if you wish to install the system later on with no internet connection or skipping downloading it all over again. ([[#Installation]])<br />
<br />
==== Custom local repository ====<br />
<br />
{{Merge|Pacman Tips#Custom local repository|Move the general information (e.g. repo tree) into the main article.}}<br />
<br />
You can also [[custom local repository|create a custom local repository]] for the purpose of preparing custom packages or packages from [[AUR]]/[[ABS]]. When doing so with packages for both architectures, you should follow a certain directory order to not run into problems.<br />
<br />
For instance:<br />
<br />
*{{ic|~/customrepo}}<br />
**{{ic|~/customrepo/x86_64}}<br />
***~/customrepo/x86_64/foo-x86_64.pkg.tar.xz<br />
***~/customrepo/x86_64/customrepo.db.tar.gz<br />
***~/customrepo/x86_64/customrepo.db (symlink created by {{ic|repo-add}})<br />
**{{ic|~/customrepo/i686}}<br />
***~/customrepo/i686/foo-i686.pkg.tar.xz<br />
***~/customrepo/i686/customrepo.db.tar.gz<br />
***~/customrepo/i686/customrepo.db (symlink created by {{ic|repo-add}})<br />
<br />
You can then add your repository by putting the following into {{ic|~/archlive/releng/pacman.conf}}, above the other repository entries (for top priority):<br />
<br />
# custom repository<br />
[customrepo]<br />
SigLevel = Optional TrustAll<br />
Server = file:///home/'''user'''/customrepo/$arch<br />
<br />
So, the build scripts just look for the appropriate packages.<br />
<br />
If this is not the case you will be running into error messages similar to this:<br />
<br />
error: failed to prepare transaction (package architecture is not valid)<br />
:: package foo-i686 does not have a valid architecture<br />
<br />
==== Avoid installation of packages belonging to base group ====<br />
<br />
By, default {{ic|/usr/bin/mkarchiso}}, a script which is used by {{ic|~/archlive/releng/build.sh}}, calls one of the {{Pkg|arch-install-scripts}} named {{ic|pacstrap}} without the {{ic|-i}} flag, which causes [[Pacman]] to not wait for user input during the installation process.<br />
<br />
When blacklisting base group packages by adding them to the {{ic|IgnorePkg}} line in {{ic|~/archlive/releng/pacman.conf}}, [[Pacman]] asks if they still should be installed, which means they will when user input is bypassed. To get rid of these packages there are several options:<br />
<br />
* '''Dirty''': Add the {{ic|-i}} flag to each line calling {{ic|pacstrap}} in {{ic|/usr/bin/mkarchiso}}.<br />
<br />
* '''Clean''': Create a copy of {{ic|/usr/bin/mkarchiso}} in which you add the flag and adapt {{ic|~/archlive/releng/build.sh}} so that it calls the modifed version of the mkarchiso script.<br />
<br />
* '''Advanced''': Create a function for {{ic|~/archlive/releng/build.sh}} which explicitly removes the packages after the base installation. This would leave you the comfort of not having to type enter so much during the installation process.<br />
<br />
=== Adding a user ===<br />
<br />
User management can be handled the same way as during the normal installation process, except you put your commands scripted into {{ic|~/archlive/releng/root-image/root/customize-root-image.sh}}. For further information have a look at [[Users and groups#User management|User management]].<br />
<br />
=== Adding files to image ===<br />
<br />
{{Note|You must be root to do this, do not change the ownership of any of the files you copy over, '''everything''' within the root-image directory must be root owned. Proper ownerships will be sorted out shortly.}}<br />
<br />
The root-image directory acts as an overlay, think of it as root directory '/' on your current system, so any files you place within this directory will be copied over on boot-up.<br />
<br />
So if you have a set of iptables scripts on your current system you want to be used on you live image, copy them over as such:<br />
# cp -r /etc/iptables ~/archlive/releng/root-image/etc<br />
<br />
Placing files in the users home directory is a little different. Do not place them within root-image/home, but instead create a skel directory within root-image/ and place them there. We will then add the relevant commands to the customize_root_image.sh which we are going to use to copy them over on boot and sort out the permissions.<br />
<br />
First, create the skel directory; making sure you are within ~/archlive/releng/root-image/etc directory (if this is where you are working from):<br />
# cd ~/archlive/releng/root-image/etc && mkdir skel<br />
<br />
Now copy the 'home' files to the skel directory, again doing everything as root!<br />
e.g for .bashrc. <br />
# cp ~/.bashrc ~/archlive/releng/root-image/etc/skel/<br />
<br />
When {{ic|~/archlive/releng/root-image/root/customize-root-image.sh}} is executed and a new user is created, the files from the skel directory will automatically be copied over to the new home folder, permissions set right.<br />
<br />
=== aitab ===<br />
<br />
The default file should work fine, so you should not need to touch it.<br />
<br />
The aitab file holds information about the filesystems images that must be created by mkarchiso and mounted at initramfs stage from the archiso hook.<br />
It consists of some fields which define the behaviour of images.<br />
<br />
# <img> <mnt> <arch> <sfs_comp> <fs_type> <fs_size><br />
<br />
; <img>: Image name without extension (.fs .fs.sfs .sfs).<br />
; <mnt>: Mount point.<br />
; <arch>: Architecture { i686 | x86_64 | any }.<br />
; <sfs_comp>: SquashFS compression type { gzip | lzo | xz }.<br />
; <fs_type>: Set the filesystem type of the image { ext4 | ext3 | ext2 | xfs | btrfs }. A special value of "none" denotes no usage of a filesystem. In that case all files are pushed directly to SquashFS filesystem. <br />
; <fs_size>: An absolute value of file system image size in MiB (example: 100, 1000, 4096, etc) A relative value of file system free space [in percent] {1%..99%} (example 50%, 10%, 7%). This is an estimation, and calculated in a simple way. Space used + 10% (estimated for metadata overhead) + desired %<br />
<br />
{{Note|Some combinations are invalid. Example both {{ic|sfs_comp}} and {{ic|fs_type}} are set to none}}<br />
<br />
=== Boot Loader ===<br />
<br />
The default file should work fine, so you should not need to touch it.<br />
<br />
Due to the modular nature of isolinux, you are able to use lots of addons since all *.c32 files are copied and available to you. Take a look at the [http://syslinux.zytor.com/wiki/index.php/SYSLINUX official syslinux site] and the [https://projects.archlinux.org/archiso.git/tree/configs/syslinux-iso/boot-files archiso git repo]. Using said addons, it is possible to make visually attractive and complex menus. See [http://syslinux.zytor.com/wiki/index.php/Comboot/menu.c32 here].<br />
<br />
=== Login manager ===<br />
<br />
Starting X at boot time was done by modifying ''inittab'' on [[sysvinit]] systems. On a [[systemd]] based system things are handled by enabling your login manager's service. If you know which .service file needs a softlink: Great. If not, you can easily find out in case you're using the same program on the system you build your iso on. Just use<br />
<br />
# systemctl disable '''nameofyourloginmanager'''<br />
<br />
to temporarily turn it off. Next type the same command again and replace "disable" with "enable" to activate it again. Systemctl prints information about softlink it creates. Now change to ~/archiso/releng/root-image/etc/systemd/system and create the same softlink there.<br />
<br />
An example (make sure you're either in ~/archiso/releng/root-image/etc/systemd/system or add it to the command):<br />
<br />
# ln -s /usr/lib/systemd/system/lxdm.service display-manager.service<br />
<br />
This will enable LXDM at system start on your live system.<br />
<br />
=== Changing Automatic Login ===<br />
<br />
The configuration for getty's automatic login is located under root-image/etc/systemd/system/getty@tty1.service.d/autologin.conf.<br />
<br />
You can modify this file to change the auto login user:<br />
<br />
[Service]<br />
ExecStart=<br />
ExecStart=-/sbin/agetty --autologin '''isouser''' --noclear %I 38400 linux<br />
<br />
Or remove it altogether to disable auto login.<br />
<br />
== Build the ISO ==<br />
<br />
Now you are ready to turn your files into the .iso which you can then burn to CD or USB:<br />
Inside the directory you are working with, either ~/archlive/releng, or ~/archlive/baseline, execute:<br />
<br />
# ./build.sh -v<br />
<br />
The script will now download and install the packages you specified to work/*/root-image, create the kernel and init images, apply your customizations and finally build the iso into out/.<br />
<br />
== Using the ISO ==<br />
<br />
=== CD ===<br />
<br />
Just burn the iso to a cd. You can follow [[CD Burning]] as you wish.<br />
<br />
=== USB ===<br />
<br />
See [[USB Flash Installation Media]].<br />
<br />
=== grub4dos ===<br />
<br />
Grub4dos is a utility that can be used to create multiboot usbs, able to boot multiple linux distros from the same usb stick.<br />
<br />
To boot the generated system on a usb with grub4dos already installed, loop mount the ISO and copy the entire {{ic|/arch}} directory to the '''root of the usb'''.<br />
Then edit the {{ic|menu.lst}} file from the grub4dos (it must be on the usb root) and add these lines:<br />
<br />
{{bc|<nowiki><br />
title Archlinux x86_64<br />
kernel /arch/boot/x86_64/vmlinuz archisolabel=<your usb label><br />
initrd /arch/boot/x86_64/archiso.img<br />
</nowiki>}}<br />
<br />
Change the {{ic|x86_64}} part as necessary and put your '''real''' usb label there.<br />
<br />
=== Installation ===<br />
<br />
Boot the created CD/DVD/USB. If you wish to install the Archiso you created '''-as it is-''', there are several ways to do this, but either way we're following the [[Beginners' guide]] mostly.<br />
<br />
If you don't have an internet connection on that PC, or if you don't want to download every packages you want again, follow the guide, and when you get to [[Beginners' guide#Install_the_base_system]], instead of downloading, use this: [[Full System Backup with rsync]]. (more info here: [[Talk:Archiso]])<br />
<br />
You can also try: [[Archboot]], GUI installer.<br />
<br />
== See also ==<br />
<br />
* [https://projects.archlinux.org/?p=archiso.git;a=summary Archiso project page]<br />
* [[Archiso_as_pxe_server|Archiso as pxe server]]<br />
* [http://blog.jak.me/2011/09/07/creating-a-custom-arch-linux-live-usb/ Creating a custom Arch Linux live USB tutorial]<br />
* [http://didjix.blogspot.com/ A live DJ distribution powered by ArchLinux and built with Archiso]</div>Zfjagannhttps://wiki.archlinux.org/index.php?title=NIS&diff=165568NIS2011-10-13T21:39:20Z<p>Zfjagann: </p>
<hr />
<div>[[Category:Security (English)]]<br />
{{stub}}<br />
=Introduction=<br />
<br />
NIS is a protocol developed by Sun to allow one to defer user authentication to a server. The server software is in the ypserv package, and the client software is in the yp-tools package. ypbind-mt is also available, which is a multi threaded version of the client daemon.<br />
<br />
'''Note:''' obviously this article is far from finished. hopefully in the future that will change, but in the meantime check the [[NIS#More resources|More resources section]].<br />
<br />
=How to set up a NIS client=<br />
<br />
The first step is to install the tools that you need. This provides the configuration files and general tools needed to use NIS.<br />
<br />
# pacman -S yp-tools ypbind-mt<br />
<br />
Next put your NIS domain name into the file /etc/conf.d/nisdomainname.<br />
<br />
Now edit the /etc/yp.conf file and add your ypserver or nis server.<br />
<br />
ypserver your.nis.server<br />
<br />
Start the rpcbind and ypbind daemons (add them to your [[rc.conf]] file if you want it to start automatically).<br />
<br />
# /etc/rc.d/rpcbind start<br />
# /etc/rc.d/ypbind start<br />
<br />
To test the setup so far you can run the command yptest:<br />
<br />
# yptest<br />
<br />
If it works you will, among other things, see the contents of the NIS user database (which is printed in the same format as /etc/passwd).<br />
<br />
To actually use NIS to log in you have to edit /etc/nsswitch.conf. Modify the lines for passwd, group and shadow to read:<br />
<br />
passwd: files nis<br />
group: files nis<br />
shadow: files nis<br />
<br />
And then do not forget<br />
<br />
# /etc/rc.d/ypbind restart<br />
<br />
See [http://www.tldp.org/HOWTO/NIS-HOWTO/settingup_client.html section 7 of The Linux NIS HOWTO] for further information on configuring NIS clients.<br />
<br />
=How to set up a NIS server=<br />
<br />
==Install Packages==<br />
<br />
Make sure packages ypbind-mt, ypserv, and yp-tools are installed:<br />
<br />
# sudo pacman -S ypbind-mt yp-tools ypserv<br />
<br />
==Editing Configuration Files==<br />
<br />
===/etc/conf.d/nisdomainname===<br />
<br />
Add the domain name to /etc/conf.d/nisdomainname:<br />
<br />
# NISDOMAINNAME="nis-domain-name"<br />
<br />
===/etc/ypserv.conf===<br />
<br />
Add rules to /etc/ypserv.conf for your your nis clients of this form:<br />
<br />
# ip-address-of-client : nis-domain-name : rule : security<br />
<br />
For example:<br />
<br />
# 192.168. : home-domain : * : port<br />
<br />
For more information see `man ypserv.conf`.<br />
<br />
===/var/yp/Makefile===<br />
<br />
Add or remove files you would like NIS to use to /var/yp/Makefile under the "all" rule.<br />
<br />
Default:<br />
<br />
# all: passwd group hosts rpc services netid protocols netgrp \<br />
# shadow # publickey networks ethers bootparams printcap mail \<br />
# # amd.home auto.master auto.home auto.local passwd.adjunct \<br />
# # timezone locale netmasks<br />
<br />
===/var/yp/securenets===<br />
<br />
Add rules to /var/yp/securenets to restrict access:<br />
<br />
# 255.255.0.0 192.168.0.0 # Gives access to anyone in 192.168.0.0/16<br />
<br />
Be sure to comment out this line, as it gives access to anyone.<br />
<br />
# 0.0.0.0 0.0.0.0<br />
<br />
===/var/yp/ypservers===<br />
<br />
Add the domain name of your server to /var/yp/ypservers:<br />
<br />
# your.nis.server<br />
<br />
==Start NIS Daemons==<br />
<br />
The daemons MUST be started in this order.<br />
<br />
Start rpcbind (if it isn't already started)<br />
<br />
# sudo rc.d start rpcbind<br />
<br />
Start ypbind:<br />
<br />
# sudo rc.d start ypbind<br />
<br />
Start ypserv:<br />
<br />
# sudo rc.d start ypserv<br />
<br />
If you want these to start automatically on startup, add them to your DAEMONS array in rc.conf:<br />
<br />
# DAEMONS=( ... rpcbind ypbind ypserv ... )<br />
<br />
Make sure they go after network in the array.<br />
<br />
=More resources=<br />
*[http://www.tldp.org/HOWTO/NIS-HOWTO/ The Linux NIS HOWTO],very helpful and generally applicable to Arch Linux.<br />
*[http://www.yolinux.com/TUTORIALS/NIS.html YoLinux NIS tutorial]<br />
*[http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch30_:_Configuring_NIS Quick HOWTO, Configuring NIS]</div>Zfjagannhttps://wiki.archlinux.org/index.php?title=NIS&diff=165567NIS2011-10-13T21:31:38Z<p>Zfjagann: </p>
<hr />
<div>[[Category:Security (English)]]<br />
{{stub}}<br />
=Introduction=<br />
<br />
NIS is a protocol developed by Sun to allow one to defer user authentication to a server. The server software is in the ypserv package, and the client software is in the yp-tools package. ypbind-mt is also available, which is a multi threaded version of the client daemon.<br />
<br />
'''Note:''' obviously this article is far from finished. hopefully in the future that will change, but in the meantime check the [[NIS#More resources|More resources section]].<br />
<br />
==How to set up a NIS client==<br />
<br />
The first step is to install the tools that you need. This provides the configuration files and general tools needed to use NIS.<br />
<br />
# pacman -S yp-tools ypbind-mt<br />
<br />
Next put your NIS domain name into the file /etc/conf.d/nisdomainname.<br />
<br />
Now edit the /etc/yp.conf file and add your ypserver or nis server.<br />
<br />
ypserver your.nis.server<br />
<br />
Start the rpcbind and ypbind daemons (add them to your [[rc.conf]] file if you want it to start automatically).<br />
<br />
# /etc/rc.d/rpcbind start<br />
# /etc/rc.d/ypbind start<br />
<br />
To test the setup so far you can run the command yptest:<br />
<br />
# yptest<br />
<br />
If it works you will, among other things, see the contents of the NIS user database (which is printed in the same format as /etc/passwd).<br />
<br />
To actually use NIS to log in you have to edit /etc/nsswitch.conf. Modify the lines for passwd, group and shadow to read:<br />
<br />
passwd: files nis<br />
group: files nis<br />
shadow: files nis<br />
<br />
And then do not forget<br />
<br />
# /etc/rc.d/ypbind restart<br />
<br />
See [http://www.tldp.org/HOWTO/NIS-HOWTO/settingup_client.html section 7 of The Linux NIS HOWTO] for further information on configuring NIS clients.<br />
<br />
==How to set up a NIS server==<br />
<br />
Make sure packages ypbind-mt, ypserv, and yp-tools are installed:<br />
<br />
# sudo pacman -S ypbind-mt yp-tools ypserv<br />
<br />
Add the domain name to /etc/conf.d/nisdomainname:<br />
<br />
# NISDOMAINNAME="nis-domain-name"<br />
<br />
Add rules to /etc/ypserv.conf for your your nis clients of this form:<br />
<br />
# ip-address-of-client : nis-domain-name : rule : security<br />
<br />
For example:<br />
<br />
# 192.168. : home-domain : * : port<br />
<br />
For more information see `man ypserv.conf`.<br />
<br />
Add or remove files you would like NIS to use to /var/yp/Makefile under the "all" rule.<br />
<br />
Default:<br />
<br />
# all: passwd group hosts rpc services netid protocols netgrp \<br />
# shadow # publickey networks ethers bootparams printcap mail \<br />
# # amd.home auto.master auto.home auto.local passwd.adjunct \<br />
# # timezone locale netmasks<br />
<br />
Add rules to /var/yp/securenets to restrict access:<br />
<br />
# 255.255.0.0 192.168.0.0 # Gives access to anyone in 192.168.0.0/16<br />
<br />
Be sure to comment out this line, as it gives access to anyone.<br />
<br />
# 0.0.0.0 0.0.0.0<br />
<br />
Add the domain name of your server to /var/yp/ypservers:<br />
<br />
# my.nis.server<br />
<br />
==More resources==<br />
*[http://www.tldp.org/HOWTO/NIS-HOWTO/ The Linux NIS HOWTO],very helpful and generally applicable to Arch Linux.<br />
*[http://www.yolinux.com/TUTORIALS/NIS.html YoLinux NIS tutorial]<br />
*[http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch30_:_Configuring_NIS Quick HOWTO, Configuring NIS]</div>Zfjagann