{"id":273190,"date":"2023-05-24T20:02:37","date_gmt":"2023-05-24T12:02:37","guid":{"rendered":"https:\/\/lrxjmw.cn\/lxtfwglxtdjb.html"},"modified":"2023-05-24T20:02:37","modified_gmt":"2023-05-24T12:02:37","slug":"lxtfwglxtdjb","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/lxtfwglxtdjb.html","title":{"rendered":"Linux\u7cfb\u7edf\u670d\u52a1\u7ba1\u7406\u7cfb\u7edf\u7684\u57fa\u672c\u8bed\u6cd5\u4ecb\u7ecd\u53ca\u89e3\u51b3\u529e\u6cd5\uff01"},"content":{"rendered":"

Day08Linux<\/a>\u81ea\u6709\u670d\u52a1\u4e0e\u8f6f\u4ef6\u5305\u7ba1\u7406\u4e00\u3001systemctl\u7ba1\u7406\u7cfb\u7edf<\/a>\u670d\u52a11\u3001systemctl\u6982\u8ff0<\/p>\n

CentOS6\u7248\u672c\uff1a<\/p>\n

service\u547d\u4ee4<\/a>\uff08\u7ba1\u7406\u670d\u52a1\u5f00\u542f\u3001\u505c\u6b62\u4ee5\u53ca\u91cd\u542f\uff09+chkconfig\uff08\u5b9a\u4e49\u5f00\u673a\u542f\u52a8\u9879\uff09<\/p>\n

\n

# service network start|stop|restart<\/span>\n<\/code><\/pre>\n<\/p>\n

CentOS7\u7248\u672c\uff1a<\/p>\n

systemctl\u547d\u4ee4=system\u7cfb\u7edf+control\u63a7\u5236\uff08\u670d\u52a1\u7ba1\u7406+\u5f00\u542f\u542f\u52a8\u9879\u7ba1\u7406\uff09<\/p>\n

\n

# systemctl start|stop|restart network<\/span>\n<\/code><\/pre>\n<\/p>\n

2\u3001\u663e\u793a\u7cfb\u7edf\u670d\u52a1<\/p>\n

\u57fa\u672c\u53e5\u578b\uff1a<\/p>\n

\n

# systemctl [\u9009\u9879]<\/span>\n\u9009\u9879\u8bf4\u660e\uff1a\nlist-<\/span>units --<\/span>type<\/span> service --<\/span>all\uff1a\u5217\u51fa\u6240\u6709\u670d\u52a1\uff08\u5305\u542b\u542f\u52a8\u7684\u548c\u6ca1\u542f\u52a8\u7684\uff09\nlist-<\/span>units --<\/span>type<\/span> service\uff1a\u5217\u51fa\u6240\u6709\u542f\u52a8\u7684\u670d\u52a1\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b\u4e00\uff1a\u5217\u4e3eLinux\u7cfb\u7edf\u4e2d\u6240\u6709\u7684\u670d\u52a1\uff08\u5305\u542b\u542f\u52a8\u7684\u548c\u6ca1\u542f\u52a8\u7684\uff09<\/p>\n

\n

# systemctl list-units --type service --all<\/span>\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b\u4e8c\uff1a\u53ea\u5217\u4e3e\u65e9\u5df2\u542f\u52a8\u7684Linux\u7cfb\u7edf\u670d\u52a1<\/p>\n

\n

# systemctl list-units --type service<\/span>\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b\u4e09\uff1a\u628asystemctl\u663e\u793a\u7cfb\u7edf\u670d\u52a1\u4e0e\u7ba1\u7ebf\u547d\u4ee4\u76f8\u7ed3\u5408\uff0c\u7b5b\u9009\u6211\u4eec\u60f3\u8981\u7684\u670d\u52a1\u4fe1\u606f<\/p>\n

\n

# systemctl list-units --type service | grep sshd<\/span>\n<\/code><\/pre>\n<\/p>\n

3\u3001Linux\u7cfb\u7edf\u670d\u52a1\u7ba1\u7406\u2606status\u67e5\u770b\u72b6\u6001<\/p>\n

\u67e5\u770b\u7cfb\u7edf\u670d\u52a1\u7684\u72b6\u6001<\/p>\n

\n

# systemctl status \u7cfb\u7edf\u670d\u52a1\u7684\u540d\u79f0<\/span>\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b\uff1a\u67e5\u8be2\u7cfb\u7edf\u4e2d\u7f51\u8def\u670d\u52a1\u7684\u72b6\u6001\u4fe1\u606f<\/p>\n

\n

# systemctl status network<\/span>\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b\uff1a\u67e5\u8be2\u7cfb\u7edf\u4e2dsshd\u670d\u52a1\u7684\u72b6\u6001\u4fe1\u606f<\/p>\n

\n

# systemctl status sshd<\/span>\n<\/code><\/pre>\n<\/p>\n

\u2606stop\u505c\u6b62\u670d\u52a1<\/p>\n

\n

# systemctl stop \u7cfb\u7edf\u670d\u52a1\u7684\u540d\u79f0<\/span>\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b\uff1a\u4f7f\u7528systemctl\u547d\u4ee4\u505c\u6b62network\u7f51\u8def\u670d\u52a1<\/p>\n

\n

# systemctl stop network<\/span>\n<\/code><\/pre>\n<\/p>\n

\u2606start\u542f\u52a8\u670d\u52a1<\/p>\n

\n

# systemctl start \u7cfb\u7edf\u670d\u52a1\u7684\u540d\u79f0<\/span>\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b\uff1a\u4f7f\u7528systemctl\u547d\u4ee4\u542f\u52a8network\u7f51\u8def\u670d\u52a1<\/p>\n

\n

# systemctl start network<\/span>\n<\/code><\/pre>\n<\/p>\n

\u2606restart\u91cd\u542f\u670d\u52a1<\/p>\n

\n

# systemctl restart \u7cfb\u7edf\u670d\u52a1\u7684\u540d\u79f0<\/span>\n\u7b49\u4ef7\u4e8e\n# systemctl stop \u7cfb\u7edf\u670d\u52a1\u7684\u540d\u79f0<\/span>\n# systemctl start \u7cfb\u7edf\u670d\u52a1\u7684\u540d\u79f0<\/span>\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b\uff1a\u4f7f\u7528systemctl\u547d\u4ee4\u91cd\u542fcrond\u8ba1\u5212\u4efb\u52a1\u7684\u670d\u52a1\u4fe1\u606f<\/p>\n

\n

# systemctl restart crond<\/span>\n<\/code><\/pre>\n<\/p>\n

\u2606reload\u70ed\u91cd\u8f7d\u6280\u672f<\/p>\n

\n

# systemctl reload \u7cfb\u7edf\u670d\u52a1\u540d\u79f0<\/span>\n<\/code><\/pre>\n<\/p>\n

reload\uff1a\u91cd\u65b0\u52a0\u8f7d\u6307\u5b9a\u670d\u52a1\u7684\u914d\u7f6e\u6587\u4ef6\uff08\u5e76\u975e\u6240\u6709\u670d\u52a1\u90fd\u652f\u6301reload\uff0c\u4e00\u822c\u4f7f\u7528restart)<\/p>\n

\u6709\u4e9b\u670d\u52a1\uff0c\u5982Nginx\uff0c\u4fee\u6539\u4e86\u914d\u7f6e\u6587\u4ef6\uff0c\u800c\u4e14\u4e0d\u80fd\u91cd\u542fNginx\u670d\u52a1\uff0c\u53ea\u662f\u60f3\u7acb\u523b\u8ba9\u6211\u4eec\u914d\u7f6e\u6587\u4ef6\u7684\u4fee\u6539\u751f\u6548\uff0c\u5219\u5c31\u53ef\u4ee5\u4f7f\u7528\u70ed\u91cd\u8f7d\u6280\u672f\u4e86\u3002<\/p>\n

\u6848\u4f8b\uff1a\u4f7f\u7528\u70ed\u91cd\u8f7d\u6280\u672f\u91cd\u65b0\u52a0\u8f7dcrond\u670d\u52a1<\/p>\n

\n

# systemctl reload crond<\/span>\n<\/code><\/pre>\n<\/p>\n

4\u3001\u670d\u52a1\u6301\u4e45\u5316\uff08\u5f00\u673a\u81ea\u542f\u4e0e\u5f00\u673a\u4e0d\u81ea\u542f\uff09<\/p>\n

\u6240\u8c13\u670d\u52a1\u6301\u4e45\u5316\uff0c\u5c31\u662f\u670d\u52a1\u5728\u5f00\u673a\u7684\u65f6\u4faf\uff0c\u662f\u5426\u624b\u52a8\u542f\u52a8\u3002<\/p>\n

\u2606\u5f00\u673a\u81ea\u542f<\/p>\n

\n

# systemctl enable \u7cfb\u7edf\u670d\u52a1\u7684\u540d\u79f0<\/span>\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b\uff1a\u628anetwork\u7f51\u8def\u670d\u52a1\u8bbe\u7f6e\u4e3a\u5f00\u673a\u81ea\u542f\u52a8<\/p>\n

\n

# systemctl enable network<\/span>\nnetwork.<\/span>service is not a native service,<\/span> redirecting to \/<\/span>sbin\/<\/span>chkconfig.<\/span>\nExecuting \/<\/span>sbin\/<\/span>chkconfig network on\n\u4ee5\u4e0a\u63d0\u793a\u4ee3\u8868network.<\/span>service\u4e0d\u662f\u4e00\u4e2a\u672c\u5730\u7684\u7cfb\u7edf\u670d\u52a1\uff0c\u6240\u4ee5\u60f3\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f\u9700\u8981\u4f7f\u7528\/<\/span>sbin\/<\/span>chkconfig\u8fdb\u884c\u64cd\u4f5c\n# \/sbin\/chkconfig network on<\/span>\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b\uff1a\u628acrond\u8ba1\u5212\u4efb\u52a1\u7684\u670d\u52a1\u4fe1\u606f\u6dfb\u52a0\u5230\u5f00\u673a\u81ea\u542f\u52a8\u4e2d<\/p>\n

\n

# systemctl enable crond<\/span>\n<\/code><\/pre>\n<\/p>\n

\u2606\u5f00\u673a\u4e0d\u81ea\u542f<\/p>\n

\n

# systemctl disable \u7cfb\u7edf\u670d\u52a1\u7684\u540d\u79f0<\/span>\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b\uff1a\u628acrond\u8ba1\u5212\u4efb\u52a1\u7684\u670d\u52a1\u4fe1\u606f\u4ece\u5f00\u673a\u81ea\u542f\u52a8\u4e2d\u79fb\u9664<\/p>\n

\n

# systemctl disable crond<\/span>\n<\/code><\/pre>\n<\/p>\n

\u4e8c\u3001\u6269\u5c55\uff1a\u7cfb\u7edf\u8fd0\u884c\u7ea7\u522b1\u3001\u4ec0\u4e48\u662f\u8fd0\u884c\u7ea7\u522b<\/p>\n

\u8fd0\u884c\u7ea7\u522b\u5168\u79f0\uff08RunningLevel\uff09\uff0c\u4ee3\u8868Linux\u7cfb\u7edf\u7684\u4e0d\u540c\u8fd0\u884c\u6a21\u5f0f<\/p>\n

2\u3001CentOS6\u7684\u8fd0\u884c\u7ea7\u522b<\/p>\n

\n

# vim \/etc\/inittab<\/span>\n0   \u7cfb\u7edf\u5173\u673a\u72b6\u6001   halt (<\/span>Do<\/span> NOT set<\/span> initdefault to this)<\/span>\n1   \u5355\u7528\u6237\u5de5\u4f5c\u72b6\u6001   Single user mode (<\/span>\u7c7b\u4f3cWindows\u7684\u5b89\u5168\u6a21\u5f0f\uff0cLinux\u5fd8\u8bb0\u5bc6\u7801)<\/span>\n2   \u591a\u7528\u6237\u72b6\u6001\uff08\u6ca1\u6709NFS\uff09 Multiuser,<\/span> without NFS (<\/span>The same as 3,<\/span> if<\/span> you do<\/span> not have networking)<\/span>\n3   \u591a\u7528\u6237\u72b6\u6001\uff08\u6709NFS\uff09   Full multiuser mode (<\/span>\u5b57\u7b26\u6a21\u5f0f,<\/span>\u670d\u52a1\u57fa\u672c\u90fd\u662f\u6b64\u6a21\u5f0f)<\/span>\n4   \u7cfb\u7edf\u672a\u4f7f\u7528\uff0c\u7559\u7ed9\u7528\u6237   unused\n5   \u56fe\u5f62\u754c\u9762    X11 (<\/span>\u56fe\u5f62\u6a21\u5f0f\uff0c\u4e2a\u4eba\u8ba1\u7b97\u673a\u90fd\u662f\u6b64\u6a21\u5f0f)<\/span>\n6   \u7cfb\u7edf\u6b63\u5e38\u5173\u95ed\u5e76\u91cd\u65b0\u542f\u52a8   reboot (<\/span>Do<\/span> NOT set<\/span> initdefault to this)<\/span>\n<\/code><\/pre>\n<\/p>\n

3\u3001CentOS7\u7684\u8fd0\u884c\u7ea7\u522b<\/p>\n

linux\u7cfb\u7edf\u4e0b\u66f4\u65b0\u65f6\u95f4\u7684\u547d\u4ee4\u662f\u4ec0\u4e48_linux\u7248\u672c\u66f4\u65b0\u547d\u4ee4_linux\u66f4\u65b0\u5185\u6838\u547d\u4ee4<\/p>\n

\n

0   shutdown.target\n1   emergency.target\n2   rescure.target\n3   multi-user.target   \u5b57\u7b26\u6a21\u5f0f\n4   \u65e0\n5   graphical.target    \u56fe\u5f62\u6a21\u5f0f\n6   \u65e0\n<\/code><\/pre>\n<\/p>\n

4\u3001init\u547d\u4ee4\uff08\u4e34\u65f6\u4fee\u6539\u8fd0\u884c\u6a21\u5f0f\uff09<\/p>\n

\n

# init \u6a21\u5f0f\u7f16\u53f7<\/span>\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b\uff1a\u7acb\u523b\u6b7b\u673a<\/p>\n

\n

# shutdown -h 0\u6216now<\/span>\n\u6216\n# halt -p<\/span>\n\u6216\n# init 0<\/span>\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b\uff1a\u7acb\u523b\u91cd\u542f<\/p>\n

\n

# reboot<\/span>\n\u6216\n# init 6<\/span>\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b\uff1a\u628a\u8ba1\u7b97\u673a\u5207\u6362\u5230\u5b57\u7b26\u6a21\u5f0f\uff08\u9ed1\u7a97\u53e3\uff09<\/p>\n

\n

# init 3<\/span>\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b\uff1a\u628a\u8ba1\u7b97\u673a\u5207\u6362\u5230\u56fe\u5f62\u6a21\u5f0f\uff08\u56fe\u5f62\u754c\u9762\uff09<\/p>\n

\n

# init 5<\/span>\n<\/code><\/pre>\n<\/p>\n

5\u3001CentOS6\u4e2d\u7684chkconfig<\/p>\n

\u95ee\u9898\uff1a\u5728CentOS7\u4e2d\uff0c\u8bbe\u7f6enetwork\u5f00\u673a\u542f\u52a8\u65f6linux\u7cfb\u7edf\u4e0b\u66f4\u65b0\u65f6\u95f4\u7684\u547d\u4ee4\u662f\u4ec0\u4e48<\/strong>\uff0c\u7cfb\u7edf\u8981\u6c42\u4f7f\u7528chkconfig\u547d\u4ee4<\/p>\n

\n

# chkconfig network on<\/span>\n<\/code><\/pre>\n<\/p>\n

\u8bbe\u7f6e\u5b8c\u6210\u540e\uff0c\u5982\u4f55\u67e5\u770bnetwork\u6709\u6ca1\u6709\u968f\u5f00\u673a\u624b\u52a8\u542f\u52a8\u5462\uff1f<\/p>\n

\n

# chkconfig --list |grep network <\/span>\nnetwork        \t0:off\t1:off\t2:on\t3:on\t4:on\t5:on\t6:off\n\u53ea\u8981 3 \u548c 5 \u5f00\u542f\uff0cnetwork\u5c31\u5f00\u542f\u3002\n0 \u5173\u673a\u6a21\u5f0f\n1 \u5355\u7528\u6237\u6a21\u5f0f\n2 \u591a\u7528\u6237\u6a21\u5f0f\uff08\u65e0NFS\uff09\n3 \u5b57\u7b26\u6a21\u5f0f\n4 \u81ea\u5b9a\u4e49\u6a21\u5f0f\n5 \u56fe\u5f62\u6a21\u5f0f\n6 \u91cd\u542f\u6a21\u5f0f\n<\/code><\/pre>\n<\/p>\n

4\u3001NTP\u65f6\u95f4\u540c\u6b65\u64cd\u4f5c\u2606\u624b\u5de5\u540c\u6b65<\/p>\n

\u57fa\u672c\u53e5\u578b\uff1a<\/p>\n

\n

# ntpdate NTP\u670d\u52a1\u5668\u7684IP\u5730\u5740\u6216\u57df\u540d<\/span>\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b\uff1a\u67e5\u770bLinux\u7cfb\u7edf\u65f6\u95f4<\/p>\n

\n

# date<\/span>\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b\uff1a\u4eceNTP\u670d\u52a1\u5668\u4e2d\u540c\u6b65\u7cfb\u7edf\u65f6\u95f4<\/p>\n

\n

# ntpdate cn.ntp.org.cn<\/span>\n<\/code><\/pre>\n<\/p>\n

\u2606\u81ea\u52a8\u540c\u6b65<\/p>\n

\u57fa\u672c\u53e5\u578b\uff1a<\/p>\n

\n

\u2460 \u542f\u52a8ntpd\u670d\u52a1\n# systemctl start ntpd<\/span>\n\u2461 \u628antpd\u670d\u52a1\u8ffd\u52a0\u5230\u7cfb\u7edf\u5f00\u673a\u542f\u52a8\u9879\u4e2d\n# systemctl enable ntpd<\/span>\n<\/code><\/pre>\n<\/p>\n

\u56db\u3001Linux\u4e0b\u7684\u8f6f\u4ef6\u5305\u7ba1\u74061\u3001\u4ec0\u4e48\u662f\u8f6f\u4ef6\u5305<\/p>\n

\u8fd9\u662f\u54ea\u4e9b\uff1f<\/p>\n

\u7531\u4ee5\u4e0a\u56fe\u89e3\u53ef\u77e5\uff0c\u8fd9\u4e2aPC.exe\u662fWindows\u4e2d\u7684\u8f6f\u4ef6\u5b89\u88c5\u5305\u3002<\/p>\n

\u6240\u8c13\u7684Linux\u8f6f\u4ef6\u5305\u5c31\u662fLinux\u4e0b\u8f6f\u4ef6\u7684\u5b89\u88c5\u7a0b\u5e8f<\/p>\n

2\u3001Linux\u4e0b\u8f6f\u4ef6\u7684\u5b89\u88c5\u65b9\u6cd5<\/p>\n

\u2460RPM\u8f6f\u4ef6\u5305\u5b89\u88c5=>\u8f6f\u4ef6\u540d\u79f0.rpm<\/p>\n

\u2461YUM\u5305\u7ba1\u7406\u5de5\u5177=>yuminstall\u8f6f\u4ef6\u540d\u79f0-y<\/p>\n

\u2462\u6e90\u7801\u5b89\u88c5=>\u4e0b\u8f7d\u8f6f\u4ef6\u7684\u6e90\u4ee3\u7801=>\u7f16\u8bd1=>\u5b89\u88c5\uff08\u6700\u9ebb\u70e6\u7684\uff0c\u800c\u4e14\u4e5f\u6700\u7a33\u5b9a\uff09<\/p>\n

3\u3001\u4e8c\u8865\u7801\u8f6f\u4ef6\u5305<\/p>\n

\u200b\u4e8c\u8865\u7801\u5305\uff0c\u4e5f\u5c31\u662f\u6e90\u7801\u5305\u7ecf\u8fc7\u6210\u529f\u7f16\u8bd1\u4ee5\u540e\u5f62\u6210\u7684\u5305\u3002<\/p>\n

\u200b\u4e8c\u8865\u7801\u5305\u662fLinux\u4e0b\u9ed8\u8ba4\u7684\u8f6f\u4ef6\u5b89\u88c5\u5305\uff0c\u76ee\u524d\u4e3b\u8981\u6709\u4ee5\u4e0b2\u5927\u4e3b\u6d41\u7684\u4e8c\u8865\u7801\u5305\u7ba1\u7406\u7cfb\u7edf\uff1a<\/p>\n

\u200bRPM\u662fRedHatPackageManager\uff08RedHat\u8f6f\u4ef6\u5305\u7ba1\u7406\u5de5\u5177\uff09\u7684\u7b80\u5199<\/p>\n

\u200b\u4f5c\u7528\uff1arpm\u7684\u4f5c\u7528\u7c7b\u4f3c\u4e8e\u8695\u8c46\u835a\uff0c\u534e\u4e3a\u5e94\u7528\u5e02\u573a\uff0cAppStore\uff0c\u4e3b\u8981\u4f5c\u7528\u662f\u5bf9linux\u670d\u52a1\u5668\u4e0a\u7684\u8f6f\u4ef6\u5305\u8fdb\u884c\u5bf9\u5e94\u7ba1\u7406\u64cd\u4f5c\uff0c\u7ba1\u7406\u5206\u4e3a\uff1a\u67e5\u8be2\u3001\u5378\u8f7d\u3001\u5b89\u88c5\/\u66f4\u65b0\u3002<\/p>\n

4\u3001\u83b7\u53d6*.rpm\u8f6f\u4ef6\u5305<\/p>\n

a.\u53bb\u5b98\u7f51\u53bb\u4e0b\u8f7d\uff08\uff09\uff1b<\/p>\n

b.\u4e0d\u4ecb\u610f\u8001\u7248\u672c\u7684\u8bddlinux\u7cfb\u7edf\u4e0b\u66f4\u65b0\u65f6\u95f4\u7684\u547d\u4ee4\u662f\u4ec0\u4e48<\/strong>\uff0c\u53ef\u4ee5\u4ece\u5149\u789f\uff08\u6216\u5219\u955c\u50cf\u6587\u4ef6\uff09\u4e2d\u8bfb\u53d6\uff1bCentOS7.6*.iso<\/p>\n

5\u3001\u67e5\u8be2\u7cfb\u7edf\u4e2d\u5df2\u5b89\u88c5\u7684rpm\u8f6f\u4ef6<\/p>\n

\n

# rpm -qa |grep \u8981\u641c\u7d22\u7684\u8f6f\u4ef6\u540d\u79f0<\/span>\n\u9009\u9879\u8bf4\u660e\uff1a\n-<\/span>q \uff1aquery\uff0c\u67e5\u8be2\u64cd\u4f5c\n-<\/span>a \uff1aall\uff0c\u4ee3\u8868\u6240\u6709\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b1\uff1a\u67e5\u8be2\u8ba1\u7b97\u673a\u4e2d\u5df2\u5b89\u88c5\u7684rpm\u8f6f\u4ef6\u5305<\/p>\n

\n

# rpm -qa<\/span>\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b2\uff1a\u641c\u7d22\u8ba1\u7b97\u673a\u4e2d\u5df2\u5b89\u88c5\u7684firefox\u8f6f\u4ef6\u5305<\/p>\n

\n

# rpm -qa | grep firefox<\/span>\n<\/code><\/pre>\n<\/p>\n

6\u3001\u5378\u8f7dCentOS\u7cfb\u7edf\u4e2d\u7684rpm\u8f6f\u4ef6\u5305<\/p>\n

\n

# rpm -e \u8f6f\u4ef6\u540d\u79f0 [\u9009\u9879]<\/span>\n\u9009\u9879\u8bf4\u660e\uff1a\n--<\/span>nodeps \uff1a\u5f3a\u5236\u5378\u8f7d\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b\uff1a\u628a\u7cfb\u7edf\u4e2d\u7684firefox\u6d4f\u89c8\u5668\u8fdb\u884c\u5378\u8f7d\u64cd\u4f5c<\/p>\n

\n

# rpm -qa |grep firefox<\/span>\nfirefox-<\/span>60.<\/span>2.<\/span>2-<\/span>1.<\/span>el7.<\/span>centos.<\/span>x86_64\n# rpm -e firefox-60.2.2-1.el7.centos.x86_64<\/span>\n<\/code><\/pre>\n<\/p>\n

\u5378\u8f7d\u6210\u529f\u3002<\/p>\n

7\u3001rpm\u8f6f\u4ef6\u5305\u7684\u5b89\u88c5<\/p>\n

\u57fa\u672c\u53e5\u578b\uff1a<\/p>\n

\n

# rpm -ivh \u8f6f\u4ef6\u5305\u7684\u540d\u79f0.rpm<\/span>\n\u9009\u9879\u8bf4\u660e\uff1a\n-<\/span>i\uff1ainstall\uff0c\u5b89\u88c5\n-<\/span>v\uff1a\u663e\u793a\u8fdb\u5ea6\u6761\n-<\/span>h\uff1a\u8868\u793a\u4ee5\"#\"<\/span>\u5f62\u5f0f\u663e\u793a\u8fdb\u5ea6\u6761\n<\/code><\/pre>\n<\/p>\n

8\u3001rpm\u8f6f\u4ef6\u5305\u7684\u83b7\u53d6\uff08\u5149\u789f\uff09<\/p>\n

\u7b2c\u4e00\u6b65\uff1a\u5728VMware\u865a\u62df\u673a\u4e2d\u52a0\u8f7dCentOS7.6\u7684\u5b89\u88c5\u5149\u789f<\/p>\n

\u7b2c\u4e8c\u6b65\uff1a\u4f7f\u7528#lsblk\uff08listblockdevices\uff09\u6216\u5219df-T\u67e5\u770b\u7403\u72b6\u8bbe\u5907\u7684\u4fe1\u606f<\/p>\n

\n

# lsblk<\/span>\n[root@localhost ~]<\/span># lsblk<\/span>\nNAME            MAJ:MIN RM<\/span>  SIZE RO TYPE<\/span> MOUNTPOINT\nsda               8:0    0   20G  0 disk\n\u251c\u2500sda1            8:1    0    1G  0 part \/<\/span>boot\n\u2514\u2500sda2            8:2    0   19G  0 part\n  \u251c\u2500centos-<\/span>root 253:0    0   17G  0 lvm  \/<\/span>\n  \u2514\u2500centos-<\/span>swap 253:1    0    2G  0 lvm  [SWAP]<\/span>\nsr0              11:0    1  4.<\/span>3G  0 rom  \/<\/span>run\/<\/span>media\/<\/span>itheima\/<\/span>CentOS 7 x86_64\n\u7531\u4ee5\u4e0a\u56fe\u89e3\u53ef\u77e5\uff0c\/<\/span>dev\/<\/span>sr0\u4ee3\u8868\u5149\u9a71\u8bbe\u5907 => \u6302\u8f7d\u70b9 => \/<\/span>run\/<\/span>media\/<\/span>localhost\/<\/span>CentOS 7 x86_64\u6587\u4ef6\u5939\n\u6216\n# df -T<\/span>\n<\/code><\/pre>\n<\/p>\n

Linux\u64cd\u4f5c\u7cfb\u7edf\u7684\u4e2d\u6240\u6709\u50a8\u5b58\u8bbe\u5907\u5fc5\u987b\u5148\u6302\u8f7d\u540e\u4f7f\u7528<\/p>\n

\u7b2c\u4e09\u6b65\uff1a\u4f7f\u7528cd\u547d\u4ee4\uff0c\u5207\u6362\u5230\u6302\u8f7d\u76ee\u5f55<\/p>\n

\n

# cd \/run\/media\/localhost\/CentOS 7 x86_64<\/span>\n<\/code><\/pre>\n<\/p>\n

\u7b2c\u56db\u6b65\uff1a\u4f7f\u7528cd\u547d\u4ee4\uff0c\u5207\u6362\u5230Packages\u8f6f\u4ef6\u5305\u4e2d<\/p>\n

\n

# cd Packages<\/span>\n<\/code><\/pre>\n<\/p>\n

\u7b2c\u4e94\u6b65\uff1a\u67e5\u8be2\u6211\u4eec\u8981\u5b89\u88c5\u7684\u8f6f\u4ef6\u5305<\/p>\n

\n

# ls |grep firefox<\/span>\nfirefox-<\/span>60.<\/span>2.<\/span>2-<\/span>1.<\/span>el7.<\/span>centos.<\/span>x86_64.<\/span>rpm\n<\/code><\/pre>\n<\/p>\n

\u7b2c\u516d\u6b65\uff1a\u4f7f\u7528rpm-ivh\u547d\u4ee4\u5b89\u88c5\u8f6f\u4ef6<\/p>\n

\n

# rpm -ivh firefox-60.2.2-1.el7.centos.x86_64.rpm<\/span>\n<\/code><\/pre>\n<\/p>\n

\u8f93\u5165firefox+Tab\uff0c\u8ba9\u5176\u624b\u52a8\u8865\u5168<\/p>\n

9\u3001rpm\u8f6f\u4ef6\u5305\u7684\u5347\u7ea7<\/p>\n

\u57fa\u672c\u53e5\u578b\uff1a<\/p>\n

\n

# rpm -Uvh \u5347\u7ea7\u540e\u7684\u8f6f\u4ef6\u5305\u540d\u79f0.rpm<\/span>\n\u9009\u9879\u8bf4\u660e\uff1a\n-<\/span>U \uff1aUpdate\uff0c\u66f4\u65b0\u64cd\u4f5c\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b\uff1a\u4f7f\u7528rpm-Uvh\u5bf9firefox-60.2.2\u7248\u672c\u8fdb\u884c\u5347\u7ea7<\/p>\n

\n

# rpm -Uvh firefox-68.4.1-1.el7.centos.x86_64.rpm<\/span>\n<\/code><\/pre>\n<\/p>\n

10\u3001rpm\u6269\u5145\u2606\u4f9d\u8d56\u5173\u7cfb<\/p>\n

\u4e00\u4e2a\u8f6f\u4ef6\u5fc5\u987b\u5148\u6709\u5176\u4ed6\u8f6f\u4ef6\u80fd\u591f\u8fd0\u884c\uff0c\u6bd4\u5982\u4e4b\u524dxmind\u542f\u52a8\u8fc7\u7a0b\u4e2d\u63d0\u793a\u7684\u7f3a\u4e4fDLL\uff0c\u79f0\u4e4b\u4e3a\u4f9d\u8d56<\/p>\n

WAMP\uff08Windows+Apache+MySQL+PHP\uff09\u5b89\u88c5\u524d\u5fc5\u987b\u5148\u5b89\u88c5VC++2014x86_64\uff0c\u8fd9\u4e9b\u60c5\u51b5\u5c31\u79f0\u4e4b\u4e3a\u6709\u4f9d\u8d56\u5173\u7cfb\u3002<\/p>\n

60.8.0\u7684firefox\u53ef\u4ee5\u66f4\u65b0\u6210\u529f<\/p>\n

\u4e0b\u8fb9\u6211\u4eec\u5c1d\u8bd5\u66f4\u65b0\u523068.4.1\u7684\u7248\u672c<\/p>\n

\n

\u7528\u6cd5\uff1arpm -<\/span>Uvh \u8f6f\u4ef6\u5305\u540d\u79f0\n# rpm -Uvh firefox-68.4.1-1.el7.centos.x86_64.rpm<\/span>\n\u4f7f\u7528rpm\u547d\u4ee4\uff0c\u5b89\u88c568.<\/span>4.<\/span>1\u7248\u672c\u7684\u8f6f\u4ef6\u5305\n<\/code><\/pre>\n<\/p>\n

\u9519\u8bef\u63d0\u793a\uff1a<\/p>\n

error\uff1aFaileddependencies:<\/p>\n

\u63d0\u793a\u5b89\u88c568\u7248\u672c\u7684firefox\u987b\u8981\u4f9d\u8d56nspr4.21\u7684\u7248\u672c\uff0cnss\u76843.44\u7684\u7248\u672c\uff0c\u8fd9\u5c31\u662f\u6211\u4eec\u8bf4\u7684\u4f9d\u8d56\u5173\u7cfb\u3002<\/p>\n

\u4e3a\u4e86\u89e3\u51b3\u4f9d\u8d56\u5173\u7cfb\u7684\u95ee\u9898\uff0c\u6709\u53e6\u5916\u4e00\u4e2a\u7ba1\u7406\u5de5\u5177\u79f0\u4f5cyumlinux\u8bfe\u7a0b\uff0c\u524d\u9762\u6211\u4eec\u4f1a\u8c08\u5230\u3002<\/p>\n

linux\u7cfb\u7edf\u4e0b\u66f4\u65b0\u65f6\u95f4\u7684\u547d\u4ee4\u662f\u4ec0\u4e48_linux\u66f4\u65b0\u5185\u6838\u547d\u4ee4_linux\u7248\u672c\u66f4\u65b0\u547d\u4ee4<\/p>\n

\n

A\u8f6f\u4ef6\nA\u8f6f\u4ef6 => \u9700\u8981\u4f9d\u8d56B\u8f6f\u4ef6\nB\u8f6f\u4ef6 => \u9700\u8981\u4f9d\u8d56C\u8f6f\u4ef6\nC\u8f6f\u4ef6\n<\/code><\/pre>\n<\/p>\n

\u4f9d\u8d56\u5173\u7cfb\u7684\u89e3\u51b3\uff1a\u4f7f\u7528YUM\u8f6f\u4ef6\u5305\u7ba1\u7406\u5de5\u5177\u5bf9\u5176\u8fdb\u884c\u5b89\u88c5\uff08\u624b\u52a8\u89e3\u51b3\u4f9d\u8d56\u5173\u7cfb\uff09<\/p>\n

\n

# yum install firefox -y<\/span>\n<\/code><\/pre>\n<\/p>\n

\u2606\u67e5\u770b\u6587\u4ef6\u6240\u5c5e\u7684\u5305\u540d<\/p>\n

\u57fa\u672c\u53e5\u578b\uff1af=file<\/p>\n

\n

# rpm -qf \u6587\u4ef6\u540d\u79f0<\/span>\n<\/code><\/pre>\n<\/p>\n

\u4e3b\u8981\u529f\u80fd\uff1a\u5224\u5b9a\u67d0\u4e2a\u6587\u4ef6\u6240\u5c5e\u7684\u5305\u540d\u79f0<\/p>\n

\u6848\u4f8b\uff1a\u67e5\u8be2\/etc\/ntp.conf\u5c5e\u4e8e\u90a3\u4e2a\u8f6f\u4ef6\u5305<\/p>\n

\n

# rpm -qf \/etc\/ntp.conf<\/span>\nntp-<\/span>4.<\/span>2.<\/span>6p5-<\/span>28.<\/span>el7.<\/span>centos.<\/span>x86_64\n<\/code><\/pre>\n<\/p>\n

\u2606\u67e5\u8be2\u8f6f\u4ef6\u5b89\u88c5\u5b8c\u6210\u540e\u56fd\u5185linux\u4e3b\u673a\uff0c\u751f\u6210\u4e86\u4ec0\u4e48\u6587\u4ef6<\/p>\n

\u57fa\u672c\u53e5\u578b\uff1al=list\uff0c\u663e\u793a\u8fd9\u4e2a\u8f6f\u4ef6\u5b89\u88c5\u540e\u751f\u6210\u4e86\u4ec0\u4e48\u6587\u4ef6<\/p>\n

\n

# rpm -ql \u8f6f\u4ef6\u540d\u79f0<\/span>\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b1\uff1a\u67e5\u8be2firefox\u8f6f\u4ef6\u751f\u6210\u4e86\u4ec0\u4e48\u6587\u4ef6<\/p>\n

\n

# rpm -ql firefox<\/span>\n\u7279\u522b\u8bf4\u660e\uff1a\u8f6f\u4ef6\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4e00\u5171\u751f\u6210\u4e86\u4ee5\u4e0b\u51e0\u7c7b\u6587\u4ef6\n\u914d\u7f6e\u6587\u4ef6\u7c7b\uff1a\/<\/span>etc\u76ee\u5f55\n\u7a0b\u5e8f\u6587\u4ef6\u672c\u8eab\uff0c\u4e8c\u8fdb\u5236\u6587\u4ef6\u547d\u4ee4\uff1a\/<\/span>usr\/<\/span>bin\u6216\/<\/span>usr\/<\/span>sbin\u76ee\u5f55\n\u6587\u6863\u624b\u518c\uff1a\/<\/span>usr\/<\/span>share\/<\/span>doc\u6216man\u76ee\u5f55\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b2\uff1a\u67e5\u8be2openssh\u8f6f\u4ef6\u751f\u6210\u4e86\u4ec0\u4e48\u6587\u4ef6<\/p>\n

\n

# rpm -ql openssh<\/span>\n<\/code><\/pre>\n<\/p>\n

11\u3001\u5149\u76d8\u7684\u6302\u8f7d\u4e0e\u89e3\u6302<\/p>\n

\u5728Linux\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u6240\u6709\u7684\u50a8\u5b58\u8bbe\u5907\u90fd\u5fc5\u987b\u5148\u6302\u8f7d\u4e4b\u540e\u624d\u4f1a\u4f7f\u7528\u3002<\/p>\n

\u95ee\u9898\uff1a\u4e3a\u4f55\u5f53\u6211\u4eec\u76f4\u63a5\u8bbf\u95ee\/run\/media\/itheima\/CentOS7x86_64\u5c31\u76f8\u5f53\u4e8e\u8bbf\u95ee\u5149\u789f<\/p>\n

\u7b54\uff1a\u4e3b\u8981\u8bf1\u56e0\u5c31\u662f\u7531\u4e8eCentOS7\u7684\u64cd\u4f5c\u7cfb\u7edf\u624b\u52a8\u628a\u786c\u76d8\u8bbe\u5907\u6302\u8f7d\u5230\u6b64\u76ee\u5f55\u4e86\uff0c\u8bbf\u95ee\u8fd9\u4e2a\u76ee\u5f55\u5c31\u76f8\u5f53\u4e8e\u8bbf\u95ee\u5149\u789f\u3002<\/p>\n

\u2606\u89e3\u6302<\/p>\n

\n

# cd ~<\/span>\n# umount \/run\/media\/localhost\/CentOS 7 x86_64<\/span>\n<\/code><\/pre>\n<\/p>\n

\u5e38\u89c1\u95ee\u9898\uff1a\u5f53\u6211\u4eec\u6267\u884c\u4ee5\u4e0a\u547d\u4ee4\u65f6\uff0c\u7cfb\u7edf\u63d0\u793atargetisbusy\uff01<\/p>\n

\u51fa\u73b0\u4ee5\u4e0a\u95ee\u9898\u7684\u4e3b\u8981\u7f18\u7531\u5728\u4e8e\u6211\u4eec\u5f53\u524d\u6240\u5728\u7684\u76ee\u5f55\u4e3a\u6302\u8f7d\u76ee\u5f55\u3002<\/p>\n

\u2606\u6302\u8f7d<\/p>\n

\n

# mount \u8bbe\u5907\u6587\u4ef6 \u6302\u8f7d\u76ee\u5f55<\/span>\n<\/code><\/pre>\n<\/p>\n

\u63d0\u793a\uff1a\u786c\u76d8\u7684\u8bbe\u5907\u6587\u4ef6\u4e3a\/dev\/sr0<\/p>\n

\u6848\u4f8b\uff1a\u628a\u786c\u76d8\u6302\u8f7d\u5230\/mnt\/cdrom\u76ee\u5f55<\/p>\n

\n

# mkdir \/mnt\/cdrom<\/span>\n# mount \/dev\/sr0 \/mnt\/cdrom<\/span>\nmount<\/span>: \/<\/span>dev\/<\/span>sr0 is write-protected<\/span>,<\/span> mounting read-only<\/span>\n<\/code><\/pre>\n<\/p>\n

\u6848\u4f8b\uff1a\u628a\/mnt\/cdrom\u8fdb\u884c\u89e3\u6302\u64cd\u4f5c<\/p>\n

\n

# cd ~<\/span>\n# umount \/mnt\/cdrom<\/span>\n<\/code><\/pre><\/p>\n","protected":false},"excerpt":{"rendered":"

\u663e\u793a\u7cfb\u7edf\u670d\u52a1\u4e0e\u7ba1\u9053\u547d\u4ee4\u76f8\u7ed3\u5408\uff0c\u7b5b\u9009\u6211\u4eec\u60f3\u8981\u7684\u670d\u52a1\u4fe1\u606f\u6848\u4f8b\uff1a\u4f7f\u7528systemctl\u547d\u4ee4\u91cd\u542fcrond\u8ba1\u5212\u4efb\u52a1\u7684\u670d\u52a1\u4fe1\u606f\u6848\u4f8b\uff1a\u4eceNTP\u670d\u52a1\u5668\u4e2d\u540c\u6b65\u7cfb\u7edf\u65f6\u95f4\u670d\u52a1\u5668\u4e0a\u7684\u8f6f\u4ef6\u5305\u8fdb\u884c\u5bf9\u5e94\u7ba1\u7406\u64cd\u4f5c\uff0c\u7ba1\u7406\u5206\u4e3a\uff1a\u67e5\u8be2\u3001\u5378\u8f7d\u3001\u5b89\u88c5\/\u66f4\u65b0\u3002\u7b2c\u56db\u6b65\uff1a\u4f7f\u7528cd\u547d\u4ee4\uff0c\u5207\u6362\u5230Packages\u8f6f\u4ef6\u5305\u4e2d\u7b2c\u4e94\u6b65\uff1a\u67e5\u8be2\u6211\u4eec\u8981\u5b89\u88c5\u7684\u8f6f\u4ef6\u5305\u4f9d\u8d56\u5173\u7cfb\u7684\u89e3\u51b3\uff1a\u4f7f\u7528YUM\u8f6f\u4ef6\u5305\u7ba1\u7406\u5de5\u5177\u5bf9\u5176\u8fdb\u884c\u5b89\u88c5\uff08\u81ea\u52a8\u89e3\u51b3\u4f9d\u8d56\u5173\u7cfb\uff09<\/p>\n","protected":false},"author":1,"featured_media":273191,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-273190","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/273190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=273190"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/273190\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/273191"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=273190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=273190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=273190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}