[+] 增加 src 源
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Build Docker Image / Explore-Gitea-Actions (push) Successful in 12s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	Build Docker Image / Explore-Gitea-Actions (push) Successful in 12s
				
			This commit is contained in:
		
							parent
							
								
									1158047f6f
								
							
						
					
					
						commit
						24179ff666
					
				
							
								
								
									
										12
									
								
								init-apt.sh
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								init-apt.sh
									
									
									
									
									
								
							| @ -17,7 +17,11 @@ $(for suite in ${release} ${release}-updates ${release}-backports; do | ||||
|   echo "Suites: $suite" | ||||
|   echo "Components: ${components}" | ||||
|   echo "Signed-By: /usr/share/keyrings/${type}-archive-keyring.gpg" | ||||
|   echo | ||||
|   echo "Types: deb-src" | ||||
|   echo "URIs: https://mirrors.martin98.com/repository/${type}-tsinghua-${suite}/" | ||||
|   echo "Suites: $suite" | ||||
|   echo "Components: ${components}" | ||||
|   echo "Signed-By: /usr/share/keyrings/${type}-archive-keyring.gpg" | ||||
| done) | ||||
| EOF | ||||
| # 传统格式 | ||||
| @ -26,6 +30,7 @@ elif [ -f /etc/apt/sources.list ]; then | ||||
|     cat > /etc/apt/sources.list <<EOF | ||||
| $(for suite in ${release} ${release}-updates ${release}-backports; do | ||||
|   echo "deb https://mirrors.martin98.com/repository/${type}-tsinghua-${suite}/ ${suite} ${components}" | ||||
|   echo "deb-src https://mirrors.martin98.com/repository/${type}-tsinghua-${suite}/ ${suite} ${components}" | ||||
| done) | ||||
| EOF | ||||
| else | ||||
| @ -41,6 +46,7 @@ apt update && apt upgrade -y | ||||
| 
 | ||||
| # NTP | ||||
| # 启用阿里云 ntp | ||||
| if pidof systemd >/dev/null 2>&1; then | ||||
|     apt install chrony -y | ||||
|     cat > /etc/chrony.conf <<EOF | ||||
| server ntp4.aliyun.com minpoll 4 maxpoll 10 iburst | ||||
| @ -48,14 +54,14 @@ server ntp5.aliyun.com iburst | ||||
| driftfile /var/lib/chrony/drift | ||||
| allow 127.0.0.1 | ||||
| EOF | ||||
| 
 | ||||
| if pidof systemd >/dev/null 2>&1; then | ||||
|     systemctl restart chrony && systemctl enable chrony | ||||
| else | ||||
|     echo "systemctl 不存在,跳过 chrony 的重启" | ||||
| fi | ||||
| 
 | ||||
| # fix vim 粘贴 | ||||
| if pidof vim >/dev/null 2>&1; then | ||||
|   if ! grep -q "set pastetoggle=" ~/.vimrc; then | ||||
|       echo "set pastetoggle=" >> ~/.vimrc | ||||
|   fi | ||||
| fi | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user