当前位置:网站首页>Debian change source and uninstall useless services

Debian change source and uninstall useless services

2022-06-23 22:51:00 Loader

First use Debian What about the system? , We usually perform these operations first , Update the source or replace the source , Delete useless port occupancy Services , Give us a clean system , Here are some of my own tutorials , Take notes by the way .

Upgrade source package :

apt update && apt install wget curl nano screen git -y
# perhaps 
apt update && apt upgrade -y

View source

cat /etc/apt/sources.list

One click to change the source to 163

echo 'deb http://mirrors.163.com/debian/ buster main non-free contrib
deb http://mirrors.163.com/debian/ buster-updates main non-free contrib
deb http://mirrors.163.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ buster main non-free contrib
deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib
' > /etc/apt/sources.list

Manually change

vim /etc/apt/sources.list

163 Source

deb http://mirrors.163.com/debian/ buster main non-free contrib
deb http://mirrors.163.com/debian/ buster-updates main non-free contrib
deb http://mirrors.163.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ buster main non-free contrib
deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib

Tencent source

deb http://mirrors.cloud.tencent.com/debian/ buster main non-free contrib
deb http://mirrors.cloud.tencent.com/debian-security buster/updates main
deb http://mirrors.cloud.tencent.com/debian/ buster-updates main non-free contrib
deb http://mirrors.cloud.tencent.com/debian/ buster-backports main non-free contrib
  
deb-src http://mirrors.cloud.tencent.com/debian-security buster/updates main
deb-src http://mirrors.cloud.tencent.com/debian/ buster main non-free contrib
deb-src http://mirrors.cloud.tencent.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.cloud.tencent.com/debian/ buster-backports main non-free contrib

One click to change to the default source

echo 'deb http://deb.debian.org/debian/ stretch main
deb-src http://deb.debian.org/debian/ stretch main
deb http://security.debian.org/debian-security stretch/updates main
deb-src http://security.debian.org/debian-security stretch/updates main
\# stretch-updates, previously known as 'volatile'
deb http://deb.debian.org/debian/ stretch-updates main
deb-src http://deb.debian.org/debian/ stretch-updates main
' > /etc/apt/sources.list

debian Firewall introduction :

https://www.lanbu.net/d/82

Delete useless Services

debian8 The version is inexplicably full of ports , This makes me look a little uncomfortable , I checked some information , Finally found some solutions , Now share with you .

Delete exim4 service

exim4 service to open up port :25 Everyone knows that this port can do anything !

systemctl stop exim4 
systemctl disable exim4
apt-get purge --auto-remove exim4 exim4-base exim4-config exim4-daemon-light
rm -rf /var/log/exim4/

Delete rpcbind service

rpcbind service This service is on port :111 This port .

systemctl stop rpcbind
systemctl disable rpcbind
apt-get purge --auto-remove rpcbind

Delete nfs service

systemctl stop nfs-common
systemctl disable nfs-common
apt-get purge --auto-remove nfs-kernel-server nfs-common portmap

All of the above are from centos go to debian Pit encountered .

原网站

版权声明
本文为[Loader]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/12/202112101121038590.html