

{"id":1384,"date":"2014-12-16T19:10:47","date_gmt":"2014-12-16T18:10:47","guid":{"rendered":"http:\/\/www.fabionline.net\/aaaaaaa\/?p=1384"},"modified":"2025-03-31T20:44:14","modified_gmt":"2025-03-31T18:44:14","slug":"come-salvare-lelenco-dei-pacchetti-installati-debian","status":"publish","type":"post","link":"https:\/\/www.fabionline.net\/blog\/linux\/come-salvare-lelenco-dei-pacchetti-installati-debian\/","title":{"rendered":"How to save a list of installed packages (Debian)"},"content":{"rendered":"<p><span style=\"color: #000000;\">May\u00a0happen to have to re-install Debian (and derivates) in another pc\/server<\/span><br>\n<span style=\"color: #000000;\">Certainly, if new machine has\u00a0 a similar hardware i could clone hard disk; but more often the other machine has a different hardware&#8230;<\/span><br>\n<span style=\"color: #000000;\">So it is useful to save a list of installed packages; to have them\u00a0immediately available during reinstallation in another (or in same) machine avoiding to remember \u00a0all packages one by one \ud83d\ude42<\/span><br>\n<span style=\"color: #000000;\">As first thing is useful\u00a0to make a copy of \/etc\/apt\/sources.list or annotate \u00a0repository are you using \u00a0\u00a0(wheezy, backports, etc) somewhere.<\/span><\/p>\n<p><span style=\"color: #000000;\">Open terminal (being root) and type:<br>\n<span style=\"color: #0000ff;\">dpkg &#8211;get-selections &gt;<\/span> <span style=\"color: #008000;\">\/home\/$USER\/pacchetti.txt<\/span><br>\n<img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-1385 size-full\" src=\"https:\/\/www.fabionline.net\/blog\/wp-content\/uploads\/pacchetti.jpg\" alt=\"pacchetti\" width=\"624\" height=\"16\" \/><\/span><span style=\"color: #0000ff;\"><span style=\"color: #000000;\"><span style=\"color: #000000;\"><br>\nAt\u00a0this way was created a file named &#8220;pacchetti.txt&#8221; in my \u00a0\/home directory;<br>\nnow you can save your file somewhere; for example, in an external usb drive,so you can use it when you&#8217;ll<\/span> <span style=\"color: #000000;\">need.<\/span><\/span><\/span><\/p>\n<p><span style=\"color: #000000;\">How to restore packages:<br>\nPlace file pacchetti.txt in your \/home , then\u00a0select packages in your file by typing:<br>\n<\/span><span style=\"color: #0000ff;\">sudo dpkg &#8211;set-selections &lt; \/home<\/span><span style=\"color: #008000;\">\/$USER\/pacchetti.txt<\/span><br>\n<span style=\"color: #000000;\">and install selected packages by typing \u00a0:<\/span><br>\n<span style=\"color: #0000ff;\">sudo apt-get dselect-upgrade<\/span><br>\n<img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-1388 size-full\" src=\"https:\/\/www.fabionline.net\/blog\/wp-content\/uploads\/pacchetti21.jpg\" alt=\"pacchetti2\" width=\"622\" height=\"101\" \/>\u00a0\u00a0<span style=\"color: #000000;\">Selected packages will be installed (obviously if missing).<\/span><\/p>","protected":false},"excerpt":{"rendered":"<p>May\u00a0happen to have to re-install Debian (and derivates) in another pc\/server Certainly, if new machine has\u00a0 a similar hardware i could clone hard disk; but more often the other machine has a different hardware&#8230; So it is useful to save &hellip; <a href=\"https:\/\/www.fabionline.net\/blog\/linux\/come-salvare-lelenco-dei-pacchetti-installati-debian\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_links_to":"","_links_to_target":""},"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/www.fabionline.net\/blog\/wp-json\/wp\/v2\/posts\/1384"}],"collection":[{"href":"https:\/\/www.fabionline.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fabionline.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fabionline.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fabionline.net\/blog\/wp-json\/wp\/v2\/comments?post=1384"}],"version-history":[{"count":1,"href":"https:\/\/www.fabionline.net\/blog\/wp-json\/wp\/v2\/posts\/1384\/revisions"}],"predecessor-version":[{"id":2619,"href":"https:\/\/www.fabionline.net\/blog\/wp-json\/wp\/v2\/posts\/1384\/revisions\/2619"}],"wp:attachment":[{"href":"https:\/\/www.fabionline.net\/blog\/wp-json\/wp\/v2\/media?parent=1384"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fabionline.net\/blog\/wp-json\/wp\/v2\/categories?post=1384"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fabionline.net\/blog\/wp-json\/wp\/v2\/tags?post=1384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}