在某些環境下,你可能想要將一個服務器上的軟件包列表裝置到另一個服務器上。例如,你已經經在服務器 A 上裝置了 15 個軟件包而且這些軟件包也必要被裝置到服務器 B、服務器 C 上等等。
咱們可以手動往裝置這些軟件然則這將消費大批的時六合彩規則間。你可以手動裝置一倆個服務器,然則試想若是你有也許十個服務器呢。在這類環境下你沒法手動實現事情,那末奈何才能辦理成績呢?
不要憂慮咱們可以幫你脫節如許的環境以及場景。咱們在這篇文章中增長了四種要領來戰勝難題。
我但愿這可以幫你辦理成績。我已經經在 Centos7 以及 Ubuntu 18.04 上測試了這些下令。
我也但愿這可以在其余刊行版上事情。這僅僅必要使用該刊行版的民間擔保理器下令替換本文中的擔保理器下令就行了。
若是想要 反省 Linux 體系上已經裝置的軟件包列表,請點擊鏈接。
例如,若是你想要在基于 RHEL 體系上創立軟件包列表請使用如下步調。其余刊行版也同樣。
# rpm -qa --last | head -15 | awk '{print $1}' > /tmp/pack1.txt
-
# cat /tmp/pack1.txt
mariadb-server-5.5.60-1.el7_5.x86_64
perl-DBI-1.627-4.el7.x86_64
perl-DBD-MySQL-4.023-6.el7.x86_64
perl-PlRPC-0.2020-14.el7.noarch
perl-Net-Daemon-0.48-5.el7.noarch
perl-IO-Compress-2.061-2.el7.noarch
perl-Compress-Raw-Zlib-2.061-4.el7.x86_64
mar539中二合多少錢iadb-5.5.60-1.el7_5.x86_64
perl-Data-Dumper-2.145-3.el7.x86_64
perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64
httpd-2.4.6-88.el7.centos.x86_64
mailcap-2.1.41-2.el7.noarch
httpd-tools-2.4.6-88.el7.centos.x86_64
apr-util-1.5.2-6.el7.x86_64
apr-1.4.8-3.el7_4.1.x86_64
要領一:若何在 Linux 上使用 cat 下令裝置文件中列出的包?
為完成這個方針,我將使用簡略了然的第一種要領。為此,創立一個文件并增添上你想要裝置的包列表。
出于測試的目的,咱們將只增添如下的三個軟件包名到文件中。
# cat /tmp/pack1.txt
-
apache2
mariadb-server
nano
只需簡略的運轉 apt 下令 就能在 Ubuntu/Debian 體系上一次性裝置一切的軟件包。
# apt -y install $(cat /tmp/pack1.txt)
-  妞妞牌型;
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libopts25 sntp
Use 'sudo apt autoremove' to remove them.
Suggested packages:
apache2-doc apache2-suexec-pristine | apache2-suexec-custom spell
The following NEW packages will be installed:
apache2 mariadb-server nano
0 upgraded, 3 newly installed, 0 to remove and 24 not 偏財運生肖upgraded.
Need to get 339 kB of archives.
After this operation, 1,377 k六合彩二星三星B of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 apache2 amd64 2.4.29-1ubuntu4.6 [95.1 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 nano amd64 2.9.3-2 [231 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 mariadb-server all 1:10.1.38-0ubuntu0.18.04.1 [12.9 kB]
Fetched 339 kB in 19s (18.0 kB/s)
Selecting previously unselected package apache2.
(Reading database ... 290926 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.29-1ubuntu4.6_amd64.deb ...
Unpacking apache2 (2.4.29-1ubuntu4.6) ...
Selecting previously unselected package nano.
Preparing to unpack .../nano_2.9.3-2_amd64.deb ...
Unpacking nano (2.9.3-2) ...
Selecting previously unselected package mariadb-server.
Preparing to unpack .../mariadb-server_1%3a10.1.38-0ubuntu0.18.04.1_all.deb ...
Unpacking mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ...
Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ...
Setting up apache2 (2.4.29-1ubuntu4.6) ...
Processing triggers for ureadahead (0.100.0-20) ...
Processing triggers for install-info (6.5.0.dfsg.1-2) ...
Setting u財神娛樂城p nano (2.9.3-2) ...
update-alternatives: using /bin/nano to provide /usr/bin/editor (editor) in auto mode
update-alternatives: using /bin/nano to provide /usr/bin/pico (pico) in auto mode
Processing triggers for systemd (237-3ubuntu10.20) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Setting up mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ...
【免責聲明】本站內容轉載自互聯網,其相關談吐僅代表作者小我私家概念盡非權勢巨子,不代表本站態度。如您發明內容存在版權成績,請提交相關鏈接至郵箱:,咱們將實時予以處置。
|