In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to set up Arch Linux initially after installation". Friends who are interested may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to make initial setup after Arch Linux installation".
Configure the wired network.
When there is no network, you can directly set ip emergency, and then netctl is the formal setting:
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 are not accustomed to the device name enp0s4, you can change it in udev (restart takes effect):
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 you use dhcd to dynamically assign addresses:
The code is as follows:
# dhcpcd # automatically let eth0 get IP
# # or configure the service to start itself (more convenient)
# systemctl enable dhcpcd@eth0
# systemctl start dhcpcd@eth0
If you use static addresses, you are now managed with netctl:
The code is as follows:
# pacman-S ifplugd
# systemctl disable dhcpcd@eth0
# systemctl stop dhcpcd@eth0 # disable DHCP, otherwise there will be interference
# cd / etc/netctl
# cp examples/ethernet-static home
# vi home # set my static IP setting profile
# systemctl enable netctl
# restart to clear the temporary IP settings
# netctl start home
# netctl enable home
If you want to quickly switch the network environment, and then create a new profile file under / etc/netctl/, and use netctl switch-to PROFILE to switch, the old one will be stopped automatically. For more details, you can take a look at the netctl I wrote before how to choose profile.
To install vim, the default vi is not used:
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:
The code is as follows:
# cat / etc/modprobe.d/nopcspkr.conf
Blacklist pcspkr
This file needs to be created by yourself.
Install ntp automatic update time
The code is as follows:
# pacman-S ntp libedit
# systemctl enable ntpd
# systemctl start ntpd
In addition, Arch recommends adding an iburst parameter to / etc/ntp.conf, such as:
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:
The code is as follows:
# systemctl restart ntpd
# ntpq-np
After the time synchronization is completed, write the hardware clock with hwclock-w.
Create a normal user.
The code is as follows:
# useradd-m fwolf
# passwd fwolf
Usually, for this user, we want to give sudo permission:
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
The code is as follows:
% admin ALL= (ALL) ALL
% sudo ALL= (ALL:ALL) ALL
# chmod 0440 / etc/sudoers.d/fwolf_sudo_conf
Note that the name of the file under / etc/sudoers.d/ is marked with ~ or. Will not take effect, see CentOS-0005017: The # includedir directive in sudoers does not work, the file attribute must also be 0440.
Install Yaourt
Add to / etc/pacman.conf:
The code is as follows:
[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch
Then pacman-Sy yaourt completes the installation.
Install other common tools
The code is as follows:
Bash-completion ctags git htop openssh subversion tk
Graphic system
Since the flash drive has to be carried around, the graphics driver must have everything. Do not pursue how fancy interface effect, concise and lively, 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 otherwise, you can modify / etc/default/grub:
The code is as follows:
GRUB_CMDLINE_LINUX_DEFAULT= "quiet video-1024x768M@75m"
Then grub-mkconfig-o / boot/grub/grub.cfg regenerates the grub configuration file.
Numlock is lit by default
Two commands are required: setleds that comes with the system and numlockx that is installed through pacman.
To open Numlock in the character interface, add to $HOME/.bashrc:
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 automatically opens Numlock after logging in. If you want to open it before logging in, you can add the above to / etc/rc.local or / etc/inittab by referring to Arch Wiki, but it is not as easy to back up as the user configuration.
To open Numlock under X, add to $HOME/.xinitrc:
The code is as follows:
# Set numlock
If [- x / usr/bin/numlockx]; then
/ usr/bin/numlockx on
Fi
Install xorg and video card driver
The code is as follows:
Xorg: xorg-server xorg-xinit xorg-server-utils mesa
Video card driver:
The code is as follows:
Xf86-video-ati xf86-video-intel xf86-video-nouveau nouveau-dri
The laptop touchpad supports:
The code is as follows:
Xf86-input-synaptics
Test if X is working properly:
The code is as follows:
Xorg-twm xorg-xclock xterm
Now you can start X with startx to see a rudimentary graphical interface. If you want to close X with Ctrl+Alt+Backspace, you need to add a paragraph to / etc/X11/xorg.conf.d/10-evdev.conf:
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 that monitors file system changes
Common software: leafpad obconf epdfview
Configure a simple $HOME/.xinitrc, make a copy from / etc/skel/.xinitrc, and then add:
The code is as follows:
# xrandr-s 1024x768 # specify the resolution in advance if necessary
Exec startlxde
Now it is all in the LCD world, and it is rare that the resolution refresh rate exceeds the limit and does not display. The resolution under the command line can be used automatically. There is a method to modify grub settings on the command line, and LXDE under graphics also supports auto resolution, which is generally automatically set.
To change Openbox to Fluxbox, you need to modify / etc/xdg/lxsession/LXDE/desktop.conf:
The code is as follows:
[Session]
Window_manager=fluxbox
Chinese related
Basic font
The code is as follows:
Ttf-dejavu artwiz-fonts wqy-microhei
Input method
The code is as follows:
Fcitx-im fcitx-configtool fcitx-fbterm
, add to $HOME/.xinitrc:
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 are moved here, that is, the $HOME/.fonts directory, Ubuntu is very good, here can also be used directly. The $HOME/.fonts/fonts.conf link takes effect as / etc/fonts/local.conf, then modify the 40-nonlatin.conf and 60-latin.conf under / etc/fonts/conf.avail to set SimSun or other fonts you like as the preferred font, and finally $fc-cache-vf updates the font cache and restarts X.
Basic view of system information
After installation, set up the user, you can restart the system, and then copy the files backed up above to the corresponding directory (the / etc/fstab file is not copied back, but the code that loads other hard disk partitions is written into the current system). At this point, the entire system is installed and set up.
The following is the running effect, because the screenshot software is not installed, there is no screenshot.
Run under root:
The code is as follows:
Pacman-Scc
Empty the downloaded temporary files, and then
The code is as follows:
Df-h
Look at how much disk space is taken up (my entire system uses only 1.2g of space)
Again
The code is as follows:
Free-h
See how much memory the system takes up when booting up (my boot-to-graphical interface only takes up 54mb memory, while the non-graphical interface is 41mb memory)
Again
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, and if you want to use other resource managers, install other ones. An pcmanfm has an advantage, that is, when setting the desktop background in the future, you can directly use pcmanfm to set it, and there is no need to install other tools.
However, from the point of view of small systems and light systems, I recommend a tool called ranger to replace resource managers such as pcmanfm. This ranger is the resource manager under the command line, which is very small, and the quick operation is similar to vim, which can achieve the effect of "performing everything without a mouse". Install ranger, the future desktop background is recommended to install feh to achieve, at the same time, the installation of feh, there is no need to install other picture viewing software, feh is the smallest, suitable for keyboard operation of the picture viewer.
If you are installing a graphical resource manager such as pcmanfm, you also need to install an image viewer, which is recommended as gpicview.
(2) geany text editor: geany is an optional installation. In the past, I liked to use the compact leafpad as a 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, and then accidentally used geany. I feel that it is really powerful and small in the script editing environment, so I use it instead of leafpad. Has become a plain text editor and programming tool in my system.
(3) dmenu program initiator: highly recommended! I am in openbox's rc.xml, for its binding win key plus R key as a shortcut key, usually whether it is writing documents or other work, the hand does not have to leave the keyboard, directly press the shortcut key to start dmenu, enter the program name in dmenu, and even do not have to type the whole name, name typing wrong, it does not matter, the program can be started directly. This tool can almost completely replace the right-click menu of openbox!
(4) PDF viewer many people like to use evince, but evince is too big, so it is recommended to use epdfview.
(5) Compression and decompression tools, if you are familiar with the command line, you only need to install unzip and unrar, and run the command directly when you want to use it. 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 are not the same tool. Many people use File-Roller, which is so big that I don't like it.
(6) if you want to use NetworkManager network management tools, you also need to install the corresponding things, including: networkmanager network-manager-applet gnome-icon-theme gnome-keyring, but I suggest that it is better to set up the network manually, this graphical tool is convenient, but it is a bit big.
At this point, I believe you have a deeper understanding of "how to set up the initial Arch Linux after installation". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.