|
Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
#######
#
# E-scripts on archlinux.
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
# An introduction to eev can be found here:
#
# (find-eev-quick-intro)
# http://angg.twu.net/eev-intros/find-eev-quick-intro.html
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/archlinux.e>
# or at <http://angg.twu.net/e/archlinux.e.html>.
# See also <http://angg.twu.net/emacs.html>,
# <http://angg.twu.net/.emacs[.html]>,
# <http://angg.twu.net/.zshrc[.html]>,
# <http://angg.twu.net/escripts.html>,
# and <http://angg.twu.net/>.
#
#######
# «.ssh» (to "ssh")
# «.pacman-hints» (to "pacman-hints")
# «.downloading-pkgs-by-hand» (to "downloading-pkgs-by-hand")
# http://www.archlinux.org/packages/
# http://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/core/os/x86_64/
# (find-fline "/etc/pacman.d/")
# (find-fline "/etc/pacman.d/mirrorlist")
# (find-fline "/etc/pacman.conf")
# (find-fline "/var/run/")
# (find-fline "/var/run/dhcpcd.pid")
sudo pacman -Syu
Targets (5): dnssec-anchors-20120422-1 kmod-8-1 ldns-1.6.12-2 linux-3.3.3-1
openssh-6.0p1-1
https://wiki.archlinux.org/index.php/The_Arch_Way
#####
#
# ssh
# 2012apr27
#
#####
# «ssh» (to ".ssh")
# https://wiki.archlinux.org/index.php/Secure_Shell
# https://wiki.archlinux.org/index.php/Secure_Shell#Daemon
# https://wiki.archlinux.org/index.php/Secure_Shell#Managing_SSHD_Daemon
# rc.d {start|stop|restart} sshd
#####
#
# Pacman hints
# 2012apr26
#
#####
# «pacman-hints» (to ".pacman-hints")
# https://wiki.archlinux.org/index.php/Pacman
# https://wiki.archlinux.org/index.php/Pacman_Rosetta
# https://wiki.archlinux.org/index.php/Pacman_Tips
# https://wiki.archlinux.org/index.php/Pkgtools
# https://www.archlinux.org/pacman/pacman.8.html
pacman -Syu
Installing packages
Installing specific packages
To install a single package or list of packages (including
dependencies), issue the following command:
sudo pacman -S package_name1 package_name2 ...
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:
pacman -S extra/package_name
Installing package groups
-------------------------
Some packages belong to a group of packages that can all be installed
simultaneously. For example, issuing the command:
sudo pacman -S gnome
will install all the packages that belong to the gnome group. To see what
packages belong to the gnome group, run:
sudo pacman -Sg gnome
Also visit https://www.archlinux.org/groups/ to see what package
groups are available.
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 --needed option.
Warning: When installing packages, do not refresh the package list
without upgrading the system (i.e. pacman -Sy package_name); this
can lead to dependency issues, see #Partial upgrades are unsupported
and [1].
Removing packages
-----------------
To remove a single package, leaving all of its dependencies
installed:
sudo pacman -R package_name
To remove a package and its dependencies which are not required by
any other installed package:
sudo pacman -Rs package_name
To remove a package, its dependencies and all the packages that
depend on the target package:
Warning: This operation is recursive, and must be used with care
since it can remove many potentially needed packages.
sudo pacman -Rsc package_name
To remove a package, which is required by another package, without
removing the dependent package:
sudo pacman -Rdd package_name
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 -n option:
sudo pacman -Rn package_name
Note: pacman will not remove configurations that the application
itself creates (for example "dotfiles" in the home folder).
Upgrading packages
------------------
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:
sudo pacman -Syu
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.
Tip: Remember that pacman's output is logged in /var/log/pacman.log.
Querying package databases
--------------------------
pacman queries the local package database with the -Q flag; see:
pacman -Q --help
and queries the sync databases with the -S flag; see:
pacman -S --help
pacman can search for packages in the database, searching both in
packages' names and descriptions:
pacman -Ss string1 string2 ...
To search for already installed packages:
pacman -Qs string1 string2 ...
To display extensive information about a given package:
pacman -Si package_name
For locally installed packages:
pacman -Qi package_name
Passing two -i flags will also display the list of backup files and
their modification states:
pacman -Qii package_name
To retrieve a list of the files installed by a package:
pacman -Ql package_name
For packages not installed, use pkgfile from pkgtools or nosr from
nosr-git from AUR.
One can also query the database to know which package a file in the
file system belongs to:
pacman -Qo /path/to/a/file
To list all packages no longer required as dependencies (orphans):
pacman -Qdt
To list a dependency tree of a package:
pactree package_name
To list all the packages depending on a package, use whoneeds from
pkgtools:
whoneeds package_name
Additional commands
-------------------
Upgrade the system and install a list of packages (one-liner):
sudo pacman -Syu package_name1 package_name2 ...
Download a package without installing it:
sudo pacman -Sw package_name
Install a 'local' package that is not from a repository:
sudo pacman -U /path/to/package/package_name-version.pkg.tar.xz
Install a 'remote' package (not from a repository):
sudo pacman -U http://www.example.com/repo/example.pkg.tar.xz
Clean the package cache of packages that are not currently installed
(/var/cache /pacman/pkg):
Warning: Only do this if sure that the current versions of installed
packages are stable and a downgrade is not needed as pacman -Sc
removes all the old versions of installed packages.
sudo pacman -Sc
Clean the entire package cache:
Warning: This clears the entire package cache. Doing this is a bad
practice since it removes the ability to downgrade to the current
set of packages in the case that an upgrade causes breakage.
sudo pacman -Scc
As an alternative to both the -Sc and -Scc switches, consider using
Cacheclean from the AUR. This python script selectively cleans
pacman's cache keeping x old version of each package therein.
#####
#
# Downloading packages by hand
# 2012apr26
#
#####
# «downloading-pkgs-by-hand» (to ".downloading-pkgs-by-hand")
http://archlinux.org/packages/
http://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/$repo/os/$arch
http://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/core/os/x86_64/
http://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/extra/os/x86_64/
http://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/community/os/x86_64/
* (eepitch-shell2)
* (eepitch-kill)
* (eepitch-shell2)
mkdir /tmp/arch/
wget http://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/core/os/x86_64/linux-3.3.3-1-x86_64.pkg.tar.xz.sig
wget http://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/core/os/x86_64/linux-3.3.3-1-x86_64.pkg.tar.xz
wget http://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/core/os/x86_64/dnssec-anchors-20120422-1
wget http://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/core/os/x86_64/kmod-8-1
wget http://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/core/os/x86_64/ldns-1.6.12-2
wget http://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/core/os/x86_64/openssh-6.0p1-1
openssh-6.0p1-1-x86_64.pkg.tar.xz
openssh-6.0p1-1-x86_64.pkg.tar.xz.sig
http://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/core/os/x86_64/linux-3.3.3-1-x86_64.pkg.tar.xz.sig
# Local Variables:
# coding: utf-8-unix
# End: