Introduction to some initial settings after installation of arch Linux

Time:2020-11-26

Configure wired network.

When there is no network, IP emergency can be set directly, and netctl is the normal setting

Copy code

The code is as follows:

# ip addr add 192.168.0.100/24 dev enp0s4
# ip link set dev enp0s4 up
# ip route add default via 192.168.0.1
# echo nameserver 208.67.222.222 >> /etc/resolv.conf

If you feel that the device name enp0s4 is not used to, you can also rename it in udev (restart takes effect)

Copy code

The code is as follows:

# cat /etc/udev/rules.d/10-network.rules

SUBSYSTEM==”net”, ACTION==”add”, ATTR{address}==”00:50:70:a2:49:7d”, NAME=”eth0″
If DHCD is used to dynamically assign addresses:

Copy code

The code is as follows:

#Dhcpcd ා automatically let eth0 get IP
#Or configure the service to start automatically (more convenient)
# systemctl enable [email protected]
# systemctl start [email protected]

If static address is used, netctl is now used for management:

Copy code

The code is as follows:

# pacman -S ifplugd
# systemctl disable [email protected]
# systemctl stop [email protected] #Stop DHCP or there will be interference
# cd /etc/netctl
# cp examples/ethernet-static home
#VI home ා set my static IP settings profile
# systemctl enable netctl
#Restart and clear the temporary IP settings
# netctl start home
# netctl enable home

If you want to quickly switch the network environment, create a new profile file under / etc / netctl /, and use netctl switch to profile to switch, the old one will be stopped automatically. More details can be seen in the netctl I wrote about how to select a profile.

Install vim. The default VI is not used to

Copy code

The code is as follows:

# pacman -S vim
# pacman -R vi
# ln -s /usr/bin/vim /usr/bin/vi

Turn off the PC horn.

This is so annoying that it is disabled at startup:

Copy code

The code is as follows:

# cat /etc/modprobe.d/nopcspkr.conf
blacklist pcspkr

This file needs to be created by yourself.

Install NTP auto update time

Copy code

The code is as follows:

# pacman -S ntp libedit
# systemctl enable ntpd
# systemctl start ntpd

In addition, arch recommends that the/ ntp.conf Add the iburst parameter in, for example:

Copy code

The code is as follows:

server 0.pool.ntp.org iburst
server 1.pool.ntp.org iburst
server 2.pool.ntp.org iburst
server 3.pool.ntp.org iburst

Check ntpd synchronization:

Copy code

The code is as follows:

# systemctl restart ntpd
# ntpq -np

After the time synchronization is completed, write the hardware clock with hwlock – W.

Create a normal user.

Copy code

The code is as follows:

# useradd -m fwolf
# passwd fwolf

Usually, we should give sudo permission to this user:

Copy code

The code is as follows:

# pacman -S sudo
# cat /etc/sudoers.d/fwolf_sudo_conf

Defaults    env_reset
Defaults    secure_path=”/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin”
fwolf   ALL=(ALL:ALL) ALL

Copy code

The code is as follows:

%admin ALL=(ALL) ALL
%sudo ALL=(ALL:ALL) ALL
# chmod 0440 /etc/sudoers.d/fwolf_sudo_conf

Note that files with ~ or. In the name of / etc / sudoers.d/will not take effect. See CentOS – 0005017: the ා includedir directive in sudoers does not work, and the file attribute must also be 0440.

Install yaourt

In / etc/ pacman.conf Add:

Copy code

The code is as follows:

[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch

Then Pacman – sy yaort completes the installation.

Install other common tools

Copy code

The code is as follows:

bash-completion ctags git htop openssh subversion tk

graphics system

Since the USB flash drive has to be carried around, the graphics driver must have everything. Also do not pursue how fancy interface effect, simple and clear, so choose lxde + fluxbox.

Character interface resolution

After entering the character interface by default, the resolution is the maximum resolution. If you want to specify it separately, you can modify / etc / default / grub:

Copy code

The code is as follows:

GRUB_CMDLINE_LINUX_DEFAULT=”quiet [email protected]

Then grub-mkconfig – O / boot / grub/ grub.cfg Regenerate the grub configuration file.

NumLock is on by default

Two commands are needed: setleds, which comes with the system, and NumLock x installed through Pacman.

To open NumLock in the character interface, you can add:

Copy code

The code is as follows:

# Numlock
if [ -x /usr/bin/setleds ]; then
for tty in /dev/tty{1..6}; do
/usr/bin/setleds -D +num < /dev/tty > /dev/null 2>&1
done
fi

This setting will automatically open NumLock after login. If you want to open NumLock before login, you can refer to arch Wiki to add the above content to / etc/ rc.local Or / etc / inittab, but it’s not as easy to back up as you configure it.

To open NumLock under X, add the following in $home /. Xinitrc:

Copy code

The code is as follows:

# Set numlock
if [ -x /usr/bin/numlockx ]; then
/usr/bin/numlockx on
fi

Install xorg and graphics driver

Copy code

The code is as follows:

Xorg: xorg-server xorg-xinit xorg-server-utils mesa

Video card driver:

Copy code

The code is as follows:

xf86-video-ati xf86-video-intel xf86-video-nouveau nouveau-dri

Notebook touch pad support:

Copy code

The code is as follows:

xf86-input-synaptics

Test whether x works normally:

Copy code

The code is as follows:

xorg-twm xorg-xclock xterm

Now you can start x with startx to see the crude graphical interface. If you want to turn off x with Ctrl + Alt + backspace, you need to use / etc / X11/ xorg.conf .d/10- evdev.conf Add a paragraph:

Copy code

The code is as follows:

Section “InputClass”
Identifier “Keyboard Defaults”
MatchIsKeyboard “yes”
Option “XkbOptions” “terminate:ctrl_alt_bksp”
EndSection

Install lxde & fluxbox

All packages of the lxde group
Fluxbox
Gamin monitoring file system changes
Common software: leafpad obconf epdfview
Configure a simple $home /. Xinitrc, copy it from / etc / Skel /. Xinitrc, and add:

Copy code

The code is as follows:

#Xrandr – s 1024×768 ා specify resolution in advance if necessary
exec startlxde

Now it’s all in the world of liquid crystal. It’s rare that the refresh rate of resolution exceeds the limit and does not display. The resolution on the command line can be automatic. If the word is small, there is a method to modify grub settings. Under graphics, lxde also supports auto resolution, which is generally set automatically.

To change OPENBOX to fluxbox, you need to modify / etc / XDG / lxsession / lxde/ desktop.conf :

Copy code

The code is as follows:

[Session]
window_manager=fluxbox

Chinese related

Basic font

Copy code

The code is as follows:

ttf-dejavu artwiz-fonts wqy-microhei

typewriting

Copy code

The code is as follows:

fcitx-im fcitx-configtool fcitx-fbterm

, in $home /. Xinitrc, add:

Copy code

The code is as follows:

export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=”@im=fcitx”

Font configuration, the original use of other commonly used fonts and configuration files have been moved over, is the $home /. Fonts directory, Ubuntu is used very well, here can also be used directly. $homes /. Homes/ fonts.conf Link to / etc / fonts/ local.conf Then modify / etc / fonts/ conf.avail Lower 40- nonlatin.conf And 60- latin.conf Set Simsun or other fonts you like as the preferred font. Finally, update the font cache under $FC cache – VF and restart X.

Basic view of system information

After the installation is completed, the user can be set up, and then the system can be restarted, and then the top backed up files are copied back to the corresponding directory (/ etc / fstab file is not copied back, but the code loading other hard disk partitions can be written to the current system). So far, the entire system is installed and set.
The following is the running effect, because the capture software is not installed, there is no screenshot.

Run under root:

Copy code

The code is as follows:

pacman -Scc

Empty the downloaded temporary files, and then

Copy code

The code is as follows:

df -h

Take a look at how much disk space is taken up. (my entire system only uses 1.2g of space)
again

Copy code

The code is as follows:

free -h

Let’s see how much memory the system will take up when it starts up. (my boot to Gui only takes 54 MB of memory, while non GUI uses 41 MB)
again

Copy code

The code is as follows:

pacman -Q | uniq -u |wc -l

See how many packages are installed in the system (mine only has 258 packages installed)
Well, this system is small and light enough!

PS: some personal preferences
(1) Pcmanfm: if you want to use pcmanfm as the resource manager, install it. If you want to use other resource managers, install others. One of the advantages of installing pcmanfm is that when setting the desktop background in the future, you can directly use pcmanfm to set it without installing other tools.
However, from the perspective of small system and light system, I recommend a tool called Ranger to replace resource managers such as pcmanfm. This Ranger is a resource manager under the command line. It is very compact, and its shortcut operation is similar to vim. It can achieve the effect of “performing all operations without a mouse”. If Ranger is installed, it is recommended to install FEH for desktop background in the future. At the same time, if FEH is installed, there is no need to install other image viewing software. FEH is the most compact and suitable image viewer for keyboard operation.
If a graphical resource manager such as pcmanfm is installed, an image viewer needs to be installed. Gpicview is recommended.
(2) Geany text editor: geany is an optional installation. In the past, I used to use the compact leafpad as the text editor. Later, in order to minimize the installation of tool software in the system, I spent a period of time learning to use vim. Later, I used geany occasionally. I felt that it was powerful in script editing environment, and it was also small, so I used it instead Instead of leafpad, it has become a pure text editor and programming tool in my system.
(3) Dmenu program launcher: highly recommended! I’m in OPENBOX rc.xml It is bound with win key and R key as a shortcut key. Usually, no matter writing documents or doing other work, the hand does not have to leave the keyboard, press the shortcut key directly, you can start dmenu. Enter the name of the program to be started in dmenu, even if you don’t need to input the complete name and the name is wrong, it doesn’t matter. The program can be started directly. This tool can almost completely replace the right-click menu of OPENBOX!
(4) Many people like to use evince for PDF viewer, but evince is too big. Epdfview is recommended.
(5) Compression and decompression tools, if familiar with the command line, in fact, only need to install unzip, Unrar, usually to use the time directly run the command line. If you want to use a graphical interface, it is recommended to use xarchiver. Note that there is a tool with a similar name called xarchive, which is also used for compression and decompression. The two tools are not the same. The file roller used by many people is too big for me to like.
(6) If you want to use the network manager network management tool, you need to install the corresponding tools, including: network manager network manager applet Gnome icon theme Gnome keyring. However, I suggest that you should set up the network manually. Although this graphical tool is convenient, it is a bit large.