debian更改源和卸载无用服务

初次使用Debian系统呢,上来我们一般要先执行这些操作,更新源或者更换源,删除无用的端口占用服务,还我们一个干净的系统,以下自己的一些使用教程,顺便记录下笔记。

升级源软件包:

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

查看源

cat /etc/apt/sources.list

一键更改源为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

手动更改

vim /etc/apt/sources.list

163源

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

腾讯源

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

一键改为默认源

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防火墙介绍:

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

删除无用服务

debian8版本莫名其妙会有很多的端口占用,这让我看着有点非常不爽,查了些资料,终于找到了些解决办法,现在分享给大家。

删除 exim4 服务

exim4服务 开放 port :25 大家都知道这个端口做啥都吧!

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

删除 rpcbind 服务

rpcbind 服务 此服务开启port :111 这个端口。

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

删除nfs服务

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

以上这些都是本人从centos转到debian遇到的坑。

原创文章,作者:kirin,如若转载,请注明出处:https://blog.ytso.com/212448.html

(0)
上一篇 2021年12月16日
下一篇 2021年12月16日

相关推荐

发表回复

登录后才能评论